:root {
  color-scheme: dark;
  --bg: #1b2016;
  --panel: #262d1f;
  --panel-soft: #2f3726;
  --line: #46503a;
  --text: #f1f2e6;
  --muted: #b2b89e;
  --khaki: #c2ca8d;
  --khaki-bright: #dbe1a7;
  --gold: #e0c06a;
  --gold-bright: #f2dc96;
  --stamina: #b8c97c;
  --chow: #d0b878;
  --discipline: #9fb3a2;
  --time: #8e9a6d;
  --xp: #d6dc9f;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --glass-line: rgba(202, 212, 151, 0.2);
  --paper-line: rgba(150, 120, 80, 0.16);
  --shadow-deep: 0 16px 38px rgba(0, 0, 0, 0.52);
  --tabbar-h: calc(66px + var(--safe-bottom));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  background:
    radial-gradient(120% 76% at 50% 0%, #1a2116 0%, #0c0f09 58%, #070906 100%);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.game {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 430px;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  background:
    radial-gradient(110% 44% at 50% 0%, rgba(57, 69, 42, 0.3), transparent 72%),
    linear-gradient(180deg, var(--bg) 0%, #0f130c 100%);
  box-shadow:
    0 0 0 1px rgba(202, 212, 151, 0.07),
    0 0 70px rgba(0, 0, 0, 0.68);
  isolation: isolate;
}

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.stage .hero {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  transition: opacity 0.45s ease;
}
.stage.lobby .hero {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #6a754c;
  opacity: 1;
}
.barracks-skin {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 1;
  width: auto;
  height: auto;
  max-width: min(92%, 340px);
  max-height: 62vh;
  transform: translate(-50%, -50%);
  object-fit: contain;
  background: transparent;
  mix-blend-mode: normal;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.55));
  pointer-events: none;
}
.lobby-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, #1a2016cc 0%, #1a201688 40%, #1a2016ee 100%),
    url("art/bg_barracks_main.jpg") center / cover no-repeat;
  background-color: #2a3122;
  pointer-events: none;
}
.bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #2a3122;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.55s ease;
  pointer-events: none;
}
.bg-layer.on { opacity: 1; }
.bg-layer[data-bg="bg_barracks_main"] {
  background-color: #3a4530;
  background-image: url("art/bg_barracks_main.jpg");
}
.bg-layer[data-bg="bg_corridor_morning"] {
  background-color: #5a4a32;
  background-image: url("art/bg_corridor_morning.jpg");
}
.bg-layer[data-bg="bg_drill_square"] {
  background-color: #6a6a62;
  background-image: url("art/bg_drill_square.jpg");
}
.npc {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.npc-sil {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 50%;
  background: #12150f;
  box-shadow: inset 0 -10px 0 #1b2016;
  position: relative;
}
.npc-sil::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: -8px;
  height: 14px;
  border-radius: 4px 4px 2px 2px;
  background: #1a1a16;
}
.npc span {
  font-size: 13px;
  color: var(--khaki);
  letter-spacing: 0.04em;
}

.book .dock { display: none !important; }
.book .cal-fab {
  left: auto;
  right: 10px;
  top: 10px;
  width: 48px;
  height: 56px;
  font-size: 16px;
  z-index: 6;
}
.book .cal-fab .cal-num { margin-top: 16px; }
.book .hud-top { right: 62px; }
.book .pill {
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
}
.book .pill span { font-size: 14px; }
.book .event {
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  border: 0;
  border-radius: 0;
  padding: 40px 16px calc(18px + var(--safe-bottom));
  background: linear-gradient(transparent, rgba(8, 10, 6, 0.92) 22%);
}
.book .event h2,
.book #ev-body {
  color: #fff;
  text-shadow: 0 1px 2px #000;
}
.book #ev-choices button {
  background: #1b2016;
  border-color: #c2ca8d;
  color: #fff;
  font-weight: 700;
}
.paywall {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: auto;
  max-width: none;
  padding:
    max(18px, var(--safe-top)) max(16px, var(--safe-right))
    calc(16px + var(--safe-bottom))
    max(16px, var(--safe-left));
  background:
    radial-gradient(120% 90% at 50% 100%, rgba(26, 34, 19, 0.58), rgba(3, 5, 2, 0.86));
  -webkit-backdrop-filter: blur(9px) saturate(0.92);
  backdrop-filter: blur(9px) saturate(0.92);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  animation: paywall-fade 0.2s ease-out;
}
.paywall[hidden] { display: none; }
.paywall-sheet {
  position: relative;
  width: min(100%, 404px);
  margin: auto 0 0;
  padding: 24px 16px 16px;
  border: 1px solid rgba(224, 192, 106, 0.42);
  border-radius: 22px;
  background:
    radial-gradient(110% 70% at 50% 0%, rgba(100, 116, 60, 0.36), transparent 62%),
    linear-gradient(180deg, #2c3621 0%, #161c11 100%);
  color: #fff;
  box-shadow:
    var(--shadow-deep),
    0 0 0 1px rgba(224, 192, 106, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.55);
  animation: paywall-rise 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
  isolation: isolate;
}
.paywall-sheet::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 50%;
  width: 42px;
  height: 3px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(242, 220, 150, 0.48), transparent);
}
.paywall-title {
  margin: 0 0 6px;
  font: 800 23px/1.15 Impact, "Arial Black", sans-serif;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.paywall-copy {
  margin: 0 0 10px;
  font: 14.5px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #e9ecd9;
}
.paywall-note {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-left: 2px solid rgba(224, 192, 106, 0.55);
  border-radius: 0 8px 8px 0;
  background: rgba(10, 13, 8, 0.55);
  color: #adb693;
  font: 11px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.paywall button {
  display: block;
  width: 100%;
  margin-top: 8px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 13px;
  border: 0;
  font: 800 14px/1.15 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.01em;
  background: #c2ca8d;
  color: #1b2016;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s ease, filter 0.16s ease, box-shadow 0.12s ease;
}
.paywall button:active {
  transform: translateY(1px);
  filter: brightness(1.04);
}
.paywall button[hidden] { display: none; }
.paywall button:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
.paywall #pay-ad {
  border: 1px solid rgba(238, 244, 198, 0.5);
  background: linear-gradient(180deg, #d4dba0 0%, #a8b36e 100%);
  color: #17200f;
  box-shadow:
    0 3px 0 #4b552d,
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.paywall #pay-stars {
  border: 1px solid rgba(255, 238, 172, 0.62);
  background: linear-gradient(180deg, #f3d789 0%, #d2ac4e 100%);
  color: #241c0b;
  box-shadow:
    0 3px 0 #705721,
    0 0 18px rgba(224, 192, 106, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.paywall #pay-soft {
  border: 1px solid rgba(190, 158, 98, 0.45);
  background: linear-gradient(180deg, #3b3524, #2a271b);
  color: #e6d8ae;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.paywall #pay-close {
  margin-top: 10px;
  border: 1px solid rgba(202, 212, 151, 0.18);
  background: transparent;
  color: #b8bfa0;
  box-shadow: none;
}
@media (hover: hover) {
  .paywall button:hover {
    filter: brightness(1.04);
  }
  .paywall #pay-close:hover {
    background: rgba(202, 212, 151, 0.06);
  }
}
@keyframes paywall-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes paywall-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.tab-panel {
  display: none;
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}
.tab-panel.on { display: flex; flex-direction: column; }
.tab-panel[hidden] { display: none !important; }
.inventory-screen {
  display: flex; flex-direction: column; height: 100%; width: 100%;
  background:
    radial-gradient(90% 56% at 50% 18%, rgba(63, 74, 48, 0.55), transparent 70%),
    linear-gradient(180deg, #22281d 0%, #131611 100%);
  color: #e0e0d0; overflow: hidden; padding-top: 6px;
}
.skin-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
#player-skin,
.hero-stand {
  height: 260px;
  object-fit: contain;
  background: transparent;
  mix-blend-mode: normal;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,.8));
}
#barracks-skin,
.skin-img,
.skin-card img,
#sklad-list img {
  object-fit: contain;
  background: transparent;
  mix-blend-mode: normal;
}
.skin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  padding: 12px;
  max-width: 400px;
  margin: 0 auto;
  width: 100%;
}
.skin-card {
  background: #181a14;
  border: 1px solid #3a3a2e;
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  color: #e0e0d0;
  font: inherit;
}
.skin-card.on {
  border-color: var(--khaki);
  background: #2f3726;
  box-shadow: 0 0 0 1px var(--khaki), 0 0 12px rgba(194, 202, 141, 0.35);
}
.skin-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
  margin: 0 auto 6px;
}
.skin-name {
  display: block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}
.skin-buff {
  display: block;
  margin-top: 3px;
  color: #c9d0ab;
  font-size: 10px;
  line-height: 1.25;
}
.skin-empty-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px;
  border: 1px dashed #46503a;
  border-radius: 10px;
  color: #b2b89e;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}
.inventory-panel {
  display: flex; gap: 10px; padding: 12px 12px 14px;
  background:
    linear-gradient(180deg, rgba(43, 51, 35, 0.96), rgba(22, 27, 17, 0.98));
  border-top: 1px solid rgba(224, 192, 106, 0.26);
  box-shadow: 0 -8px 22px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  justify-content: center;
  border-radius: 16px 16px 0 0;
  margin-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.inventory-panel[hidden] { display: none; }
.item-card {
  display: flex; flex-direction: column; align-items: center;
  background: #181a14; border: 1px solid #3a3a2e; border-radius: 10px;
  padding: 6px; width: 82px; flex: 0 0 82px;
}
.item-cigs { border-color: #8a7348; }
.item-icon { width: 35px; height: 35px; object-fit: contain; margin-bottom: 2px; }
.item-count {
  color: #e6d27a;
  font: 700 11px/1.2 "Courier New", monospace;
}
.item-name {
  color: #d6c49a;
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
}
.item-note {
  margin-top: 2px;
  color: #9aa181;
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
}
.btn-equip {
  width: 100%; padding: 5px 0; background: linear-gradient(to bottom, #5c8a42, #3e612b);
  border: 1px solid #7ba65d; border-radius: 4px; color: white;
  font-size: 10px; font-weight: bold; cursor: pointer;
  box-shadow: 0 2px 0 #243a19;
}
.btn-equip:active { transform: translateY(2px); box-shadow: none; }
.inventory-panel .inv-empty {
  margin: auto;
  color: #8f9679;
  font-size: 12px;
}
.npc img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--khaki);
}
.pill b.pop { animation: statpop 0.35s ease; display: inline-block; }
@keyframes statpop {
  50% { transform: scale(1.28); color: #e8d48a; }
}
.tab-panel {
  opacity: 1;
  transition: opacity 0.22s ease;
}

.pane {
  overflow: auto;
  padding:
    8px max(12px, var(--safe-right))
    14px
    max(12px, var(--safe-left));
  background: #161a12;
  background-size: cover;
  background-position: center;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
#tab-chipok {
  background:
    radial-gradient(110% 56% at 50% 0%, rgba(58, 70, 42, 0.34), transparent 72%),
    #12160e;
}
#tab-bag {
  background: #1e221b;
  padding: 0;
}
#tab-sklad {
  background-image:
    linear-gradient(rgba(12, 14, 10, 0.56), rgba(12, 14, 10, 0.76)),
    url("art/bg_sklad.jpg");
}
.pane-title {
  position: relative;
  margin: 10px 2px 8px;
  color: #f0f2df;
  font: 800 22px/1.2 Georgia, "Times New Roman", serif;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
.pane-title::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  margin-top: 6px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.tabs {
  position: relative;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  flex: 0 0 auto;
  min-height: var(--tabbar-h);
  padding:
    6px max(5px, var(--safe-right))
    calc(6px + var(--safe-bottom))
    max(5px, var(--safe-left));
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(55, 66, 39, 0.5), transparent 72%),
    linear-gradient(180deg, rgba(25, 31, 19, 0.98) 0%, rgba(11, 15, 8, 0.99) 100%);
  border-top: 1px solid rgba(224, 192, 106, 0.24);
  box-shadow:
    0 -10px 26px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.tabs button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 54px;
  padding: 5px 2px 4px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #99a181;
  font: 800 11px/1.1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.01em;
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.12s ease,
    box-shadow 0.18s ease;
}
.tabs button .ti {
  display: grid;
  place-items: center;
  width: 26px;
  height: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 17px;
  line-height: 1;
  font-style: normal;
  filter: grayscale(0.4) brightness(0.82);
  transition: background 0.18s ease, filter 0.18s ease, transform 0.18s ease;
}
.tabs button.on {
  border-color: rgba(224, 192, 106, 0.64);
  background:
    linear-gradient(180deg, rgba(224, 192, 106, 0.22) 0%, rgba(224, 192, 106, 0.07) 58%, rgba(224, 192, 106, 0.03) 100%),
    linear-gradient(180deg, rgba(55, 64, 39, 0.98) 0%, rgba(28, 35, 20, 0.98) 100%);
  color: #f7e4a4;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.17),
    inset 0 -2px 0 rgba(224, 192, 106, 0.62),
    0 3px 12px rgba(0, 0, 0, 0.34),
    0 0 15px rgba(224, 192, 106, 0.11);
  transform: translateY(-1px);
}
.tabs button.on::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
}
.tabs button.on .ti {
  background: rgba(224, 192, 106, 0.18);
  filter: none;
  transform: scale(1.06);
}
.tabs button:active {
  transform: translateY(1px);
}
.tabs button.on:active {
  transform: translateY(0);
}
.tabs button:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: -2px;
}
@media (hover: hover) {
  .tabs button:not(.on):hover {
    color: #d4dbae;
    background: rgba(255, 255, 255, 0.03);
  }
}
.inv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.inv-slot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 72px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
  text-align: left;
}
.inv-slot.on { border-color: var(--khaki); }
.service-idle {
  position: relative;
  z-index: 2;
  margin: auto 16px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(202, 212, 151, 0.26);
  border-radius: 16px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(74, 88, 52, 0.32), transparent 68%),
    rgba(14, 18, 10, 0.9);
  box-shadow:
    var(--shadow-deep),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
}
.service-progress {
  margin: 0 0 5px;
  color: var(--khaki);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.service-idle h2 {
  margin: 0 0 8px;
  font: 800 24px/1.15 Georgia, "Times New Roman", serif;
  color: #f3f4e6;
}
.service-idle button,
#sklad-list button {
  width: 100%;
  margin-top: 8px;
  min-height: 44px;
  border: 1px solid rgba(230, 238, 186, 0.42);
  border-radius: 11px;
  background: linear-gradient(180deg, #d3d99a, #a9b46d);
  color: #1b2016;
  font: 800 14px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  box-shadow:
    0 2px 0 #4f5a2e,
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  cursor: pointer;
  touch-action: manipulation;
}
#start-story {
  min-height: 50px;
  border-color: rgba(238, 226, 166, 0.74);
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow:
    0 3px 0 #4a552b,
    0 8px 18px rgba(0, 0, 0, 0.28),
    0 0 18px rgba(224, 192, 106, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
#start-story:active {
  transform: translateY(1px);
  filter: brightness(1.04);
  box-shadow:
    0 1px 0 #4a552b,
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}
#start-story:focus-visible,
#sklad-list button:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
.sklad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  padding: 4px 0 12px;
}
.sklad-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(202, 212, 151, 0.15);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(43, 51, 34, 0.72), rgba(20, 25, 15, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 4px 14px rgba(0, 0, 0, 0.22);
  color: #e0e0d0;
  text-align: center;
}
.sklad-card.on {
  border-color: rgba(224, 192, 106, 0.65);
  background:
    linear-gradient(180deg, rgba(63, 73, 45, 0.8), rgba(31, 38, 22, 0.95));
  box-shadow:
    0 0 0 1px rgba(224, 192, 106, 0.35),
    0 0 16px rgba(224, 192, 106, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.sklad-card img {
  width: 100%;
  height: 110px;
  object-fit: contain;
  display: block;
  margin: 0 auto 6px;
}
.sklad-name {
  margin: 0;
  color: #f1f2e6;
  font: 700 14px/1.2 Impact, "Arial Black", sans-serif;
  letter-spacing: 0.02em;
}
.sklad-buff {
  margin: 3px 0 0;
  color: #c9d0ab;
  font-size: 11px;
  line-height: 1.3;
}
.sklad-price {
  margin: 5px 0 0;
  color: var(--gold);
  font: 700 12px/1.2 "Courier New", ui-monospace, monospace;
}
.sklad-card button:disabled,
.sklad-card button.locked {
  opacity: 0.4;
  cursor: pointer;
}

.hud-top {
  position: relative;
  z-index: 8;
  flex: 0 0 auto;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: stretch;
  gap: 5px;
  padding:
    calc(7px + var(--safe-top))
    max(8px, var(--safe-right))
    7px
    max(8px, var(--safe-left));
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(59, 70, 43, 0.4), transparent 76%),
    linear-gradient(180deg, rgba(28, 34, 21, 0.98) 0%, rgba(14, 18, 10, 0.99) 100%);
  border-bottom: 1px solid rgba(224, 192, 106, 0.16);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.42),
    inset 0 -1px 0 rgba(0, 0, 0, 0.42);
}

.crate {
  position: absolute;
  z-index: 6;
  left: 10px;
  right: 10px;
  bottom: 8px;
  padding: 10px 12px 12px;
  background: #d7c49a;
  background-image: repeating-linear-gradient(0deg, #0000 0 18px, #cbb89255 18px 19px);
  border: 3px solid #5c3d24;
  box-shadow: inset 0 0 0 2px #ead9b0, 0 6px 16px #0006;
  color: #2a2418;
  font-family: "Courier New", ui-monospace, monospace;
}
.crate .toast,
.crate .regen-hud {
  position: static;
  left: auto;
  right: auto;
  margin: 0;
  padding: 0;
  background: none;
  color: #2a2418;
  font-size: 14px;
}
.crate .regen-hud { color: #5a4a32; font-size: 12px; margin-top: 4px; }
.lobby-stack {
  position: absolute;
  z-index: 7;
  left: 16px;
  right: 16px;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lobby-stack .toast,
.lobby-stack .regen-hud {
  position: static;
  left: auto;
  right: auto;
}
.lobby-stack .barracks-goal {
  position: static;
  margin: 0;
  padding: 6px 9px;
  border: 1px solid rgba(194, 202, 141, 0.26);
  border-radius: 8px;
  background: rgba(10, 13, 8, 0.82);
  color: #e8d48a;
  font-size: 12px;
  line-height: 1.35;
}
.stage.lobby #start-day {
  position: relative;
  z-index: 6;
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 14px 42px;
  overflow: hidden;
  border: 1px solid rgba(238, 226, 166, 0.78);
  border-radius: 13px;
  background:
    linear-gradient(180deg, #a4b667 0%, #778b49 46%, #556832 100%);
  color: #fbf9e7;
  font: 800 16px/1 Impact, "Arial Black", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3), 0 0 16px rgba(226, 234, 170, 0.22);
  box-shadow:
    0 5px 0 #2c3919,
    0 12px 26px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(224, 192, 106, 0.18),
    0 0 22px rgba(224, 192, 106, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -3px 9px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s ease, filter 0.16s ease, box-shadow 0.1s ease;
}
.stage.lobby #start-day::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 44%);
  pointer-events: none;
}
.stage.lobby #start-day::after {
  content: "›";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-54%);
  color: rgba(255, 238, 172, 0.78);
  font: 700 28px/1 Georgia, "Times New Roman", serif;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
  pointer-events: none;
}
.stage.lobby #start-day:active {
  transform: translateY(2px);
  filter: brightness(1.06);
  box-shadow:
    0 2px 0 #2c3919,
    0 5px 12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(224, 192, 106, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.stage.lobby #start-day:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}
@media (hover: hover) {
  .stage.lobby #start-day:hover {
    filter: brightness(1.04);
  }
}
.mono-bar {
  display: flex;
  gap: 8px;
}
.mono-bar button {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 8px 6px;
  border: 1px solid #46503a;
  border-radius: 10px;
  background: linear-gradient(180deg, #2f3726, #22271d);
  color: var(--khaki-bright);
  font: 800 12px/1.15 Impact, "Arial Black", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 3px 0 #10130d;
  cursor: pointer;
}
.mono-bar button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #10130d;
}
.mono-bar button:disabled {
  opacity: 0.55;
  box-shadow: none;
  cursor: default;
}
.mono-bar #ad-energy {
  flex: 1 1 100%;
  width: 100%;
  border-color: #6f7f4d;
  background: linear-gradient(180deg, #3f4d2d, #2a3420);
  color: #e8edbd;
}
.cal-fab .cal-period { display: none !important; }
.chipok-donate {
  border-color: #8b7355 !important;
  background: linear-gradient(135deg, #2a2818, #1a1810) !important;
}
.shop-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid #3a3a2e;
  border-radius: 12px;
  background: linear-gradient(135deg, #22251e, #151710);
  color: #e0e0d0;
  text-align: left;
  cursor: pointer;
}
.shop-ico { font-size: 28px; width: 36px; text-align: center; flex: 0 0 36px; }
.shop-name { margin: 0; font: 700 15px/1.2 Impact, "Arial Black", sans-serif; letter-spacing: 0.04em; }
.shop-price { font: 700 14px/1 "Courier New", monospace; color: #c4b48a; }
#chipok-list { display: flex; flex-direction: column; gap: 12px; padding: 4px 2px 20px; }
.chipok-card {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 3px 12px;
  padding: 14px 14px 13px 16px;
  overflow: hidden;
  border: 1px solid rgba(202, 212, 151, 0.18);
  border-radius: 15px;
  background:
    radial-gradient(120% 100% at 0 0, rgba(224, 192, 106, 0.08), transparent 56%),
    linear-gradient(180deg, rgba(52, 61, 41, 0.74) 0%, rgba(23, 28, 18, 0.94) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 4px 14px rgba(0, 0, 0, 0.24);
  color: #e0e0d0;
  transition: transform 0.16s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.chipok-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(224, 192, 106, 0.78), rgba(194, 202, 141, 0.06));
  opacity: 0.78;
  pointer-events: none;
}
.chipok-ico-wrap {
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 20%, rgba(224, 192, 106, 0.2), transparent 66%),
    linear-gradient(180deg, #2c3423, #1a2015);
  border: 1px solid rgba(202, 212, 151, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.25);
}
.chipok-ico-wrap .shop-ico { font-size: 27px; line-height: 1; }
.chipok-copy { grid-column: 2; min-width: 0; padding-top: 1px; }
.chipok-card .shop-name {
  margin: 0;
  color: #f1f2e6;
  font: 700 15.5px/1.2 Impact, "Arial Black", sans-serif;
  letter-spacing: 0.02em;
}
.chipok-desc { margin: 4px 0 0; color: #a8b08e; font-size: 11.5px; line-height: 1.4; }
.chipok-owned {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border: 1px solid rgba(224, 192, 106, 0.3);
  border-radius: 999px;
  background: rgba(224, 192, 106, 0.12);
  color: #e7dfae;
  font: 700 10px/1.5 system-ui, sans-serif;
}
.chipok-buy {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(202, 212, 151, 0.1);
}
.chipok-buy .shop-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid rgba(224, 192, 106, 0.2);
  border-radius: 999px;
  background: rgba(224, 192, 106, 0.09);
  color: var(--gold-bright);
  font: 800 15px/1 "Courier New", ui-monospace, monospace;
  text-shadow: 0 0 10px rgba(224, 192, 106, 0.18);
}
.chipok-buy button {
  min-height: 40px;
  padding: 8px 20px;
  border: 1px solid rgba(230, 238, 186, 0.5);
  border-radius: 10px;
  background: linear-gradient(180deg, #d3d99a 0%, #a9b46d 100%);
  color: #1b2016;
  font: 800 13px/1.2 system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow:
    0 2px 0 #4f5a2e,
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
  transition: transform 0.1s ease, filter 0.16s ease, box-shadow 0.1s ease;
}
.chipok-buy button:active {
  transform: translateY(1px);
  filter: brightness(1.05);
  box-shadow: 0 1px 0 #4f5a2e;
}
.chipok-buy button:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
@media (hover: hover) {
  .chipok-card:hover {
    transform: translateY(-1px);
    border-color: rgba(224, 192, 106, 0.34);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 8px 20px rgba(0, 0, 0, 0.3);
  }
}
.chipok-pay {
  position: fixed;
  left: 50%;
  bottom: calc(18% + var(--safe-bottom));
  z-index: 35;
  width: min(92%, 372px);
  padding: 20px 18px 16px;
  transform: translate(-50%, 0);
  border: 1px solid rgba(224, 192, 106, 0.42);
  border-radius: 20px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(100, 116, 60, 0.32), transparent 64%),
    linear-gradient(180deg, #29331f, #141910);
  box-shadow:
    var(--shadow-deep),
    0 0 0 1px rgba(224, 192, 106, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #e8edc8;
  animation: chipok-rise 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes chipok-rise {
  from { opacity: 0; transform: translate(-50%, 18px) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.chipok-pay[hidden] { display: none; }
.chipok-pay-name {
  margin: 0 0 6px;
  font: 800 20px/1.2 Impact, "Arial Black", sans-serif;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
}
.chipok-pay-text { margin: 0 0 16px; color: #bdc69a; font-size: 14px; }
.chipok-pay-actions { display: flex; gap: 8px; }
.chipok-pay-actions button {
  flex: 1;
  min-height: 46px;
  border-radius: 11px;
  border: 0;
  font: 800 14px/1 system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}
#chipok-pay-yes {
  border: 1px solid rgba(238, 244, 198, 0.48);
  background: linear-gradient(180deg, #d3d99a, #a9b46d);
  color: #1b2016;
  box-shadow:
    0 2px 0 #4f5a2e,
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
#chipok-pay-no {
  background: rgba(47, 55, 38, 0.72);
  color: #c2ca8d;
  border: 1px solid rgba(202, 212, 151, 0.24);
}
.chipok-buy button.busy,
.chipok-buy button:disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: wait;
}
#tab-service .event {
  left: 10px;
  right: 10px;
  bottom: 10px;
  max-height: calc(100% - 20px);
  padding: 19px 16px 17px 30px;
  overflow-y: auto;
  border: 1px solid #b89a6a;
  border-left: 4px solid rgba(138, 59, 50, 0.62);
  border-radius: 4px 12px 12px 4px;
  background:
    linear-gradient(90deg, transparent 0 25px, rgba(138, 59, 50, 0.2) 25px 26px, transparent 26px),
    radial-gradient(circle at 92% 6%, rgba(120, 90, 50, 0.11) 0 2px, transparent 3px),
    repeating-linear-gradient(180deg, transparent 0 23px, var(--paper-line) 23px 24px),
    linear-gradient(160deg, #fbf3df 0%, #f0e2c2 62%, #e8d6b0 100%);
  color: #2a2418;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 0 0 1px rgba(255, 250, 235, 0.34),
    0 10px 28px rgba(0, 0, 0, 0.5),
    0 2px 0 rgba(90, 64, 38, 0.22);
  font-family: "Courier New", ui-monospace, monospace;
  scrollbar-width: thin;
  scrollbar-color: rgba(138, 59, 50, 0.4) transparent;
}
#tab-service .event::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 24px;
  background: linear-gradient(225deg, #ddc99f 0 49%, #c4a46e 50% 100%);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  opacity: 0.9;
  pointer-events: none;
}
#tab-service .event::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 74px;
  height: 13px;
  border: 1px solid rgba(150, 118, 65, 0.16);
  border-radius: 1px;
  transform: translateX(-50%) rotate(-1.4deg);
  background: linear-gradient(180deg, rgba(232, 210, 158, 0.66), rgba(214, 188, 130, 0.42));
  box-shadow: 0 1px 2px rgba(90, 64, 38, 0.12);
  pointer-events: none;
}
#tab-service .event h2 {
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(138, 59, 50, 0.22);
  color: #2a1c12;
  font: 800 20px/1.18 Georgia, "Times New Roman", serif;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}
#tab-service #ev-body { color: #3b3224; line-height: 1.55; }

.pill {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 42px;
  flex: 1 1 auto;
  padding: 6px 6px;
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(66, 77, 50, 0.62) 0%, rgba(24, 30, 17, 0.84) 100%);
  border: 1px solid var(--glass-line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.28);
  -webkit-backdrop-filter: blur(10px) saturate(1.16);
  backdrop-filter: blur(10px) saturate(1.16);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.pill::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(90% 80% at 18% 0%, rgba(255, 255, 255, 0.12), transparent 62%);
  pointer-events: none;
}
.pill::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 46%);
  pointer-events: none;
}
.pill-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.05;
}
.hud-ico {
  position: relative;
  z-index: 1;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.55));
}
.hud-ico.coin {
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f3e3a8, #b8923a);
  border: 1px solid #8a7030;
  height: 14px;
  width: 14px;
}
.hud-ico.cig {
  background: #c4b48a;
  border-radius: 1px;
  height: 6px;
  width: 14px;
  position: relative;
  align-self: center;
}
.hud-ico.cig::after {
  content: "";
  position: absolute;
  right: -3px;
  top: -1px;
  width: 4px;
  height: 8px;
  background: #8a3b32;
  border-radius: 0 2px 2px 0;
}
.pill-text small {
  color: #a9b18f;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill-text b {
  color: #f3f4e8;
  font: 700 15px/1.05 "Courier New", ui-monospace, monospace;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
#pill-stamina { flex-shrink: 0; }
#pill-stamina .pill-text b { letter-spacing: -0.08em; }

.pill.gold {
  border-color: rgba(224, 192, 106, 0.48);
  background:
    linear-gradient(180deg, rgba(84, 73, 38, 0.68) 0%, rgba(37, 32, 18, 0.9) 100%);
}
.pill.gold::before {
  background:
    radial-gradient(95% 90% at 20% 0%, rgba(242, 220, 150, 0.18), transparent 64%);
}
.pill.gold b {
  color: var(--gold-bright);
  text-shadow: 0 0 10px rgba(224, 192, 106, 0.3), 0 1px 2px rgba(0, 0, 0, 0.5);
}
#pill-payki { border-color: rgba(224, 192, 106, 0.34); }
#pill-stamina { border-color: rgba(184, 201, 124, 0.3); }
#pill-auth { border-color: rgba(159, 179, 162, 0.26); }
#pill-payki {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
#pill-payki:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

@media (max-width: 380px) {
  .hud-top { gap: 4px; padding-left: 6px; padding-right: 6px; }
  .pill { gap: 3px; padding: 5px 4px; }
  .hud-ico { flex-basis: 14px; width: 14px; height: 14px; font-size: 12px; }
  .hud-ico.coin { width: 12px; height: 12px; }
  .hud-ico.cig { width: 12px; height: 5px; }
  .pill-text small { font-size: 8px; }
  .pill-text b { font-size: 13px; }
}

@media (max-width: 340px) {
  .hud-top { gap: 3px; padding-left: 4px; padding-right: 4px; }
  .pill { gap: 2px; padding: 4px 3px; }
  .hud-ico { flex-basis: 12px; width: 12px; height: 12px; font-size: 11px; }
  .pill-text small { font-size: 7px; }
  .pill-text b { font-size: 12px; }
}
@media (max-width: 360px) {
  .tabs button { min-height: 52px; font-size: 10px; }
  .tabs button .ti { width: 24px; height: 22px; font-size: 16px; }
}

.toast,
.regen-hud {
  position: absolute;
  z-index: 7;
  left: 8px;
  right: 8px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(194, 202, 141, 0.22);
  background: rgba(10, 13, 8, 0.9);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  color: #e7ebd2;
  backdrop-filter: blur(4px);
}

.toast { bottom: 8px; font-size: 12.5px; line-height: 1.35; }
.regen-hud { bottom: 48px; color: #c9d0ab; font-size: 11.5px; line-height: 1.3; }

.event {
  position: absolute;
  z-index: 5;
  left: 10px;
  right: 10px;
  bottom: 72px;
  max-height: calc(100% - 16px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(25, 30, 19, 0.96), rgba(12, 15, 9, 0.96));
  border: 1px solid rgba(194, 202, 141, 0.4);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.event h2 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.2;
}

.event-kicker {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--khaki);
}

#ev-body {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-line;
}

#ev-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

#ev-choices button {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #59633f;
  border-radius: 10px;
  background: #2f3726;
  color: var(--khaki-bright);
  font: inherit;
  line-height: 1.25;
  touch-action: manipulation;
}

#ev-choices button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
#ev-choices button.locked {
  opacity: 0.45;
  cursor: pointer;
}
#ev-choices button.energy-help {
  border-color: #d8ab4a;
  background: linear-gradient(180deg, #5a4a20, #352b13);
  color: #ffe8a3;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 232, 163, 0.25);
}
#tab-service #ev-choices button {
  border: 1px solid #b39a6c;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbf2dc 0%, #ecdcba 100%);
  color: #332d20;
  font: 700 14px/1.25 "Courier New", ui-monospace, monospace;
  box-shadow:
    0 2px 0 rgba(120, 90, 50, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
#tab-service #ev-choices button:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 0 rgba(120, 90, 50, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
#tab-service #ev-choices button:disabled {
  opacity: 0.4;
}
#tab-service #ev-choices button.locked {
  opacity: 0.45;
}
#tab-service #ev-choices button.energy-help {
  border-color: #8a6a20;
  background: linear-gradient(180deg, #f0d894, #d8b665);
  color: #2a2418;
}

.dock {
  flex: 0 0 auto;
  padding: 8px max(8px, var(--safe-right)) calc(10px + var(--safe-bottom)) max(8px, var(--safe-left));
  background: #1a1f14;
  border-top: 1px solid #46503a;
}

.acts,
.dock-tools {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.dock-tools {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

.acts button,
.dock-tools button {
  min-height: 40px;
  border: 1px solid #59633f;
  border-radius: 10px;
  background: #2f3726;
  color: var(--khaki-bright);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.acts button:disabled {
  opacity: 0.4;
}

.dock .inv-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0;
}

.sheet {
  position: fixed;
  inset: auto 0 0 0;
  max-width: 430px;
  margin: 0 auto;
  max-height: 72dvh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px max(12px, var(--safe-right)) calc(16px + var(--safe-bottom)) max(12px, var(--safe-left));
  background: #1b2016;
  border-top: 1px solid rgba(194, 202, 141, 0.6);
  box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.55);
  z-index: 20;
}

.sheet-close {
  width: 100%;
  min-height: 40px;
  margin-bottom: 10px;
}

.app {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 14px 0 calc(24px + var(--safe-bottom));
}

/* Banner */

.banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px dashed #7f8a56;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(194, 202, 141, 0.13), rgba(194, 202, 141, 0.05));
  color: var(--khaki-bright);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
}

.banner::before {
  content: "★";
  color: var(--khaki);
  font-size: 15px;
}

/* Header */

.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 23px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.day-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  min-width: 64px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.day-chip span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.day-chip strong {
  color: var(--khaki-bright);
  font-size: 22px;
  line-height: 1.2;
}

/* Cards */

.card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.rank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.rank-name {
  margin: 0;
  color: var(--khaki-bright);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.xp-total {
  text-align: right;
}

.xp-total strong {
  display: block;
  color: var(--text);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.xp-total span {
  color: var(--muted);
  font-size: 11px;
}

.next-rank {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.stat-note {
  margin: -2px 0 6px;
  color: #aeb68e;
  font-size: 11px;
  line-height: 1.3;
}

/* Bars */

.stats {
  display: grid;
  gap: 13px;
}

.stat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 14px;
}

.stat-head strong {
  color: var(--khaki-bright);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  background: #151a10;
  overflow: hidden;
}

.fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 0.25s ease;
}

.fill-stamina {
  background: var(--stamina);
}

.fill-chow {
  background: var(--chow);
}

.fill-discipline {
  background: var(--discipline);
}

.fill-time {
  background: var(--time);
}

.fill-xp {
  background: var(--xp);
}

/* Actions */

.actions {
  display: grid;
  gap: 10px;
}

.action {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  min-height: 70px;
  padding: 14px 40px 14px 16px;
  border: 1px solid #59633f;
  border-radius: 16px;
  background: linear-gradient(180deg, #3a4230, #303726);
  box-shadow: 0 2px 0 #141810;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.08s ease, filter 0.15s ease;
}

.action::after {
  content: "›";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--khaki);
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
}

.action:active {
  transform: translateY(1px);
  filter: brightness(1.08);
}

.action:focus-visible {
  outline: 2px solid var(--khaki-bright);
  outline-offset: 2px;
}

.action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.action-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.action-meta {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

/* Log and footer */

.log {
  margin: 0;
  min-height: 42px;
  padding: 10px 12px;
  border-left: 3px solid #6f7a45;
  border-radius: 8px;
  background: rgba(194, 202, 141, 0.07);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

.reset {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid #5c4c40;
  border-radius: 12px;
  background: transparent;
  color: #cdb3a2;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
}

.reset:active {
  background: rgba(205, 179, 162, 0.08);
}

.reset:focus-visible {
  outline: 2px solid var(--khaki-bright);
  outline-offset: 2px;
}

.wallet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.coin {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.coin span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.coin strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.coin.stars strong {
  color: #e6d27a;
}

.regen {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.hook-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.hook {
  min-height: 44px;
  border: 1px solid #59633f;
  border-radius: 12px;
  background: #3a4230;
  color: var(--khaki-bright);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.hook:disabled {
  opacity: 0.45;
}

.shop-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.shop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin-bottom: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.shop-item:disabled {
  opacity: 0.5;
  cursor: default;
}

.hint {
  margin: 0;
  color: #8a9076;
  font-size: 11px;
  text-align: center;
}

.doll-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.scene-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #2a2418;
}

.scene {
  position: relative;
  height: auto;
  overflow: hidden;
  background: #1a1810;
}

.hero {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.scene-bg {
  position: absolute;
  inset: 0;
}

.wall {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, #5a6a42 0 58%, #6e5a3a 58% 62%, #4a3c28 62%);
}

.window {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 70px;
  height: 78px;
  border: 4px solid #7a6848;
  background: linear-gradient(#8ec4e0, #dfe9c8);
  box-shadow: inset 0 0 0 2px #c8b48a;
}

.locker {
  position: absolute;
  right: 10px;
  bottom: 38%;
  width: 42px;
  height: 90px;
  border-radius: 4px 4px 0 0;
  background: #3d4a32;
  box-shadow: inset -8px 0 0 #2f3a28;
}

.bunk {
  position: absolute;
  left: 8px;
  right: 70px;
  bottom: 0;
  height: 36px;
  background: #5a4028;
  border-top: 8px solid #7a5a38;
}

.sitter {
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 210px;
  height: 270px;
  transform: translateX(-58%);
}

.inv-title {
  margin: 0;
  padding: 8px 12px 0;
  color: #d6c49a;
  font-size: 12px;
  font-weight: 600;
}

.inv-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px 14px;
  -webkit-overflow-scrolling: touch;
}

.inv-slot {
  position: relative;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  border: 2px solid #8a7348;
  border-radius: 8px;
  background: linear-gradient(180deg, #3a3224, #241c14);
  color: #f1e6c8;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.inv-slot.on {
  outline: 2px solid var(--khaki-bright);
}

.inv-slot .ico {
  font-size: 22px;
  line-height: 34px;
}

.inv-slot .nm {
  display: block;
  font-size: 9px;
  color: #cbb98a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-slot.empty {
  opacity: 0.35;
  cursor: default;
}

.inv-n {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 9px;
  color: #8a7a58;
}

.doll-wrap {
  width: 160px;
  height: 250px;
}

.doll {
  width: 160px;
  height: 250px;
  display: block;
}

.slots,
.wardrobe {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.gear {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
}

.gear.on {
  border-color: var(--khaki);
  background: #3a4230;
  color: var(--khaki-bright);
}

@media (max-width: 360px) {
  h1 {
    font-size: 21px;
  }

  .action-meta {
    font-size: 12px;
  }

  .rank-name {
    font-size: 20px;
  }
}

.onboard {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: #0e100c;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.onboard:not([hidden]) {
  opacity: 0;
}
.onboard.on {
  opacity: 1;
}
.onboard[hidden] {
  display: none;
}
.onboard-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #0e100c;
}
.onboard-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding:
    48px max(16px, var(--safe-right))
    calc(16px + var(--safe-bottom))
    max(16px, var(--safe-left));
  background: linear-gradient(transparent, #0e100c 42%);
}
.onboard-text {
  margin: 0 0 12px;
  font-size: 16px;
}
.onboard-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.onboard-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3a4230;
}
.onboard-dots span.on {
  background: var(--khaki);
}
.onboard-next,
.onboard-skip {
  font: inherit;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}
.onboard-next {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: var(--khaki);
  color: #1b2016;
  font-weight: 700;
}
.onboard-skip {
  position: absolute;
  top: calc(8px + var(--safe-top));
  right: max(10px, var(--safe-right));
  z-index: 2;
  border: 1px solid rgba(202, 212, 151, 0.18);
  background: rgba(18, 21, 15, 0.7);
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.tut {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}
.tut[hidden] {
  display: none;
}
.tut-dim {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 6, 0.45);
}
.tut-bubble {
  position: absolute;
  left: max(12px, var(--safe-left));
  right: max(12px, var(--safe-right));
  max-width: 320px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #1f2619;
  border: 1px solid var(--khaki);
  color: var(--text);
  font-size: 14px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.tut-bubble.on {
  opacity: 1;
  transform: none;
}
.tut-on {
  position: relative;
  z-index: 31;
  outline: 2px solid var(--khaki);
  box-shadow: 0 0 0 4px rgba(194, 202, 141, 0.25);
}

.cal-fab {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 9;
  width: 56px;
  height: 66px;
  overflow: visible;
  border: 1px solid #7a3a2e;
  border-radius: 4px 6px 8px 8px;
  background:
    linear-gradient(90deg,
      rgba(138, 59, 50, 0.34) 0 5px,
      transparent 5px 8px,
      rgba(138, 59, 50, 0.16) 8px 9px,
      transparent 9px),
    repeating-linear-gradient(180deg, transparent 0 12px, rgba(126, 98, 58, 0.14) 12px 13px),
    linear-gradient(160deg, #fdf6e4 0%, #f3e6c8 60%, #e6d3a8 100%);
  color: #2a1c12;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 2px 0 #d4bd8e,
    0 5px 0 #1b2016,
    0 11px 20px rgba(0, 0, 0, 0.48);
  font: 800 17px/1 "Courier New", Georgia, serif;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.cal-fab .cal-num {
  display: block;
  margin-top: 16px;
  color: #2a1c12;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}
.cal-fab .cal-num::before {
  content: "ДМБ";
  display: block;
  margin-bottom: 1px;
  color: #8a3b32;
  font: 800 7px/1 Georgia, "Times New Roman", serif;
  letter-spacing: 0.16em;
  text-shadow: none;
}
.cal-fab .cal-period {
  display: block;
  margin-top: 4px;
  font: 700 8px/1 Georgia, serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7a5a3a;
  white-space: nowrap;
}
.cal-fab::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 5px;
  right: 5px;
  height: 8px;
  border-radius: 2px;
  background:
    radial-gradient(circle at 4px 4px, #f5e7c6 0 1.5px, #7a3a2e 2px 3px, transparent 3.5px)
    0 0 / 9px 8px repeat-x;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}
.cal-fab::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, transparent 49%, #d8c49a 50%);
  box-shadow: -1px -1px 0 rgba(0, 0, 0, 0.1) inset;
}
.cal-fab:active {
  transform: translateY(2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 1px 0 #d4bd8e,
    0 2px 0 #1b2016,
    0 5px 10px rgba(0, 0, 0, 0.42);
}
.cal-fab:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}
@media (hover: hover) {
  .cal-fab:hover {
    transform: translateY(-1px);
  }
  .cal-fab:active:hover {
    transform: translateY(2px);
  }
}
.cal-fab.need {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 2px 0 #d4bd8e,
    0 5px 0 #1b2016,
    0 11px 20px rgba(0, 0, 0, 0.48),
    0 0 16px rgba(224, 192, 106, 0.45);
}
.cal-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: 2;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f6df9a, #c99a32);
  border: 1px solid #2a2216;
  box-shadow:
    0 0 0 2px rgba(224, 192, 106, 0.16),
    0 0 8px rgba(224, 192, 106, 0.55);
  animation: calpulse 1.4s ease-out infinite;
}
@keyframes calpulse {
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.cal-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 25;
  width: 100%;
  max-width: 430px;
  max-height: 84dvh;
  overflow: auto;
  transform: translateX(-50%);
  padding:
    16px max(16px, var(--safe-right))
    calc(18px + var(--safe-bottom))
    max(22px, calc(12px + var(--safe-left)));
  color: #2a2216;
  border-top: 4px solid #6b2e28;
  border-radius: 16px 16px 0 0;
  background-color: #f3e4c0;
  background-image:
    linear-gradient(#0000 0, #0000 100%),
    repeating-linear-gradient(0deg, transparent 0 15px, #cbb89266 15px 16px),
    repeating-linear-gradient(90deg, transparent 0 15px, #cbb89255 15px 16px);
  background-size: auto, 16px 16px, 16px 16px;
  box-shadow:
    0 -14px 38px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.cal-sheet::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 14px;
  background:
    repeating-linear-gradient(
      180deg,
      #8a3b32 0 10px,
      #6b2e28 10px 12px,
      #f3e4c0 12px 28px
    );
  border-right: 1px solid #c4a574;
  opacity: 0.95;
  pointer-events: none;
}
.cal-sheet[hidden] { display: none; }
.cal-sheet .sheet-close {
  background: #fff8e6;
  color: #5a4a32;
  border: 1px solid #c4b48a;
  border-radius: 8px;
  font: 700 13px Georgia, serif;
}
.cal-kicker {
  margin: 0;
  font: 700 11px/1.2 Georgia, serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8a3b32;
}
.cal-title {
  margin: 6px 0 8px;
  font: 700 24px/1.15 Georgia, "Times New Roman", serif;
  color: #1f1810;
  text-shadow: 0 1px 0 #fff6;
}
.cal-hint, .cal-plaque {
  margin: 0 0 10px;
  font: italic 14px/1.4 Georgia, serif;
  color: #4a3c28;
}
.cal-plaque {
  padding: 10px 12px;
  border-left: 4px solid #8a3b32;
  background: #fff8e6ee;
  border-radius: 0 8px 8px 0;
  font-style: normal;
  box-shadow: 1px 2px 0 #0001;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  margin: 10px 0 14px;
  padding: 8px;
  border: 2px solid #b89a6a;
  border-radius: 4px;
  background:
    linear-gradient(#fffaf0ee, #f7edd8ee);
  box-shadow:
    inset 0 0 0 1px #fff8,
    2px 3px 0 #0001;
}
.cal-cell {
  position: relative;
  aspect-ratio: 1;
  min-height: 0;
  border: 1px solid #dcc9a0;
  border-radius: 2px;
  padding: 0;
  background: #fffcf4;
  box-shadow: inset 0 1px 0 #fff, 0 1px 0 #0001;
  color: #7a6a4a;
  font-size: 0;
  cursor: pointer;
  overflow: hidden;
  touch-action: manipulation;
}
.cal-cell .cal-n {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 9px/1 "Courier New", ui-monospace, monospace;
  color: #a09070;
  opacity: 0.55;
  pointer-events: none;
}
.cal-cell.future { background: #fffcf4; }
.cal-cell.miss {
  background: #e8dcc0;
  box-shadow: inset 0 0 6px #0001;
}
.cal-cell.mark {
  background: #fff1c0;
  border-color: #c4a040;
}
.cal-cell.today {
  z-index: 2;
  background: #fff;
  border-color: #8a3b32;
  box-shadow: inset 0 0 0 2px #8a3b32, 0 0 0 1px #fff;
  animation: todaypulse 1.25s ease-in-out infinite;
}
.cal-cell.today .cal-n { color: #8a3b32; opacity: 0.9; font-weight: 800; }
.cal-cell.done {
  background: #f0e2c0;
}
.cal-cell.done .cal-n { opacity: 0.2; }
.cal-cell.done::before,
.cal-cell.done::after {
  content: "";
  position: absolute;
  left: 10%;
  top: 46%;
  width: 80%;
  height: 2.5px;
  background: #a51b12;
  border-radius: 1px;
  transform-origin: center;
  z-index: 2;
  box-shadow: 0 0 0 0.5px #5a0c08;
}
.cal-cell.done::before { transform: rotate(42deg); }
.cal-cell.done::after { transform: rotate(-42deg); }
.cal-cell.xing.done::before { animation: strike 0.22s ease-out; }
.cal-cell.xing.done::after { animation: strike 0.22s ease-out 0.08s both; }
.cal-ico {
  position: absolute;
  inset: 6%;
  width: 88%;
  height: 88%;
  object-fit: contain;
  pointer-events: none;
  opacity: 0.95;
  z-index: 1;
}
@keyframes todaypulse {
  50% {
    transform: scale(1.1);
    box-shadow: inset 0 0 0 2px #c42b2b, 0 0 10px #c42b2b66;
  }
}
@keyframes strike {
  from { transform: rotate(42deg) scaleX(0); }
  to { transform: rotate(42deg) scaleX(1); }
}
.cal-cell.xing.done::after {
  animation-name: strike2;
}
@keyframes strike2 {
  from { transform: rotate(-42deg) scaleX(0); }
  to { transform: rotate(-42deg) scaleX(1); }
}
@media (max-width: 360px) {
  .cal-grid { grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 6px; }
  .cal-cell .cal-n { font-size: 8px; }
}
.cal-miss-btn,
.cal-buy button {
  width: 100%;
  padding: 10px;
  border: 1px solid #8a3b32;
  border-radius: 8px;
  background: #8a3b32;
  color: #f4e7c6;
  font: 700 15px Georgia, serif;
  cursor: pointer;
}
.cal-buy {
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed #8a3b32;
  background: #fff8e6;
}
.cal-buy p { margin: 0 0 8px; font: 14px/1.35 Georgia, serif; }
.cal-extra {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #8a3b32;
  border-radius: 8px;
  background: #8a3b32;
  color: #f4e7c6;
  font: 700 14px Georgia, serif;
  cursor: pointer;
}
.cal-extra[hidden] { display: none; }
.cal-extra:disabled {
  opacity: 0.6;
  cursor: default;
}

.stars-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 60;
  width: 100%;
  max-width: 430px;
  max-height: 84dvh;
  overflow: auto;
  transform: translateX(-50%);
  padding:
    14px max(14px, var(--safe-right))
    calc(16px + var(--safe-bottom))
    max(14px, var(--safe-left));
  color: var(--text);
  border-top: 3px solid var(--khaki);
  background:
    radial-gradient(circle at 50% 0%, #38432a 0%, transparent 52%),
    linear-gradient(180deg, #252c1e, #11150e);
  box-shadow: 0 -14px 36px rgba(0, 0, 0, 0.62);
}
.stars-sheet[hidden] { display: none; }
.stars-sheet .sheet-close {
  background: transparent;
  color: var(--khaki);
  border: 1px solid #46503a;
}
.stars-kicker {
  margin: 0;
  font: 700 11px/1.2 Georgia, serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #d7b24a;
}
.stars-title {
  margin: 4px 0 6px;
  font: 700 22px/1.2 Georgia, "Times New Roman", serif;
  color: #f4e7c6;
}
.stars-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font: 13px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.stars-hint b { color: #e0c06a; }
.stars-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}
.stars-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #46503a;
  border-radius: 12px;
  background: linear-gradient(135deg, #2b3324, #1a1f16);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.stars-item:active { transform: translateY(1px); }
.stars-item-ico { font-size: 20px; flex: 0 0 24px; text-align: center; }
.stars-item-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stars-item-copy b {
  font: 700 14px/1.2 Impact, "Arial Black", sans-serif;
  letter-spacing: 0.02em;
}
.stars-item-copy small {
  color: var(--muted);
  font: 11px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.stars-price {
  flex: 0 0 auto;
  font: 700 14px/1 "Courier New", monospace;
  color: #e0c06a;
  white-space: nowrap;
}
.stars-confirm {
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed var(--khaki);
  border-radius: 10px;
  background: #151a10;
}
.stars-confirm[hidden] { display: none; }
.stars-confirm p {
  margin: 0 0 8px;
  font: 14px/1.35 Georgia, serif;
  color: #f4e7c6;
}
.stars-confirm button {
  width: 100%;
  min-height: 40px;
  margin-top: 8px;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
#stars-confirm-yes {
  border: 0;
  background: #c2ca8d;
  color: #1b2016;
}
#stars-confirm-no {
  border: 1px solid #46503a;
  background: #2f3726;
  color: #c2ca8d;
}
.stars-tip {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid #333c2b;
  color: var(--muted);
  font: 12px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
