@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/assets/fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
  --background: #111416;
  --panel: #1a1e20;
  --surface: #202527;
  --edge: #303638;
  --edge-strong: #424a4c;
  --text: #f1f4f2;
  --muted: #a1ada9;
  --accent: #4bd789;
  --brand: #0f9a4c;
  --loss: #f09a91;
  --stage-height: 604px;
  background: var(--background);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 280px; margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }

.site-header { border-bottom: 1px solid var(--edge); background: #171b1d; }
.header-inner {
  width: min(100% - 72px, 1480px);
  min-height: 72px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}
.brand { display: inline-flex; width: max-content; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: -.04em; }
.brand img { border-radius: 9px; object-fit: contain; }
.nav { display: flex; align-self: stretch; gap: 27px; }
.nav a, .nav button {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0 3px;
  border: 0;
  background: none;
  color: var(--muted);
  font-weight: 650;
}
.nav a:hover, .nav button:hover { color: var(--text); }
.nav a[aria-current] { color: var(--text); }
.nav a[aria-current]::after { content: ''; position: absolute; inset: auto 1px -1px; height: 2px; background: var(--accent); }
.header-actions { display: flex; min-width: 0; justify-content: end; align-items: center; gap: 20px; }
.online { display: flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--muted); font-size: 12px; }
.online i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.online strong { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--edge-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
  text-align: center;
}
.button:not(:disabled):hover { background: #2a3133; border-color: #596564; }
.button:disabled { color: var(--muted); }
.button.primary { border-color: var(--brand); background: var(--brand); color: #0b1b12; }
.button.primary:not(:disabled):hover { border-color: #14ad58; background: #14ad58; }
.button.primary:disabled { border-color: #355846; background: #253d32; color: #b0c2b8; }
.account-button { min-width: 88px; max-width: min(170px, 40vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

.workspace { width: min(100% - 72px, 1480px); margin: 0 auto; padding-block: 32px 24px; }
.workspace h1 { margin-bottom: 21px; font-size: clamp(26px, 3vw, 36px); line-height: 1.14; font-weight: 760; letter-spacing: -.045em; }
.upgrade-grid {
  display: grid;
  grid-template-columns: minmax(224px, .9fr) minmax(350px, 1.45fr) minmax(252px, 1fr);
  grid-template-areas: 'inventory wheel catalogue';
  gap: 14px;
  align-items: stretch;
}
.panel { background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; }
.panel-head { min-height: 60px; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--edge); }
.panel-head h2 { font-size: 16px; font-weight: 700; letter-spacing: -.018em; }
.panel-count { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.inventory-panel, .catalogue-panel, .wheel-panel { min-width: 0; height: var(--stage-height); scroll-margin-top: 14px; }
.inventory-panel { display: flex; flex-direction: column; grid-area: inventory; }
.inventory-list { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow: auto; padding: 10px 9px; }
.inventory-actions { margin-top: auto; display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--edge); }
.deposit-button { flex: 1; }
.deposit-button span { color: var(--accent); font-size: 20px; line-height: .8; font-weight: 500; }
.inventory-empty { margin: auto; display: grid; justify-items: center; gap: 11px; padding: 24px 13px; text-align: center; }
.inventory-empty strong { font-size: 15px; font-weight: 680; }
.inventory-empty p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.inventory-empty .text-button { margin-top: 4px; }
.wallet-icon { position: relative; display: block; width: 54px; height: 54px; margin-bottom: 5px; border: 1px solid #394744; border-radius: 13px; background: #222a28; }
.wallet-icon::before { content: ''; position: absolute; inset: 16px 11px 14px; border: 1.5px solid #91a9a0; border-radius: 5px; }
.wallet-icon::after { content: ''; position: absolute; top: 25px; right: 10px; width: 13px; height: 8px; border: 1.5px solid #91a9a0; border-radius: 4px 0 0 4px; background: #222a28; }

.wheel-panel {
  grid-area: wheel;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center;
  gap: 5px;
  padding: 15px 14px 11px;
  border: 1px solid #293033;
  border-radius: 12px;
  background: #171b1d;
}
.matchup { width: min(100%, 420px); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 9px; }
.matchup-arrow { color: var(--muted); }
.choice { min-width: 0; min-height: 54px; display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid #363e40; border-radius: 8px; background: #1c2223; }
.choice:hover { border-color: #62736d; }
.choice.empty { border-style: dashed; background: transparent; }
.choice-content { display: grid; min-width: 0; gap: 3px; }
.choice small { color: var(--muted); font-size: 10px; }
.choice strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 680; }
.choice .coin-logo { width: 27px; height: 27px; flex-basis: 27px; }
.wheel { width: min(100%, 435px); align-self: center; aspect-ratio: 1; display: grid; place-items: center; position: relative; }
.wheel canvas { display: block; width: 100%; height: 100%; }
.wheel-label { position: absolute; inset: 30%; display: flex; justify-content: center; align-items: center; flex-direction: column; gap: 6px; pointer-events: none; text-align: center; }
.wheel-label strong { color: var(--accent); font-size: clamp(34px, 4.2vw, 54px); letter-spacing: -.065em; line-height: 1; font-weight: 760; font-variant-numeric: tabular-nums; }
.wheel-label strong.precise { font-size: clamp(15px, 2.1vw, 23px); letter-spacing: -.055em; }
.wheel-label strong.empty-chance { color: #73827c; font-size: 42px; }
.wheel-label span { color: var(--muted); font-size: 12px; }
.wheel[data-result="loss"] strong { color: var(--loss); }
.wheel-actions { width: min(100%, 354px); }
.upgrade-button { position: relative; width: 100%; min-height: 50px; font-size: 15px; font-weight: 720; }
.upgrade-arrow { position: absolute; right: 16px; font-size: 18px; font-weight: 500; }
.wheel-status { min-height: 44px; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; align-items: center; column-gap: 8px; }
.upgrade-status { color: var(--muted); font-size: 11.5px; line-height: 1.4; text-align: center; }
.upgrade-status[data-error="true"], .dialog-message[data-error="true"] { color: var(--loss); }
.text-button { border: 0; padding: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 650; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }

.catalogue-panel { display: flex; flex-direction: column; grid-area: catalogue; }
.catalogue-tools { display: grid; gap: 10px; padding: 12px 12px 9px; }
.search-control { position: relative; display: block; }
.search-control input { width: 100%; height: 40px; padding: 8px 9px 8px 36px; border: 1px solid var(--edge-strong); border-radius: 8px; background: #15191b; color: var(--text); }
.search-control input::placeholder { color: #a1ada9; opacity: 1; }
.search-control input:focus { border-color: var(--accent); outline: 1px solid var(--accent); outline-offset: 0; }
.search-mark { position: absolute; top: 12px; left: 13px; width: 13px; height: 13px; border: 1.5px solid #a6b3af; border-radius: 50%; pointer-events: none; }
.search-mark::after { content: ''; position: absolute; width: 5px; height: 1.5px; bottom: -2px; right: -4px; background: #a6b3af; transform: rotate(45deg); }
.catalogue-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-button { min-height: 30px; padding: 4px 9px; border: 1px solid #394143; border-radius: 6px; background: #202527; color: var(--muted); font-size: 11px; font-weight: 600; }
.filter-button:hover { color: var(--text); }
.filter-button[aria-pressed="true"] { border-color: #41795a; background: #223b2e; color: #b4ebca; }
.catalogue-scroll { min-height: 0; flex: 1; overflow: auto; padding: 0 9px 10px; scrollbar-color: #454f50 transparent; scrollbar-width: thin; }
.catalogue-list { display: grid; gap: 4px; }
.coin-row {
  width: 100%;
  min-width: 0;
  min-height: 51px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}
.coin-row:not(:disabled):hover { border-color: var(--edge-strong); background: #252b2d; }
.coin-row[aria-pressed="true"] { border-color: #478060; background: #21362c; }
.coin-row:focus-visible { outline-offset: -2px; }
.coin-meta { display: grid; flex: 1; min-width: 0; gap: 3px; }
.coin-meta strong, .coin-meta small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin-meta strong { font-size: 13px; font-weight: 720; }
.coin-meta small { color: var(--muted); font-size: 11px; }
.coin-select { flex: 0 0 12px; width: 12px; height: 12px; border: 1px solid #697675; border-radius: 50%; }
.coin-row[aria-pressed="true"] .coin-select { border: 3px solid var(--accent); }
.coin-logo {
  position: relative;
  flex: 0 0 33px;
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #343d40;
  color: #d8e1de;
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}
.coin-logo img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; object-fit: contain; }
.coin-logo.ready img { opacity: 1; }
.coin-logo.ready > span { visibility: hidden; }
.coin-logo.light.ready { background: #dce1e2; }
.more-button { min-height: 33px; width: 100%; margin-top: 7px; font-size: 12px; }
.empty-text { padding: 17px 10px; color: var(--muted); font-size: 13px; text-align: center; }

.activity-panel { margin-top: 14px; }
.activity-panel .panel-head { min-height: 50px; }
.feed-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 11px 13px; }
.feed-list p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.feed-card { flex: 1 1 160px; max-width: 250px; display: flex; min-width: 0; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--edge); border-radius: 8px; background: #191d1f; }
.feed-card.win { border-color: #385d4a; }
.feed-text { flex: 1; display: grid; gap: 4px; min-width: 0; }
.feed-text strong, .feed-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-text strong { font-size: 12px; }
.feed-text small { color: var(--muted); font-size: 11px; }
.footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 19px; color: var(--muted); font-size: 11px; }
.footer a:hover { color: var(--text); text-decoration: underline; }

.dialog { width: min(calc(100% - 24px), 510px); max-height: calc(100dvh - 24px); overflow: auto; padding: 0; border: 1px solid var(--edge-strong); border-radius: 14px; background: var(--panel); color: var(--text); }
.dialog::backdrop { background: rgb(0 0 0 / .74); }
.dialog-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--edge); }
.dialog-head h2 { font-size: 18px; letter-spacing: -.03em; }
.dialog-body { display: grid; gap: 13px; padding: 16px; }
.dialog-body p { color: var(--muted); line-height: 1.5; }
.dialog-body h3 { margin-top: 7px; font-size: 14px; }
.dialog-body .dialog-message:empty { display: none; }
.icon-button { width: 34px; min-height: 34px; padding: 0; color: var(--muted); font-size: 23px; line-height: 1; font-weight: 400; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dialog-field { display: grid; gap: 7px; color: var(--muted); }
.dialog-field input, .dialog-field select { min-height: 42px; padding: 9px; border: 1px solid var(--edge-strong); border-radius: 8px; background: #15191b; color: var(--text); }
.details { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 8px 12px; margin: 0; font-size: 13px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; text-align: right; }
.history-row { display: flex; justify-content: space-between; gap: 10px; padding: 11px; border: 1px solid var(--edge); border-radius: 8px; background: var(--surface); text-align: left; }
.history-row span { color: var(--muted); text-align: right; overflow-wrap: anywhere; }
.history-row .good { color: var(--accent); }
.history-row .bad { color: var(--loss); }

.dialog[data-kind="login"] { width: min(calc(100% - 24px), 408px); }
.dialog[data-kind="login"] .dialog-head { justify-content: center; padding: 88px 20px 0; border-bottom: 0; }
.dialog[data-kind="login"] .dialog-head h2 { font-size: 23px; }
.dialog[data-kind="login"] .dialog-head form { position: absolute; top: 12px; right: 12px; }
.dialog[data-kind="login"] .dialog-body { gap: 14px; padding: 12px 25px 25px; text-align: center; }
.login-logo { position: absolute; top: 23px; left: 50%; width: 50px; height: 50px; transform: translateX(-50%); border-radius: 11px; }
.google-button {
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid #d9e1de;
  border-radius: 7px;
  background: #f3f6f5;
  color: #232929;
  font-weight: 650;
}
.google-button img { width: 18px; height: 18px; object-fit: contain; }
.google-button[href]:hover { background: #dbe5e0; }
.google-button:disabled { opacity: .7; }
.login-status { font-size: 12px; }

@media (max-width: 1100px) {
  :root { --stage-height: 560px; }
  .header-inner, .workspace { width: calc(100% - 40px); }
  .upgrade-grid { grid-template-columns: minmax(190px, .86fr) minmax(310px, 1.4fr) minmax(224px, 1fr); gap: 10px; }
  .wheel-panel { padding-inline: 11px; }
}

@media (max-width: 800px) {
  .header-inner, .workspace { width: calc(100% - 32px); }
  .header-inner { gap: 16px; }
  .header-actions { gap: 10px; }
  .online span { display: none; }
  .upgrade-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: 'wheel wheel' 'inventory catalogue'; }
  .wheel-panel { height: auto; min-height: 0; gap: 5px; }
  .wheel { width: min(100%, 385px); }
}

@media (max-width: 540px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding-top: 10px; }
  .header-actions { grid-column: 2; grid-row: 1; }
  .nav { grid-row: 2; grid-column: 1 / -1; min-height: 44px; gap: 21px; }
  .workspace { padding-top: 21px; }
  .workspace h1 { margin-bottom: 14px; }
  .upgrade-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'inventory' 'wheel' 'catalogue'; }
  .inventory-panel { height: auto; min-height: 208px; }
  .inventory-list { max-height: 250px; }
  .inventory-empty { gap: 6px; padding: 10px 5px; }
  .wallet-icon { display: none; }
  .panel-head { min-height: 48px; padding: 10px 12px; }
  .wheel { width: min(100%, 354px); }
  .wheel-panel { padding-top: 11px; }
  .wheel-label span { font-size: 10px; }
  .catalogue-panel { height: 465px; }
  .activity-panel { margin-top: 10px; }
  .footer { line-height: 1.45; }
}
