/* 4dcub — тёмный фон, оранжевый акцент. */

:root {
  --bg: #050403;
  --bg-soft: #120c08;
  --fg: #f6eee6;
  --dim: #b59a86;
  --dim-2: #7a6456;
  --acc: #ff7a2f;
  --acc-2: #ffb347;
  --mine: #3ddc84;
  --danger: #ff6b6b;
  --warn: #ffc464;
  --panel: rgba(18, 10, 6, .82);
  --panel-solid: #120c08;
  --border: rgba(255, 140, 60, .18);
  --border-strong: rgba(255, 140, 60, .38);
  --shadow: 0 24px 70px rgba(0, 0, 0, .7);
  --r: 14px;
  --r-sm: 10px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* Атрибут hidden должен побеждать любые display из тем ниже. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  height: 100svh;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Документы и админка — обычная прокрутка, не 3D-оболочка. */
html:has(body.doc),
html:has(body.admin),
body.doc,
body.admin {
  height: auto;
  min-height: 100%;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: auto;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button, .btn, .icon-btn, .lang-btn, .result, .my-item {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

:focus-visible {
  outline: 2px solid rgba(255, 122, 47, .7);
  outline-offset: 2px;
}
#searchInput:focus-visible,
input[type=range]:focus-visible {
  outline: none;
}

#scene {
  display: block;
  position: fixed;
  inset: 0;
  touch-action: none;
  cursor: grab;
}
#scene:active { cursor: grabbing; }

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(120% 85% at 50% 45%, transparent 45%, rgba(0, 0, 0, .55) 100%);
}

/* ─────────── загрузка ─────────── */
.boot {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: radial-gradient(circle at 50% 42%, #1a0e08 0%, #050403 72%);
  transition: opacity .5s ease, visibility .5s;
}
.boot.done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-logo {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 6px;
  text-shadow: 0 0 40px rgba(255, 122, 47, .55);
}
.boot-logo span { color: var(--acc); }
.boot-bar {
  width: min(280px, 60vw);
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}
.boot-bar > i {
  display: block;
  height: 100%;
  width: 8%;
  background: linear-gradient(90deg, var(--acc), var(--acc-2));
  transition: width .3s ease;
}
.boot-text { font-size: 12px; color: var(--dim); letter-spacing: .4px; }

/* ─────────── топбар ─────────── */
.topbar {
  position: fixed;
  z-index: 20;
  top: max(10px, var(--safe-t));
  left: max(14px, var(--safe-l));
  right: max(14px, var(--safe-r));
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand search actions";
  align-items: center;
  gap: 10px 12px;
  pointer-events: none;
}
.brand { grid-area: brand; pointer-events: auto; }
.search { grid-area: search; justify-self: start; pointer-events: auto; }
.topbar-right {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 8px 4px;
  text-shadow: 0 0 26px rgba(255, 122, 47, .5);
}
.brand span { color: var(--acc); }

/* поиск */
.search { position: relative; min-width: 0; }
.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--dim);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}
#searchInput {
  width: 240px;
  padding: 10px 12px 10px 34px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(14px);
  outline: none;
  transition: border-color .18s, width .18s, box-shadow .18s;
}
#searchInput::placeholder { color: var(--dim-2); }
#searchInput:focus {
  border-color: rgba(255, 122, 47, .55);
  box-shadow: 0 0 0 3px rgba(255, 122, 47, .12);
  width: 290px;
}
.search-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  max-height: 46vh;
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  padding: 6px;
}
.result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .14s;
}
.result:hover { background: rgba(255, 122, 47, .1); }
.result img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 8px;
  background: #1a100c;
}
.result-body { min-width: 0; flex: 1; }
.result-code { font-variant-numeric: tabular-nums; font-weight: 600; }
.result-sub { font-size: 11px; color: var(--dim); }
.result-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim-2);
  flex: none;
}
.result-dot.on { background: var(--acc); box-shadow: 0 0 10px var(--acc); }
.result-dot.mine { background: var(--mine); box-shadow: 0 0 10px var(--mine); }

/* кнопки */
.btn {
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(14px);
  padding: 9px 15px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .3px;
  transition: transform .15s, background .18s, border-color .18s, box-shadow .18s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, #ff8a3a, #e05510);
  border-color: transparent;
  color: #fff;
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(255, 122, 47, .34); }
.btn-buy {
  background: linear-gradient(135deg, #ffc56b, #ff8a2a);
  border-color: transparent;
  color: #2a1608;
}
.btn-buy:hover { box-shadow: 0 10px 30px rgba(255, 180, 80, .3); }
.btn-ghost:hover { background: rgba(255, 122, 47, .12); }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.w-full { width: 100%; display: block; text-align: center; }

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(14px);
  font-size: 11.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.chip b { color: var(--acc); font-weight: 600; }

.lang-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--panel);
  backdrop-filter: blur(14px);
}
.lang-btn {
  border: 0;
  background: transparent;
  padding: 9px 11px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--dim);
  transition: background .16s, color .16s;
}
.lang-btn.is-active { background: rgba(255, 122, 47, .18); color: var(--fg); }

.icon-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .04);
  color: var(--fg);
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: background .16s, border-color .16s;
  flex: none;
}
.icon-btn:hover { background: rgba(255, 122, 47, .16); border-color: rgba(255, 122, 47, .45); }
.icon-btn.play { font-size: 13px; }

/* ─────────── панель куба ─────────── */
.cube-panel {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(22px + var(--safe-b));
  transform: translateX(-50%);
  width: min(720px, calc(100% - 28px - var(--safe-l) - var(--safe-r)));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  animation: rise-panel .28s ease;
  overscroll-behavior: contain;
}
@keyframes rise-panel {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.cube-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.cube-id {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--acc);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cube-title {
  flex: 1;
  min-width: 0;
  color: var(--fg);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge {
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 99px;
  letter-spacing: .3px;
  font-weight: 600;
}
.badge-mine { background: rgba(61, 220, 132, .16); color: var(--mine); }
.cube-head .icon-btn { flex: none; }
#closeCube { margin-left: auto; }
.cube-grabber {
  display: none;
  width: calc(100% + 24px);
  margin: -4px -12px 4px;
  height: 28px;
  border: 0;
  padding: 0;
  background: transparent;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.cube-grabber span {
  width: 42px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .38);
  pointer-events: none;
}
.cube-grabber:active,
.cube-panel.is-dragging .cube-grabber { cursor: grabbing; }
.cube-panel.is-dragging .cube-grabber span,
.cube-grabber:active span { background: rgba(255, 255, 255, .62); }
.cube-panel.is-collapsed {
  width: auto;
  min-width: 0;
  padding: 8px 10px;
}
.cube-panel.is-collapsed .cube-body,
.cube-panel.is-collapsed .cube-title { display: none; }
.cube-panel.is-collapsed .cube-head { margin-bottom: 0; }
.cube-panel.is-collapsed #closeCube { margin-left: 0; }

.cube-controls { display: flex; align-items: center; gap: 12px; }
.cube-controls.spread { margin-top: 10px; }
.cube-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--dim);
  letter-spacing: .2px;
}
.slider-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.slider-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--acc), var(--acc-2));
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #0b1220;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .4), 0 0 12px rgba(110, 190, 255, .45);
}
input[type=range]::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #0b1220;
  cursor: pointer;
}

.cube-meta {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--dim);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.cube-meta a { color: var(--acc); }

.cube-edit {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cube-edit input[type=text],
.cube-edit input:not([type=color]),
.cube-edit textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  outline: none;
  resize: vertical;
}
.cube-edit input:focus, .cube-edit textarea:focus { border-color: rgba(255, 122, 47, .5); }
.cube-edit-row { display: flex; gap: 8px; align-items: center; }
.cube-edit input[type=color] {
  width: 40px;
  height: 34px;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
}

/* ─────────── ящик «Мои кубы» ─────────── */
.drawer {
  position: fixed;
  z-index: 25;
  top: calc(72px + var(--safe-t));
  right: 14px;
  width: min(330px, calc(100vw - 28px));
  max-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  animation: slide .25s ease;
}
@keyframes slide { from { opacity: 0; transform: translateX(16px); } }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
}
.drawer-head h3 { margin: 0; font-size: 14px; letter-spacing: .4px; }
.drawer-body { overflow: auto; padding: 0 10px; flex: 1; }
.drawer-foot { padding: 12px 14px calc(14px + var(--safe-b)); }

.my-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s;
}
.my-item:hover { background: rgba(255, 122, 47, .1); }
.my-item img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  background: #1a100c;
  flex: none;
}
.my-item .ph {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .04);
  color: var(--dim-2);
  font-size: 17px;
  flex: none;
}
.my-body { min-width: 0; flex: 1; }
.my-code { font-weight: 600; font-variant-numeric: tabular-nums; }
.my-status { font-size: 11px; color: var(--dim); }
.my-status.published { color: var(--mine); }
.my-status.pending, .my-status.processing { color: var(--warn); }
.my-status.rejected { color: var(--danger); }
.empty { padding: 26px 14px; text-align: center; color: var(--dim); font-size: 12.5px; }

/* ─────────── подсказки и футер ─────────── */
.hints {
  position: fixed;
  z-index: 5;
  right: max(16px, var(--safe-r));
  bottom: calc(16px + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
  font-size: 11px;
  color: var(--dim-2);
  pointer-events: none;
  transition: opacity .3s;
}
.hints.hide { opacity: 0; }
.hints kbd {
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 10px;
  color: #bcd;
  font-family: inherit;
}
.hints i { font-style: normal; }

.footer {
  position: fixed;
  z-index: 5;
  left: max(16px, var(--safe-l));
  bottom: calc(14px + var(--safe-b));
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--dim-2);
}
.footer a:hover { color: var(--acc); }
body.cube-open .footer { display: none; }

/* ─────────── модалки ─────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 4, 2, .78);
  backdrop-filter: blur(8px);
  animation: fade .2s ease;
  overscroll-behavior: contain;
}
@keyframes fade { from { opacity: 0; } }
.modal-card {
  position: relative;
  width: min(440px, 100%);
  max-height: 90vh;
  max-height: 90svh;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px 24px 22px;
  box-shadow: var(--shadow);
}
.modal-card h2 { margin: 0 0 12px; font-size: 19px; }
.modal-close { position: absolute; right: 14px; top: 14px; width: 32px; height: 32px; }
.lead { color: var(--dim); font-size: 13px; line-height: 1.65; margin: 0 0 16px; }
.steps { margin: 0 0 18px; padding-left: 20px; color: var(--dim); font-size: 13px; line-height: 1.8; }
.steps li::marker { color: var(--acc); font-weight: 700; }
.fine { font-size: 11px; color: var(--dim-2); line-height: 1.6; margin: 14px 0 0; }
.fine a { color: var(--acc); }

.code-input { display: flex; gap: 8px; margin-top: 14px; align-items: stretch; }
#codeInput {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  outline: none;
  text-transform: uppercase;
  letter-spacing: 5px;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  box-sizing: border-box;
}
#codeInput:focus { border-color: rgba(255, 122, 47, .55); }
#codeSubmit { flex: 0 0 auto; }
.modal-error {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: rgba(255, 107, 107, .12);
  color: var(--danger);
  font-size: 12px;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 12px; color: var(--dim); }
.field input {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  outline: none;
}

/* ─────────── тосты ─────────── */
.toasts {
  position: fixed;
  z-index: 80;
  left: 50%;
  top: calc(78px + var(--safe-t));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  font-size: 12.5px;
  box-shadow: var(--shadow);
  animation: rise .25s ease;
  max-width: min(440px, 90vw);
}
.toast.error { border-color: rgba(255, 107, 107, .45); color: #ffc9c9; }
.toast.ok { border-color: rgba(61, 220, 132, .45); color: #bff5d6; }

/* ─────────── мобильная раскладка ─────────── */
@media (max-width: 860px) {
  html, body { height: 100svh; }
  html:has(body.doc),
  html:has(body.admin),
  body.doc,
  body.admin {
    height: auto;
    min-height: 100svh;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .topbar {
    grid-template-columns: auto max-content;
    grid-template-areas:
      "brand actions"
      "search search";
    align-items: center;
    left: max(10px, var(--safe-l));
    right: max(10px, var(--safe-r));
    top: max(8px, var(--safe-t));
    gap: 8px 10px;
  }
  .brand {
    justify-self: start;
    align-self: center;
    padding: 0 2px;
    line-height: 36px;
  }
  .search {
    justify-self: stretch;
    min-width: 0;
    margin: 0;
  }
  #searchInput,
  #searchInput:focus {
    width: 100%;
    font-size: 16px;
  }
  .search-results { width: 100%; }
  .topbar-right {
    justify-self: end;
    align-self: center;
    width: auto;
    max-width: none;
    justify-content: flex-end;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
  }
  .topbar-right .btn,
  .topbar-right .lang-switch {
    height: 36px;
    flex: 0 0 auto;
  }
  .topbar-right .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    line-height: 1;
    transform: none;
  }
  .lang-btn {
    height: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .chip { display: none; }
  #layerHud { display: none; }
  .hints { display: none; }
  .toasts { top: calc(108px + var(--safe-t)); }
  .footer {
    left: max(10px, var(--safe-l));
    right: max(10px, var(--safe-r));
    font-size: 10px;
    gap: 8px;
    flex-wrap: wrap;
    max-width: none;
    justify-content: center;
  }
  .drawer {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 70svh;
    border-radius: 20px 20px 0 0;
  }
  .cube-panel {
    width: calc(100% - 16px - var(--safe-l) - var(--safe-r));
    left: 50%;
    transform: translateX(-50%);
    bottom: max(10px, var(--safe-b));
    padding: 4px 14px 12px;
    border-radius: 18px 18px 16px 16px;
    max-height: 46svh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .cube-grabber { display: flex; }
  #toggleCubePanel { display: none; }
  .cube-panel.is-collapsed {
    width: calc(100% - 16px - var(--safe-l) - var(--safe-r));
    max-height: none;
    overflow: visible;
    padding: 2px 14px 10px;
  }
  .cube-panel.is-collapsed .cube-head {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
  }
  .cube-panel.is-collapsed .cube-head > :not(.cube-id):not(#closeCube) {
    display: none !important;
  }
  .cube-panel.is-collapsed .cube-id {
    justify-content: center;
    margin: 0;
  }
  .cube-panel.is-collapsed #closeCube {
    margin-left: 0;
  }
  .cube-panel.is-dragging {
    overflow: hidden;
    transition: none;
  }
  #closeCube {
    width: 40px;
    height: 40px;
  }
  .cube-hint { display: none; }
  .cube-controls { gap: 8px; }
  .cube-edit-row { flex-wrap: wrap; }
  .modal {
    padding: 10px;
    padding-bottom: calc(12px + var(--safe-b));
    align-items: center;
    justify-items: center;
  }
  .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: min(88svh, calc(100svh - 24px));
    border-radius: 18px;
    padding: 20px 16px 16px;
    overflow-x: hidden;
  }
  .code-input {
    flex-direction: column;
    gap: 10px;
  }
  #codeInput {
    letter-spacing: 4px;
  }
  #codeSubmit {
    width: 100%;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .brand { font-size: 15px; letter-spacing: 1px; }
  .topbar-right { gap: 5px; }
  .lang-switch { flex: none; }
  .btn-buy, #loginBtn, #accountBtn { padding: 0 10px; font-size: 12px; }
}

@media (hover: none) {
  .btn:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
