﻿    :root {
      --piece-size: clamp(32px, 5.6vmin, 56px);
      --sandbox-piece-size: clamp(29px, 4.8vmin, 47px);
      color-scheme: dark;
      font-family: Arial, sans-serif;
      background: #171613;
      color: #f5efe6;
    }

    * {
      box-sizing: border-box;
      overflow-anchor: none;
    }

    .lobby-screen {
      position: fixed;
      inset: 0;
      z-index: 200;
      min-height: 100vh;
      padding: clamp(18px, 2vw, 34px);
      background:
        radial-gradient(circle at 50% 27%, rgba(163, 80, 255, 0.24), transparent 14%),
        radial-gradient(circle at 28% 34%, rgba(0, 119, 255, 0.18), transparent 26%),
        radial-gradient(circle at 72% 36%, rgba(94, 212, 112, 0.16), transparent 28%),
        linear-gradient(180deg, #03080d 0%, #071116 48%, #030606 100%);
      overflow: auto;
      transition: opacity 220ms ease, visibility 220ms ease;
    }

    .lobby-screen.is-hidden {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }

    .lobby-screen::before {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
      background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
        radial-gradient(ellipse at 50% 35%, transparent 0 36%, rgba(0, 0, 0, 0.48) 100%);
      background-size: 68px 68px, 68px 68px, auto;
      opacity: 0.42;
    }

    .lobby-bg-glow {
      position: fixed;
      left: 50%;
      top: 18%;
      width: min(1050px, 86vw);
      height: 330px;
      transform: translateX(-50%);
      background:
        radial-gradient(circle at 50% 50%, rgba(185, 79, 255, 0.6), transparent 13%),
        radial-gradient(circle at 28% 52%, rgba(0, 120, 255, 0.3), transparent 27%),
        radial-gradient(circle at 72% 52%, rgba(116, 230, 117, 0.22), transparent 29%);
      filter: blur(28px);
      opacity: 0.68;
    }

    .lobby-shell {
      position: relative;
      width: min(1620px, 100%);
      min-height: calc(100vh - clamp(36px, 4vw, 68px));
      margin: 0 auto;
      display: grid;
      grid-template-rows: auto minmax(0, 1fr) auto;
      gap: clamp(22px, 2.4vw, 40px);
    }

    .lobby-header {
      display: grid;
      grid-template-columns: minmax(260px, 390px) minmax(340px, 1fr) minmax(260px, 320px);
      gap: clamp(18px, 2vw, 28px);
      align-items: start;
    }

    .lobby-welcome,
    .lobby-nav-button,
    .lobby-panel {
      border: 1px solid rgba(255, 255, 255, 0.18);
      background: linear-gradient(180deg, rgba(16, 22, 27, 0.78), rgba(6, 10, 13, 0.9));
      box-shadow: 0 18px 48px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.08);
      backdrop-filter: blur(14px);
    }

    .lobby-welcome {
      min-width: 0;
      border-radius: 10px;
      padding: 16px 18px;
      display: grid;
      grid-template-columns: 68px minmax(0, 1fr);
      gap: 18px;
      align-items: center;
    }

    .lobby-welcome-icon {
      width: 64px;
      height: 64px;
      border: 1px solid rgba(242, 201, 109, 0.5);
      border-radius: 50%;
      display: grid;
      place-items: center;
      color: #f5c765;
      font-size: 38px;
      text-shadow: 0 0 18px rgba(242, 201, 109, 0.38);
    }

    .lobby-welcome strong {
      display: block;
      color: #f4d086;
      font-size: clamp(18px, 1.45vw, 22px);
      line-height: 1.2;
      overflow-wrap: anywhere;
    }

    .lobby-welcome small {
      display: block;
      margin-top: 7px;
      color: #c8c0b8;
      font-size: 13px;
      overflow-wrap: anywhere;
    }

    .lobby-brand {
      min-width: 0;
      text-align: center;
      padding-top: 2px;
    }

    .lobby-crown {
      color: #f5c765;
      display: block;
      font-size: 30px;
      line-height: 1;
      text-shadow: 0 0 16px rgba(242, 201, 109, 0.42);
    }

    .lobby-title {
      max-width: 100%;
      margin: 12px 0 0;
      color: #f1f0ec;
      font-size: clamp(34px, 4.15vw, 62px);
      font-weight: 900;
      line-height: 0.95;
      letter-spacing: clamp(0.16em, 2vw, 0.34em);
      text-transform: uppercase;
      overflow-wrap: anywhere;
      word-break: break-word;
    }

    .lobby-title::first-letter,
    .lobby-title {
      text-shadow: 0 0 22px rgba(242, 201, 109, 0.18);
    }

    .lobby-subtitle {
      margin: 14px 0 0;
      color: #c9c4bc;
      font-size: clamp(12px, 1.25vw, 16px);
      letter-spacing: 0.24em;
      line-height: 1.35;
      text-transform: uppercase;
      overflow-wrap: anywhere;
    }

    .lobby-nav {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 14px;
      justify-self: end;
      width: min(320px, 100%);
    }

    .lobby-nav-button {
      min-width: 0;
      aspect-ratio: 1;
      border-radius: 10px;
      color: #d5d8d9;
      cursor: pointer;
      display: grid;
      place-items: center;
      padding: 10px;
      transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
    }

    .lobby-nav-button span {
      font-size: clamp(24px, 2.2vw, 34px);
      line-height: 1;
    }

    .lobby-nav-button:hover,
    .lobby-nav-button:focus-visible,
    .lobby-big-cta:hover,
    .lobby-big-cta:focus-visible,
    .lobby-guide-button:hover,
    .lobby-guide-button:focus-visible,
    .lobby-apply:hover,
    .lobby-apply:focus-visible {
      transform: translateY(-2px);
      border-color: rgba(145, 244, 255, 0.6);
      outline: none;
      box-shadow: 0 18px 46px rgba(0, 0, 0, 0.48), 0 0 22px rgba(0, 208, 255, 0.18);
    }

    .lobby-content {
      display: grid;
      grid-template-columns: minmax(300px, 480px) minmax(380px, 1fr) minmax(320px, 460px);
      gap: clamp(20px, 2vw, 28px);
      align-items: stretch;
    }

    .lobby-panel {
      min-width: 0;
      border-radius: 14px;
      padding: clamp(24px, 2.3vw, 30px);
      overflow: hidden;
    }

    .lobby-panel-blue {
      border-color: rgba(43, 165, 255, 0.62);
      background: linear-gradient(180deg, rgba(7, 32, 52, 0.82), rgba(3, 12, 20, 0.94));
      box-shadow: 0 20px 54px rgba(0, 0, 0, 0.48), 0 0 26px rgba(43, 165, 255, 0.14);
    }

    .lobby-panel-purple {
      border-color: rgba(161, 79, 255, 0.66);
      background: linear-gradient(180deg, rgba(24, 18, 54, 0.82), rgba(8, 7, 20, 0.94));
      box-shadow: 0 20px 54px rgba(0, 0, 0, 0.48), 0 0 26px rgba(161, 79, 255, 0.16);
    }

    .lobby-panel-green {
      border-color: rgba(126, 218, 111, 0.62);
      background: linear-gradient(180deg, rgba(10, 41, 22, 0.82), rgba(4, 17, 9, 0.94));
      box-shadow: 0 20px 54px rgba(0, 0, 0, 0.48), 0 0 26px rgba(126, 218, 111, 0.14);
    }

    .lobby-panel-heading {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      gap: 18px;
      align-items: center;
      margin-bottom: 28px;
    }

    .lobby-panel-icon {
      width: 64px;
      height: 64px;
      border: 1px solid currentColor;
      border-radius: 50%;
      color: #49bfff;
      display: grid;
      place-items: center;
      font-size: 32px;
      filter: drop-shadow(0 0 12px currentColor);
    }

    .lobby-panel-purple .lobby-panel-icon { color: #a762ff; }
    .lobby-panel-green .lobby-panel-icon { color: #88df75; }

    .lobby-panel h2,
    .lobby-panel h3 {
      margin: 0;
      color: #e7edf0;
      font-size: clamp(22px, 2vw, 30px);
      font-weight: 500;
      overflow-wrap: anywhere;
    }

    .lobby-panel h3 {
      color: #b56dff;
      font-size: 19px;
      margin-top: 26px;
    }

    .lobby-panel p {
      margin: 6px 0 0;
      color: #c7c3c0;
      font-size: 15px;
      line-height: 1.42;
      overflow-wrap: anywhere;
    }

    .lobby-input-list {
      display: grid;
      gap: 16px;
      margin-bottom: 24px;
    }

    .lobby-input-list div,
    .lobby-settings-list label {
      min-width: 0;
      min-height: 52px;
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 6px;
      background: rgba(5, 12, 18, 0.58);
      color: #bfc4c7;
      display: flex;
      align-items: center;
      gap: 18px;
      padding: 0 18px;
      overflow-wrap: anywhere;
    }

    .lobby-input-list span {
      color: #c7ccd0;
      font-size: 20px;
    }

    .lobby-section-label {
      margin: 0 0 12px;
      color: #f1f0ec;
      font-size: 15px;
    }

    .lobby-factions {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
      margin-bottom: 28px;
    }

    .lobby-factions span {
      min-width: 0;
      min-height: 136px;
      border: 1px solid currentColor;
      border-radius: 7px;
      display: grid;
      place-items: end center;
      padding: 18px 10px;
      background: radial-gradient(circle at 50% 38%, currentColor, transparent 27%), rgba(0, 0, 0, 0.22);
      font-size: 16px;
      overflow-wrap: anywhere;
    }

    .lobby-factions .blue { color: #2fb5ff; }
    .lobby-factions .gold { color: #e9bd5f; }
    .lobby-factions .red { color: #ff5148; }

    .lobby-big-cta,
    .lobby-guide-button,
    .lobby-apply {
      width: 100%;
      min-height: 66px;
      border: 1px solid rgba(47, 181, 255, 0.68);
      border-radius: 7px;
      color: #cceeff;
      background: linear-gradient(180deg, rgba(17, 94, 173, 0.86), rgba(7, 35, 70, 0.92));
      cursor: pointer;
      font-size: clamp(18px, 1.7vw, 25px);
      letter-spacing: 0.04em;
      transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
      overflow-wrap: anywhere;
    }

    .lobby-login-line {
      text-align: center;
      margin-top: 24px !important;
    }

    .lobby-login-line span {
      color: #2fb5ff;
    }

    .lobby-video-card {
      border: 1px solid rgba(255, 255, 255, 0.16);
      border-radius: 8px;
      background: #030405;
      overflow: hidden;
    }

    .lobby-video-board {
      min-height: clamp(260px, 23vw, 330px);
      display: grid;
      place-items: center;
      background:
        radial-gradient(circle at 50% 50%, rgba(175, 74, 255, 0.65), transparent 12%),
        linear-gradient(115deg, rgba(0, 98, 255, 0.54), transparent 38%),
        linear-gradient(245deg, rgba(255, 55, 42, 0.5), transparent 38%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 58px),
        linear-gradient(180deg, #101418, #060608);
    }

    .play-core {
      width: 92px;
      height: 92px;
      border: 3px solid rgba(255, 255, 255, 0.78);
      border-radius: 50%;
      display: grid;
      place-items: center;
      color: #a762ff;
      font-size: 42px;
      background: rgba(0, 0, 0, 0.34);
      box-shadow: 0 0 28px rgba(155, 92, 255, 0.5);
    }

    .lobby-video-meta {
      min-height: 38px;
      padding: 0 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      color: #d6d1c8;
      font-size: 12px;
      border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .lobby-feature-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 20px 28px;
      margin: 20px 0 26px;
      color: #d6d1c8;
      font-size: 15px;
    }

    .lobby-feature-grid span {
      min-width: 0;
      overflow-wrap: anywhere;
    }

    .lobby-feature-grid strong {
      color: #a762ff;
      margin-right: 8px;
    }

    .lobby-guide-button {
      border-color: rgba(167, 98, 255, 0.7);
      background: linear-gradient(180deg, rgba(93, 35, 150, 0.86), rgba(31, 13, 61, 0.94));
      color: #dbc7ff;
    }

    .lobby-settings-list {
      display: grid;
      gap: 14px;
      margin-bottom: 44px;
    }

    .lobby-settings-list label {
      justify-content: space-between;
      background: rgba(3, 22, 12, 0.56);
    }

    .lobby-settings-list strong {
      min-width: 120px;
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 7px;
      padding: 10px 12px;
      color: #d9e5d8;
      background: rgba(0, 0, 0, 0.22);
      text-align: center;
      overflow-wrap: anywhere;
    }

    .lobby-sandbox-copy,
    .guest-sandbox-description {
      max-width: 380px;
      margin: 0 auto 56px !important;
      text-align: center;
      color: #c9c4bc;
      font-size: 0.9rem;
      line-height: 1.42;
    }

    .lobby-apply {
      border-color: rgba(126, 218, 111, 0.7);
      color: #d7f6cd;
      background: linear-gradient(180deg, rgba(40, 128, 55, 0.86), rgba(11, 55, 20, 0.94));
    }

    .lobby-hint {
      min-height: 20px;
      margin: 0;
      color: #c9c4bc;
      font-size: 13px;
      text-align: center;
      overflow-wrap: anywhere;
    }

    @media (max-width: 1240px) {
      .lobby-header,
      .lobby-content {
        grid-template-columns: 1fr;
      }

      .lobby-nav {
        justify-self: center;
      }
    }

    @media (max-width: 900px) {
      .lobby-screen {
        padding: 10px;
      }

      .lobby-welcome {
        grid-template-columns: 56px minmax(0, 1fr);
      }

      .lobby-welcome-icon {
        width: 56px;
        height: 56px;
        font-size: 30px;
      }

      .lobby-factions,
      .lobby-feature-grid {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 640px) {
      .lobby-title {
        font-size: clamp(30px, 11vw, 42px);
        letter-spacing: 0.08em;
      }

      .lobby-subtitle {
        font-size: 11px;
        letter-spacing: 0.12em;
      }

      .lobby-nav {
        width: 100%;
        gap: 8px;
      }

      .lobby-panel {
        border-radius: 10px;
        padding: 16px;
      }

      .lobby-panel-heading {
        grid-template-columns: 1fr;
      }

      .lobby-settings-list label {
        align-items: stretch;
        flex-direction: column;
        padding: 12px;
      }

      .lobby-settings-list strong {
        width: 100%;
      }
    }

    button,
    input {
      font: inherit;
    }

    .game-shell {
      width: min(1380px, 100%);
      min-height: 100vh;
      margin: 0 auto;
      padding: 16px;
      overflow-anchor: none;
    }

    .game-layout {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 320px;
      gap: 16px;
      align-items: start;
    }

    .board-area {
      min-width: 0;
      overflow-anchor: none;
    }

    .captures-board {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 100;
      place-items: center;
      padding: 18px;
      background: rgba(7, 6, 5, 0.58);
      backdrop-filter: blur(3px);
      transform-origin: center;
    }

    body.show-capture-scores.show-capture-panel .captures-board {
      display: grid;
      animation: capture-backdrop-in 160ms ease-out both;
    }

    .capture-board-toggle {
      display: none;
      width: 42px;
      height: 42px;
      margin: -18px auto 0;
      border: 1px solid rgba(145, 244, 255, 0.28);
      border-radius: 50%;
      background:
        radial-gradient(circle at 35% 28%, rgba(145, 244, 255, 0.22), transparent 34%),
        linear-gradient(145deg, #29241e, #15130f);
      color: #91f4ff;
      cursor: pointer;
      place-items: center;
      font-size: 18px;
      line-height: 1;
      box-shadow: 0 0 12px rgba(0, 208, 255, 0.14), inset 0 0 12px rgba(255, 255, 255, 0.04);
      transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
      position: relative;
      z-index: 4;
      user-select: none;
      touch-action: none;
    }

    .capture-board-toggle.is-floating {
      position: absolute !important;
      margin: 0;
      z-index: 80;
    }

    .capture-board-toggle.is-dragging {
      cursor: grabbing;
      transition: none;
      transform: scale(1.08);
    }

    body.show-capture-scores .capture-board-toggle {
      display: grid;
      animation: capture-button-in 180ms ease-out both;
    }

    .capture-board-toggle:hover {
      transform: translateY(-1px) scale(1.04);
      border-color: rgba(145, 244, 255, 0.56);
      box-shadow: 0 0 18px rgba(0, 208, 255, 0.28), inset 0 0 12px rgba(255, 255, 255, 0.05);
    }

    .capture-board-toggle.is-open {
      border-color: #9b5cff;
      background:
        radial-gradient(circle at 35% 28%, rgba(155, 92, 255, 0.32), transparent 38%),
        linear-gradient(145deg, #352743, #1a151f);
      box-shadow: 0 0 18px rgba(155, 92, 255, 0.42), 0 0 24px rgba(0, 208, 255, 0.1);
    }

    .capture-panel {
      border: 1px solid rgba(145, 244, 255, 0.18);
      border-radius: 8px;
      background:
        linear-gradient(180deg, rgba(36, 31, 26, 0.94), rgba(22, 19, 16, 0.94)),
        rgba(32, 29, 25, 0.92);
      padding: 10px;
      min-height: 104px;
      width: min(560px, calc(100vw - 36px));
      max-height: calc(100vh - 36px);
      overflow: auto;
      box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
      animation: capture-modal-in 180ms ease-out both;
    }

    .capture-modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 10px;
    }

    .capture-modal-title {
      margin: 0;
      color: #e9dfd1;
      font-size: 13px;
      font-weight: 900;
    }

    .capture-modal-close {
      width: 30px;
      height: 30px;
      border: 1px solid rgba(145, 244, 255, 0.2);
      border-radius: 50%;
      background: rgba(18, 15, 13, 0.82);
      color: #e9dfd1;
      cursor: pointer;
      display: grid;
      place-items: center;
      font-size: 18px;
      line-height: 1;
      transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
    }

    .capture-modal-close:hover {
      transform: scale(1.06);
      border-color: #9b5cff;
      box-shadow: 0 0 12px rgba(155, 92, 255, 0.32);
    }

    .capture-taker-tabs,
    .capture-victim-bubbles,
    .capture-player-bubbles {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 10px;
    }

    .capture-taker-tabs {
      margin-bottom: 10px;
    }

    .capture-taker-tab {
      border: 1px solid #4f473d;
      border-radius: 999px;
      background: #28241f;
      color: #e9dfd1;
      cursor: pointer;
      padding: 6px 10px;
      font-size: 12px;
      font-weight: 800;
    }

    .capture-taker-tab.is-active {
      border-color: #9b5cff;
      background: #30263b;
      box-shadow: 0 0 12px rgba(155, 92, 255, 0.28);
    }

    .capture-player-bubble,
    .capture-victim-bubble {
      width: 96px;
      min-height: 76px;
      border: 1px solid rgba(145, 244, 255, 0.18);
      border-radius: 50%;
      background:
        radial-gradient(circle at 35% 28%, rgba(145, 244, 255, 0.18), transparent 34%),
        linear-gradient(145deg, #28231d, #15130f);
      color: #f5efe6;
      cursor: pointer;
      display: grid;
      place-items: center;
      padding: 8px;
      text-align: center;
      box-shadow: 0 0 12px rgba(0, 208, 255, 0.1), inset 0 0 14px rgba(255, 255, 255, 0.04);
      transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
      animation: capture-bubble-in 210ms ease-out both;
    }

    .capture-player-bubble:hover,
    .capture-victim-bubble:hover {
      transform: translateY(-2px) scale(1.03);
      border-color: rgba(145, 244, 255, 0.5);
      box-shadow: 0 0 18px rgba(0, 208, 255, 0.24), inset 0 0 14px rgba(255, 255, 255, 0.05);
    }

    .capture-player-bubble.is-active,
    .capture-victim-bubble.is-active {
      border-color: #9b5cff;
      background:
        radial-gradient(circle at 35% 28%, rgba(155, 92, 255, 0.36), transparent 36%),
        linear-gradient(145deg, #352743, #1a151f);
      box-shadow: 0 0 20px rgba(155, 92, 255, 0.42), 0 0 16px rgba(0, 208, 255, 0.12);
    }

    .capture-bubble-name {
      font-size: 11px;
      color: #cfc2b2;
    }

    .capture-bubble-score {
      font-size: 20px;
      font-weight: 900;
      color: #91f4ff;
      text-shadow: 0 0 10px rgba(0, 208, 255, 0.28);
    }

    .capture-detail {
      margin-top: 10px;
      border-top: 1px solid rgba(155, 92, 255, 0.28);
      padding-top: 10px;
      animation: capture-detail-in 190ms ease-out both;
    }

    .capture-detail-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .capture-detail-column {
      border: 1px solid rgba(145, 244, 255, 0.14);
      border-radius: 8px;
      background:
        linear-gradient(180deg, rgba(25, 22, 19, 0.72), rgba(14, 12, 10, 0.62)),
        rgba(17, 15, 13, 0.35);
      padding: 8px;
      min-width: 0;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    }

    .capture-panel-title {
      margin: 0 0 6px;
      color: #e9dfd1;
      font-size: 12px;
      font-weight: 800;
    }

    .capture-victim-row {
      display: flex;
      align-items: center;
      gap: 6px;
      min-height: 22px;
      color: #bfb4a5;
      font-size: 12px;
    }

    .capture-victim-name {
      min-width: 56px;
    }

    .capture-piece-list {
      display: flex;
      flex-wrap: wrap;
      gap: 2px;
      color: #f5efe6;
      font-size: 18px;
      line-height: 1;
    }

    .capture-breakdown {
      display: grid;
      gap: 4px;
      margin-top: 8px;
    }

    .capture-breakdown-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 42px 42px;
      align-items: center;
      gap: 8px;
      border-top: 1px solid rgba(233, 223, 209, 0.08);
      padding-top: 4px;
      color: #cfc2b2;
      font-size: 12px;
    }

    .capture-breakdown-piece {
      color: #f5efe6;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .capture-breakdown-row strong {
      color: #91f4ff;
      text-align: right;
    }

    .capture-breakdown-empty {
      color: #8f8578;
      font-size: 12px;
      padding-top: 4px;
    }

    @keyframes capture-button-in {
      from {
        opacity: 0;
        transform: translateY(-4px) scale(0.92);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    @keyframes capture-backdrop-in {
      from {
        opacity: 0;
      }
      to {
        opacity: 1;
      }
    }

    @keyframes capture-modal-in {
      from {
        opacity: 0;
        transform: translateY(10px) scale(0.96);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    @keyframes capture-bubble-in {
      from {
        opacity: 0;
        transform: translateY(6px) scale(0.92);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    @keyframes capture-detail-in {
      from {
        opacity: 0;
        transform: translateY(-5px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes view-panel-in {
      from {
        opacity: 0;
        transform: translateX(-50%) translateY(6px) scale(0.96);
      }
      to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
      }
    }

    .topbar {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      align-items: end;
      margin-bottom: 10px;
    }

    h1 {
      margin: 0 0 4px;
      font-size: clamp(24px, 3vw, 38px);
      font-weight: 800;
      letter-spacing: 0;
    }

    .status-line {
      margin: 0;
      min-height: 22px;
      color: #ddd3c3;
      font-size: 15px;
    }

    .turn-badge {
      min-width: 150px;
      border: 1px solid #726454;
      border-radius: 8px;
      padding: 10px 12px;
      background: #25221e;
      text-align: right;
      box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
    }

    .turn-label {
      display: block;
      color: #bfb2a2;
      font-size: 12px;
      text-transform: uppercase;
    }

    #turn-name {
      display: block;
      margin-top: 3px;
      font-size: 22px;
      font-weight: 800;
    }

#board {
  position: relative;
  width: min(980px, 100%, calc((100vh - 132px) / 0.88));
  height: auto;
  margin: 0 auto;
  aspect-ratio: 1 / 0.88;
      --board-view-rotation: 0deg;
      --board-counter-rotation: 0deg;
      transform-origin: center center;
      transition: transform 180ms ease;
      z-index: 2;
    }

    .view-controls {
      width: min(980px, 100%);
      min-height: 44px;
      margin: -8px auto 0;
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 8px;
      position: relative;
      z-index: 5;
    }

    .view-controls.is-floating {
      position: absolute !important;
      width: 56px;
      height: 56px;
      min-height: 0;
      margin: 0;
      justify-content: flex-start;
      z-index: 80;
    }

    .view-controls.is-dragging .view-controls-toggle {
      cursor: grabbing;
      transition: none;
      transform: scale(1.08);
    }

    .view-controls-toggle {
      width: 56px;
      height: 56px;
      border: 1px solid rgba(145, 244, 255, 0.28);
      border-radius: 50%;
      background:
        radial-gradient(circle at 35% 28%, rgba(145, 244, 255, 0.18), transparent 34%),
        linear-gradient(145deg, #29241e, #15130f);
      color: #d9fff7;
      cursor: pointer;
      display: grid;
      place-items: center;
      font-size: 19px;
      line-height: 1;
      box-shadow: 0 0 12px rgba(0, 208, 255, 0.14), inset 0 0 12px rgba(255, 255, 255, 0.04);
      transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
      user-select: none;
      touch-action: none;
    }

    .view-controls-toggle:hover {
      transform: translateY(-1px) scale(1.04);
      border-color: rgba(145, 244, 255, 0.56);
      box-shadow: 0 0 18px rgba(0, 208, 255, 0.28), inset 0 0 12px rgba(255, 255, 255, 0.05);
    }

    .view-controls-toggle.is-open {
      border-color: #9b5cff;
      background:
        radial-gradient(circle at 35% 28%, rgba(155, 92, 255, 0.32), transparent 38%),
        linear-gradient(145deg, #352743, #1a151f);
      box-shadow: 0 0 18px rgba(155, 92, 255, 0.42), 0 0 24px rgba(0, 208, 255, 0.1);
    }

    .view-controls-panel {
      display: none;
      position: absolute;
      left: 50%;
      bottom: calc(100% + 8px);
      transform: translateX(-50%);
      align-items: center;
      gap: 6px;
      border: 1px solid rgba(145, 244, 255, 0.18);
      border-radius: 8px;
      background:
        linear-gradient(180deg, rgba(36, 31, 26, 0.94), rgba(22, 19, 16, 0.94)),
        rgba(32, 29, 25, 0.92);
      padding: 6px;
      box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
      animation: view-panel-in 160ms ease-out both;
    }

    .view-controls.is-open .view-controls-panel {
      display: flex;
    }

    .view-controls-panel[data-board-tools-v2="true"] {
      position: absolute;
      box-sizing: border-box;
      padding: 8px;
      margin: 0;
      transform: none;
      z-index: 2;
      max-width: calc(100vw - 24px);
      max-height: calc(100vh - 24px);
      overflow: hidden;
    }

    .view-controls-panel[data-board-tools-v2="true"].is-side-dragging-lite {
      cursor: grabbing;
    }

    .view-controls-drag-handle {
      flex: 0 0 auto;
      width: 18px;
      height: 36px;
      border-radius: 999px;
      cursor: grab;
      opacity: 0.18;
      background: transparent;
      position: relative;
    }

    .view-controls-drag-handle::before {
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      width: 4px;
      height: 22px;
      transform: translate(-50%, -50%);
      border-radius: 999px;
      background: repeating-linear-gradient(
        180deg,
        rgba(210, 255, 240, 0.6) 0 2px,
        transparent 2px 5px
      );
    }

    .view-controls-drag-handle:hover {
      opacity: 0.42;
    }

    .view-controls-panel.is-side-dragging-lite .view-controls-drag-handle {
      cursor: grabbing;
      opacity: 0.7;
    }

    .view-controls[data-board-tools-drop="down"] .view-controls-panel {
      left: 50%;
      top: calc(100% + 10px);
      right: auto;
      bottom: auto;
      transform: translateX(-50%);
    }

    .view-controls[data-board-tools-drop="up"] .view-controls-panel {
      left: 50%;
      top: auto;
      right: auto;
      bottom: calc(100% + 10px);
      transform: translateX(-50%);
    }

    .view-controls-panel[data-board-tools-layout="horizontal"] {
      flex-direction: row;
      align-items: center;
      justify-content: center;
      gap: 8px;
      width: max-content;
      min-width: 280px;
      max-width: 460px;
      height: 56px;
    }

    .view-controls-panel[data-board-tools-layout="vertical"] {
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 8px;
      width: 76px;
      height: max-content;
      max-height: min(360px, calc(100vh - 24px));
      overflow: hidden;
    }

    .view-controls-panel[data-board-tools-layout="vertical"] .view-controls-drag-handle {
      width: 36px;
      height: 18px;
    }

    .view-controls-panel[data-board-tools-layout="vertical"] .view-controls-drag-handle::before {
      width: 22px;
      height: 4px;
      background: repeating-linear-gradient(
        90deg,
        rgba(210, 255, 240, 0.6) 0 2px,
        transparent 2px 5px
      );
    }

    .view-controls:not(.is-open) .view-controls-panel {
      display: none;
    }

    .view-controls-panel::after {
      content: "";
      position: absolute;
      left: 50%;
      top: 100%;
      width: 10px;
      height: 10px;
      border-right: 1px solid rgba(145, 244, 255, 0.18);
      border-bottom: 1px solid rgba(145, 244, 255, 0.18);
      background: rgba(22, 19, 16, 0.96);
      transform: translate(-50%, -5px) rotate(45deg);
    }

    .view-control-button {
      width: 38px;
      height: 38px;
      border: 1px solid rgba(145, 244, 255, 0.2);
      border-radius: 4px;
      background: rgba(32, 29, 25, 0.9);
      color: #d9fff7;
      cursor: pointer;
      display: grid;
      place-items: center;
      font-size: 20px;
      font-weight: 900;
      line-height: 1;
      transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
    }

    .view-control-button:hover {
      transform: translateY(-1px);
      border-color: #9b5cff;
      background: #30263b;
      box-shadow: 0 0 12px rgba(155, 92, 255, 0.3);
    }

    .view-control-value {
      min-width: 72px;
      color: #cfc2b2;
      font-size: 12px;
      font-weight: 800;
      text-align: center;
      font-variant-numeric: tabular-nums;
    }

    .notation-widget {
      --toggle-size: 56px;
      --log-gap: 14px;
      --panel-vertical-w: 360px;
      --panel-horizontal-w: 440px;
      position: fixed !important;
      width: 56px !important;
      height: 56px !important;
      min-height: 0;
      margin: 0 !important;
      display: block;
      transform: none !important;
      translate: none !important;
      z-index: 80;
    }

    .notation-widget.is-floating {
      position: fixed !important;
      width: 56px !important;
      height: 56px !important;
      min-height: 0;
      margin: 0 !important;
      transform: none !important;
      translate: none !important;
      z-index: 80;
    }

    .notation-widget.is-dragging .notation-toggle {
      cursor: grabbing;
      transition: none;
      transform: scale(1.08);
    }

    .notation-toggle {
      position: absolute !important;
      inset: 0 !important;
      width: 100%;
      height: 100%;
      margin: 0 !important;
      transform: none !important;
      translate: none !important;
      border: 1px solid rgba(145, 244, 255, 0.28);
      border-radius: 50%;
      background:
        radial-gradient(circle at 35% 28%, rgba(145, 244, 255, 0.18), transparent 34%),
        linear-gradient(145deg, #29241e, #15130f);
      color: #d9fff7;
      cursor: pointer;
      display: grid;
      place-items: center;
      font-size: 20px;
      line-height: 1;
      box-shadow: 0 0 12px rgba(0, 208, 255, 0.14), inset 0 0 12px rgba(255, 255, 255, 0.04);
      transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
      user-select: none;
      touch-action: none;
    }

    .notation-toggle:hover {
      border-color: rgba(145, 244, 255, 0.56);
      box-shadow: 0 0 18px rgba(0, 208, 255, 0.28), inset 0 0 12px rgba(255, 255, 255, 0.05);
    }

    .notation-toggle.is-open {
      border-color: #9b5cff;
      background:
        radial-gradient(circle at 35% 28%, rgba(155, 92, 255, 0.32), transparent 38%),
        linear-gradient(145deg, #352743, #1a151f);
      box-shadow: 0 0 18px rgba(155, 92, 255, 0.42), 0 0 24px rgba(0, 208, 255, 0.1);
    }

    .notation-panel {
      display: none;
      position: absolute;
      opacity: 0;
      pointer-events: none;
      left: auto;
      right: auto;
      top: auto;
      bottom: auto;
      width: var(--move-log-panel-width, 320px);
      max-height: min(360px, calc(100vh - 24px));
      overflow: auto;
      transform: none;
      transition: opacity 0.14s ease, transform 0.14s ease;
      border: 1px solid rgba(145, 244, 255, 0.18);
      border-radius: 8px;
      background:
        linear-gradient(180deg, rgba(36, 31, 26, 0.96), rgba(22, 19, 16, 0.96)),
        rgba(32, 29, 25, 0.92);
      padding: 10px;
      box-shadow: 0 12px 26px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.04);
      animation: view-panel-in 160ms ease-out both;
    }

    .notation-widget.is-open .notation-panel {
      display: block;
      opacity: 1;
      pointer-events: auto;
    }

    .notation-widget.is-dock-right .notation-panel {
      left: calc(var(--toggle-size) + var(--log-gap));
      right: auto;
    }

    .notation-widget.is-dock-left .notation-panel {
      left: auto;
      right: calc(var(--toggle-size) + var(--log-gap));
    }

    .notation-widget[data-dock="top-horizontal"] .notation-panel,
    .notation-widget.is-dock-top-horizontal .notation-panel,
    .notation-widget.is-dock-up .notation-panel {
      left: 50%;
      right: auto;
      top: auto;
      bottom: calc(100% + 14px);
      width: 420px;
      max-width: min(420px, calc(100vw - 32px));
      max-height: min(260px, calc(100vh - 24px));
      transform: translateX(-50%);
    }

    .notation-widget[data-dock="bottom-horizontal"] .notation-panel,
    .notation-widget.is-dock-bottom-horizontal .notation-panel {
      left: 50%;
      right: auto;
      top: calc(100% + 14px);
      bottom: auto;
      width: 420px;
      max-width: min(420px, calc(100vw - 32px));
      max-height: min(260px, calc(100vh - 24px));
      transform: translateX(-50%);
    }

    .notation-widget[data-dock="right-vertical"] .notation-panel,
    .notation-widget.is-dock-right-vertical .notation-panel {
      left: calc(100% + 14px);
      right: auto;
      top: 50%;
      bottom: auto;
      width: 320px;
      max-width: 320px;
      max-height: min(360px, calc(100vh - 24px));
      transform: translateY(-50%);
    }

    .notation-widget[data-dock="left-vertical"] .notation-panel,
    .notation-widget.is-dock-left-vertical .notation-panel {
      left: auto;
      right: calc(100% + 14px);
      top: 50%;
      bottom: auto;
      width: 320px;
      max-width: 320px;
      max-height: min(360px, calc(100vh - 24px));
      transform: translateY(-50%);
    }

    .notation-panel::after {
      display: none;
    }

    .notation-widget[data-dock="right-vertical"] .notation-panel,
    .notation-widget.is-dock-right-vertical .notation-panel {
      left: calc(100% + 14px) !important;
      right: auto !important;
      top: 50% !important;
      bottom: auto !important;
      width: 320px !important;
      max-width: 320px !important;
      max-height: min(360px, calc(100vh - 24px)) !important;
      transform: translateY(-50%) !important;
      translate: none !important;
    }

    .notation-widget[data-dock="left-vertical"] .notation-panel,
    .notation-widget.is-dock-left-vertical .notation-panel {
      right: calc(100% + 14px) !important;
      left: auto !important;
      top: 50% !important;
      bottom: auto !important;
      width: 320px !important;
      max-width: 320px !important;
      max-height: min(360px, calc(100vh - 24px)) !important;
      transform: translateY(-50%) !important;
      translate: none !important;
    }

    .notation-widget[data-dock="bottom-horizontal"] .notation-panel,
    .notation-widget.is-dock-bottom-horizontal .notation-panel {
      top: calc(100% + 14px) !important;
      bottom: auto !important;
      left: 50% !important;
      right: auto !important;
      width: 420px !important;
      max-width: min(420px, calc(100vw - 32px)) !important;
      max-height: min(260px, calc(100vh - 24px)) !important;
      transform: translateX(-50%) !important;
      translate: none !important;
    }

    .notation-widget[data-dock="top-horizontal"] .notation-panel,
    .notation-widget.is-dock-top-horizontal .notation-panel {
      bottom: calc(100% + 14px) !important;
      top: auto !important;
      left: 50% !important;
      right: auto !important;
      width: 420px !important;
      max-width: min(420px, calc(100vw - 32px)) !important;
      max-height: min(260px, calc(100vh - 24px)) !important;
      transform: translateX(-50%) !important;
      translate: none !important;
    }

    /* Move Log V2 side-stack dock draft: CSS only, not applied by logic yet */
    .notation-widget[data-dock="left-column-stack"] .notation-panel,
    .notation-widget.is-dock-left-column-stack .notation-panel {
      left: 50% !important;
      right: auto !important;
      top: calc(100% + 12px) !important;
      bottom: auto !important;
      width: 300px !important;
      max-width: min(300px, calc(100vw - 24px)) !important;
      max-height: min(460px, calc(100vh - 24px)) !important;
      transform: translateX(-50%) !important;
      translate: none !important;
    }

    .notation-widget[data-dock="right-column-stack"] .notation-panel,
    .notation-widget.is-dock-right-column-stack .notation-panel {
      left: 50% !important;
      right: auto !important;
      top: calc(100% + 12px) !important;
      bottom: auto !important;
      width: 300px !important;
      max-width: min(300px, calc(100vw - 24px)) !important;
      max-height: min(460px, calc(100vh - 24px)) !important;
      transform: translateX(-50%) !important;
      translate: none !important;
    }

    .notation-panel-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 8px;
    }

    .notation-panel-title {
      margin: 0;
      color: #e9dfd1;
      font-size: 13px;
      font-weight: 900;
    }

    .notation-panel-close {
      width: 28px;
      height: 28px;
      border: 1px solid rgba(145, 244, 255, 0.2);
      border-radius: 50%;
      background: rgba(18, 15, 13, 0.82);
      color: #e9dfd1;
      cursor: pointer;
      display: grid;
      place-items: center;
      font-size: 18px;
      line-height: 1;
    }

    .notation-move-list {
      display: grid;
      gap: 6px;
    }

    .board-art {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      filter: drop-shadow(0 24px 34px rgba(0, 0, 0, 0.38));
      user-select: none;
      z-index: 1;
    }

    .board-cell-art {
      cursor: pointer;
      outline: none;
      transition: filter 0.12s ease;
    }

    .board-cell-art:hover,
    .board-cell-art:focus-visible {
      filter: brightness(1.12);
    }

        .board-cell-art.is-legal-move {
      --move-fill: #08bfff;
      --move-stroke: #9b5cff;
      --move-glow: rgba(0, 208, 255, 0.88);
      --victim-glow: rgba(255, 255, 255, 0.4);
      fill: var(--move-fill) !important;
      fill-opacity: 0.62;
      filter: brightness(1.28) saturate(1.65) drop-shadow(0 0 10px var(--move-glow));
      stroke: var(--move-stroke) !important;
      stroke-width: 4px;
      paint-order: stroke fill;
    }

    .board-cell-art.is-capture-move {
      fill-opacity: 0.82;
      stroke-width: 7px;
      filter:
        brightness(1.45)
        saturate(2)
        drop-shadow(0 0 12px var(--move-glow))
        drop-shadow(0 0 8px var(--victim-glow));
    }

    .board-cell-art.move-highlight-live {
      animation: moveHighlightLivePulse 1450ms ease-in-out infinite;
      filter:
        brightness(1.28)
        saturate(1.65)
        drop-shadow(0 0 7px var(--move-highlight-glow, rgba(255, 255, 255, 0.45)));
    }

    .board-cell-art.move-highlight-live-volumetric {
      animation: moveHighlightVolumetricPulse 1550ms ease-in-out infinite;
      animation-delay: var(--move-highlight-live-delay, 0ms);
      filter:
        drop-shadow(0 0 5px var(--move-highlight-glow, rgba(255, 255, 255, 0.28)))
        drop-shadow(0 0 12px var(--move-highlight-glow, rgba(255, 255, 255, 0.18)));
    }

    .board-cell-art.is-capture-move.move-highlight-live {
      animation-name: moveHighlightLiveCapturePulse;
    }

    .board-cell-art.is-capture-move.move-highlight-live-volumetric {
      animation-name: moveHighlightVolumetricCapturePulse;
    }

    @keyframes moveHighlightLivePulse {
      0% {
        stroke-opacity: 0.62;
        fill-opacity: 0.54;
        filter:
          brightness(1.18)
          saturate(1.42)
          drop-shadow(0 0 4px var(--move-highlight-glow, rgba(255, 255, 255, 0.38)));
      }

      45% {
        stroke-opacity: 1;
        fill-opacity: 0.68;
        filter:
          brightness(1.36)
          saturate(1.75)
          drop-shadow(0 0 13px var(--move-highlight-glow, rgba(255, 255, 255, 0.72)));
      }

      100% {
        stroke-opacity: 0.62;
        fill-opacity: 0.54;
        filter:
          brightness(1.18)
          saturate(1.42)
          drop-shadow(0 0 4px var(--move-highlight-glow, rgba(255, 255, 255, 0.38)));
      }
    }

    @keyframes moveHighlightLiveCapturePulse {
      0% {
        stroke-opacity: 0.68;
        fill-opacity: 0.7;
        filter:
          brightness(1.28)
          saturate(1.7)
          drop-shadow(0 0 6px var(--move-highlight-glow, rgba(255, 255, 255, 0.45)));
      }

      45% {
        stroke-opacity: 1;
        fill-opacity: 0.84;
        filter:
          brightness(1.5)
          saturate(2)
          drop-shadow(0 0 16px var(--move-highlight-glow, rgba(255, 255, 255, 0.78)));
      }

      100% {
        stroke-opacity: 0.68;
        fill-opacity: 0.7;
        filter:
          brightness(1.28)
          saturate(1.7)
          drop-shadow(0 0 6px var(--move-highlight-glow, rgba(255, 255, 255, 0.45)));
      }
    }

    @keyframes moveHighlightVolumetricPulse {
      0% {
        stroke-opacity: 0.55;
        fill-opacity: 0.24;
        filter:
          drop-shadow(0 0 3px var(--move-highlight-glow, rgba(255, 255, 255, 0.2)))
          drop-shadow(0 0 7px var(--move-highlight-glow, rgba(255, 255, 255, 0.12)));
      }

      42% {
        stroke-opacity: 0.92;
        fill-opacity: 0.34;
        filter:
          drop-shadow(0 0 8px var(--move-highlight-glow, rgba(255, 255, 255, 0.38)))
          drop-shadow(0 0 18px var(--move-highlight-glow, rgba(255, 255, 255, 0.2)));
      }

      100% {
        stroke-opacity: 0.55;
        fill-opacity: 0.24;
        filter:
          drop-shadow(0 0 3px var(--move-highlight-glow, rgba(255, 255, 255, 0.2)))
          drop-shadow(0 0 7px var(--move-highlight-glow, rgba(255, 255, 255, 0.12)));
      }
    }

    @keyframes moveHighlightVolumetricCapturePulse {
      0% {
        stroke-opacity: 0.62;
        fill-opacity: 0.3;
        filter:
          drop-shadow(0 0 4px var(--move-highlight-glow, rgba(255, 255, 255, 0.24)))
          drop-shadow(0 0 8px var(--move-highlight-glow, rgba(255, 255, 255, 0.16)));
      }

      42% {
        stroke-opacity: 0.98;
        fill-opacity: 0.42;
        filter:
          drop-shadow(0 0 10px var(--move-highlight-glow, rgba(255, 255, 255, 0.42)))
          drop-shadow(0 0 22px var(--move-highlight-glow, rgba(255, 255, 255, 0.22)));
      }

      100% {
        stroke-opacity: 0.62;
        fill-opacity: 0.3;
        filter:
          drop-shadow(0 0 4px var(--move-highlight-glow, rgba(255, 255, 255, 0.24)))
          drop-shadow(0 0 8px var(--move-highlight-glow, rgba(255, 255, 255, 0.16)));
      }
    }

    .board-cell-art.move-white {
      --move-fill: #fff7df;
      --move-stroke: #f2c96d;
      --move-glow: rgba(255, 236, 180, 0.92);
    }

    .board-cell-art.move-red {
      --move-fill: #ff3b46;
      --move-stroke: #ffb35c;
      --move-glow: rgba(255, 53, 71, 0.95);
    }

    .board-cell-art.move-black {
      --move-fill: #16181d;
      --move-stroke: #91f4ff;
      --move-glow: rgba(145, 244, 255, 0.9);
    }

    .board-cell-art.victim-white {
      --victim-glow: rgba(255, 255, 255, 0.92);
    }

    .board-cell-art.victim-red {
      --victim-glow: rgba(255, 53, 71, 0.9);
    }

    .board-cell-art.victim-black {
      --victim-glow: rgba(12, 12, 12, 0.9);
    }

    .board-cell-art.is-capture-hit {
      animation: capture-cell-hit 420ms ease-out both;
    }

    @keyframes diplomatic-target-pulse {
      from {
        filter:
          brightness(1.25)
          saturate(1.7)
          drop-shadow(0 0 8px var(--move-glow))
          drop-shadow(0 0 5px var(--victim-glow));
      }

      to {
        filter:
          brightness(1.58)
          saturate(2.25)
          drop-shadow(0 0 16px var(--move-glow))
          drop-shadow(0 0 12px var(--victim-glow));
      }
    }

    @keyframes capture-cell-hit {
      0% {
        filter:
          brightness(2)
          saturate(2.4)
          drop-shadow(0 0 18px var(--move-glow));
      }

      100% {
        filter:
          brightness(1.08)
          saturate(1.2)
          drop-shadow(0 0 2px var(--move-glow));
      }
    }

    .board-cell-art.is-check-cell {
      fill: #ff253a !important;
      fill-opacity: 0.82;
      filter: brightness(1.45) saturate(2) drop-shadow(0 0 14px rgba(255, 37, 58, 0.9));
      stroke: #9b5cff !important;
      stroke-width: 5px;
      paint-order: stroke fill;
    }

    .cell-marker {
      position: absolute;
      width: clamp(20px, 2.8vw, 28px);
      height: clamp(20px, 2.8vw, 28px);
      border: 2px solid #ffffff;
      border-radius: 50%;
      background: #16d9df;
      color: #111;
      transform: translate(-50%, -50%);
      font-size: clamp(7px, 1vw, 9px);
      font-weight: 800;
      line-height: 1;
      text-align: center;
      cursor: pointer;
      z-index: 12;
      opacity: 0;
      pointer-events: auto;
      transform: translate(-50%, -50%) rotate(var(--board-counter-rotation));
    }

    #board.show-markers .cell-marker {
      opacity: 1;
    }

        .cell-marker.is-legal-move {
      opacity: 1;
      --marker-bg: #08bfff;
      --marker-border: #9b5cff;
      --marker-glow: rgba(0, 208, 255, 0.85);
      background: var(--marker-bg);
      border-color: var(--marker-border);
      box-shadow: 0 0 18px var(--marker-glow), 0 0 0 2px rgba(155, 92, 255, 0.55);
    }

    .cell-marker.is-capture-move {
      transform: translate(-50%, -50%) rotate(var(--board-counter-rotation)) scale(1.12);
      box-shadow: 0 0 22px var(--marker-glow), 0 0 0 3px var(--marker-border);
    }

    .cell-marker.move-white {
      --marker-bg: #fff7df;
      --marker-border: #f2c96d;
      --marker-glow: rgba(255, 236, 180, 0.9);
      color: #171613;
    }

    .cell-marker.move-red {
      --marker-bg: #ff3b46;
      --marker-border: #ffb35c;
      --marker-glow: rgba(255, 53, 71, 0.9);
      color: #fff;
    }

    .cell-marker.move-black {
      --marker-bg: #171717;
      --marker-border: #91f4ff;
      --marker-glow: rgba(145, 244, 255, 0.9);
      color: #fff;
    }

    .cell-marker.is-check-cell {
      opacity: 1;
      background: #ff253a;
      border-color: #9b5cff;
      color: #fff;
      box-shadow: 0 0 18px rgba(255, 37, 58, 0.9), 0 0 0 2px rgba(155, 92, 255, 0.85);
    }

    .live-move-animation-layer {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 11;
      overflow: visible;
    }

    .live-move-cell {
      fill: var(--live-move-fill) !important;
      stroke: var(--live-move-stroke) !important;
      stroke-width: 2px;
      paint-order: stroke fill;
      opacity: 0;
      transform-origin: center;
      filter: drop-shadow(0 0 10px var(--live-move-glow));
      animation: liveMoveCellPulse 950ms ease-out forwards;
    }

    .live-move-cell--start {
      stroke-width: 2px;
    }

    .live-move-cell--end {
      animation-duration: 1100ms;
      filter: drop-shadow(0 0 14px var(--live-move-glow));
    }

    .live-move-cell--capture {
      animation-name: liveMoveCellCapturePulse;
      stroke-width: 3px;
    }

    @keyframes liveMoveCellPulse {
      0% {
        opacity: 0;
        filter: drop-shadow(0 0 0 var(--live-move-glow));
      }

      16% {
        opacity: 0.92;
        filter: drop-shadow(0 0 12px var(--live-move-glow));
      }

      48% {
        opacity: 0.72;
        filter: drop-shadow(0 0 18px var(--live-move-glow));
      }

      100% {
        opacity: 0;
        filter: drop-shadow(0 0 4px var(--live-move-glow));
      }
    }

    @keyframes liveMoveCellCapturePulse {
      0% {
        opacity: 0;
        filter: drop-shadow(0 0 0 var(--live-move-glow));
      }

      14% {
        opacity: 1;
        filter: drop-shadow(0 0 16px var(--live-move-glow));
      }

      52% {
        opacity: 0.82;
        filter: drop-shadow(0 0 22px var(--live-move-glow));
      }

      100% {
        opacity: 0;
        filter: drop-shadow(0 0 4px var(--live-move-glow));
      }
    }

    .piece {
      position: absolute;
      width: var(--piece-size);
      height: var(--piece-size);
      border: 0;
      border-radius: 50%;
      display: grid;
      place-items: center;
      transform: translate(-50%, -60%) rotate(var(--board-counter-rotation));
      z-index: 20;
      cursor: pointer;
      font-size: calc(var(--piece-size) * 0.86);
      line-height: 1;
      background: transparent;
      text-shadow: 0 2px 0 rgba(0, 0, 0, 0.32), 0 0 8px rgba(0, 0, 0, 0.36);
      transition: opacity 0.18s ease, filter 0.18s ease, transform 0.18s ease;
    }

    .piece-white {
      color: #ffffff;
    }

    .piece-red {
      color: #e53935;
    }

    .piece-black {
      color: #171717;
      text-shadow: 0 0 2px #ffffff, 0 2px 3px rgba(255, 255, 255, 0.55);
    }

       .piece.is-selected {
      transform: translate(-50%, -66%) rotate(var(--board-counter-rotation)) scale(1.08);
    }

    .piece-white.is-selected {
      filter:
        drop-shadow(0 0 12px rgba(255, 255, 255, 0.95))
        drop-shadow(0 0 9px rgba(242, 201, 109, 0.95));
    }

    .piece-red.is-selected {
      filter:
        drop-shadow(0 0 12px rgba(255, 53, 71, 0.95))
        drop-shadow(0 0 8px rgba(255, 179, 92, 0.8));
    }

    .piece-black.is-selected {
      filter:
        drop-shadow(0 0 3px rgba(255, 255, 255, 0.95))
        drop-shadow(0 0 13px rgba(145, 244, 255, 0.9));
    }

    .piece.is-waiting {
      opacity: 0.42;
    }

    .piece.is-dice-locked {
      opacity: 0.32;
      filter: grayscale(0.65) saturate(0.7);
    }


        .capture-burst {
      position: absolute;
      z-index: 44;
      left: 50%;
      top: 50%;
      width: clamp(34px, 5.5vw, 62px);
      height: clamp(34px, 5.5vw, 62px);
      border-radius: 50%;
      pointer-events: none;
      transform: translate(-50%, -60%) rotate(var(--board-counter-rotation));
      --burst-color: rgba(145, 244, 255, 0.95);
      --victim-color: rgba(255, 255, 255, 0.65);
      background:
        radial-gradient(circle, var(--victim-color) 0 12%, transparent 13%),
        radial-gradient(circle, transparent 42%, var(--burst-color) 44% 52%, transparent 54%);
      box-shadow: 0 0 18px var(--burst-color);
      animation: capture-burst 460ms ease-out forwards;
    }

    .capture-burst.move-white {
      --burst-color: rgba(255, 236, 180, 0.95);
    }

    .capture-burst.move-red {
      --burst-color: rgba(255, 53, 71, 0.95);
    }

    .capture-burst.move-black {
      --burst-color: rgba(145, 244, 255, 0.95);
    }

    .capture-burst.victim-white {
      --victim-color: rgba(255, 255, 255, 0.9);
    }

    .capture-burst.victim-red {
      --victim-color: rgba(255, 53, 71, 0.85);
    }

    .capture-burst.victim-black {
      --victim-color: rgba(20, 20, 20, 0.85);
    }

    .capture-ghost {
      position: absolute;
      z-index: 43;
      left: 50%;
      top: 50%;
      pointer-events: none;
      transform: translate(-50%, -60%) rotate(var(--board-counter-rotation));
      font-size: clamp(24px, 4.6vw, 48px);
      line-height: 1;
      opacity: 0.92;
      text-shadow: 0 0 10px rgba(255, 255, 255, 0.42), 0 2px 3px rgba(0, 0, 0, 0.5);
      animation: capture-ghost 520ms ease-out forwards;
    }

    @keyframes capture-burst {
      0% {
        opacity: 0;
        transform: translate(-50%, -60%) rotate(var(--board-counter-rotation)) scale(0.45);
      }

      25% {
        opacity: 1;
        transform: translate(-50%, -60%) rotate(var(--board-counter-rotation)) scale(1.05);
      }

      100% {
        opacity: 0;
        transform: translate(-50%, -60%) rotate(var(--board-counter-rotation)) scale(1.85);
      }
    }

    @keyframes capture-ghost {
      0% {
        opacity: 0.95;
        transform: translate(-50%, -60%) rotate(var(--board-counter-rotation)) scale(1);
      }

      100% {
        opacity: 0;
        transform: translate(-50%, -150%) rotate(var(--board-counter-rotation)) scale(0.62);
      }
    }

    .capture-pop {
      position: absolute;
      z-index: 45;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -60%) rotate(var(--board-counter-rotation));
      pointer-events: none;
      color: #91f4ff;
      font-size: clamp(18px, 3vw, 30px);
      font-weight: 900;
      text-shadow: 0 0 8px rgba(0, 208, 255, 0.95), 0 0 3px #111;
      animation: capture-pop 900ms ease-out forwards;
    }

    .capture-pop.white {
      color: #ffffff;
    }

    .capture-pop.red {
      color: #ff5b5b;
      text-shadow: 0 0 9px rgba(255, 37, 58, 0.95), 0 0 3px #111;
    }

    .capture-pop.black {
      color: #151515;
      text-shadow: 0 0 4px #ffffff, 0 0 10px rgba(255, 255, 255, 0.7);
    }

    @keyframes capture-pop {
      0% {
        opacity: 0;
        transform: translate(-50%, -35%) rotate(var(--board-counter-rotation)) scale(0.75);
      }

      18% {
        opacity: 1;
        transform: translate(-50%, -70%) rotate(var(--board-counter-rotation)) scale(1.12);
      }

      100% {
        opacity: 0;
        transform: translate(-50%, -155%) rotate(var(--board-counter-rotation)) scale(1);
      }
    }

    #board.route-test-active .piece:not(.route-test-piece) {
      opacity: 0;
      pointer-events: none;
    }

    .route-test-piece {
      filter: drop-shadow(0 0 12px #25f4ee) drop-shadow(0 0 4px #ffffff);
      transform: translate(-50%, -66%) rotate(var(--board-counter-rotation)) scale(1.08);
    }

    .side-panel {
      border: 1px solid #655848;
      border-radius: 8px;
      background: #201d19;
      box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
      overflow: hidden;
    }

    .panel-section {
      padding: 14px;
      border-bottom: 1px solid #3a332b;
    }

    .panel-section:last-child {
      border-bottom: 0;
    }

    .panel-title {
      margin: 0 0 10px;
      color: #cfc2b2;
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    .room-controls {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 8px;
    }

    .room-controls input {
      min-width: 0;
      height: 36px;
      border: 1px solid #6e6257;
      border-radius: 6px;
      background: #2a2621;
      color: #f8f4ed;
      padding: 0 10px;
    }

    .action-button {
      height: 36px;
      border: 1px solid #8b7866;
      border-radius: 6px;
      background: #e7ded2;
      color: #181818;
      padding: 0 12px;
      cursor: pointer;
      font-weight: 700;
    }

    .ghost-button {
      grid-column: 1 / -1;
      background: #27231f;
      color: #f0e8dc;
    }

    #room-label {
      grid-column: 1 / -1;
      color: #bfb4a5;
      font-size: 13px;
    }

    .player-list {
      display: grid;
      gap: 8px;
    }

    .player-card {
      display: grid;
      grid-template-columns: 12px 1fr auto auto;
      gap: 9px;
      align-items: center;
      min-height: 42px;
      border: 1px solid #4f473d;
      border-radius: 8px;
      padding: 8px;
      background: #28241f;
      color: #e9dfd1;
    }

    .player-card.is-active {
      border-color: #efe0cb;
      background: #373027;
    }

    .player-dot {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      border: 1px solid rgba(255, 255, 255, 0.5);
    }

    .player-dot.white {
      background: #ffffff;
    }

    .player-dot.red {
      background: #e53935;
    }

    .player-dot.black {
      background: #111111;
    }

    .player-name {
      font-weight: 800;
    }

    .player-meta {
      color: #baaE9e;
      font-size: 12px;
    }

    .capture-score {
      display: none;
      color: #91f4ff;
      font-size: 12px;
      font-weight: 800;
    }

    body.show-capture-scores .capture-score {
      display: inline;
    }

    .capture-panel-button {
      display: none;
      width: 30px;
      height: 30px;
      border: 1px solid #6e6257;
      border-radius: 50%;
      background: #201d19;
      color: #91f4ff;
      cursor: pointer;
      place-items: center;
      font-size: 16px;
      line-height: 1;
      box-shadow: 0 0 10px rgba(0, 208, 255, 0.12);
    }

    body.show-capture-scores .capture-panel-button {
      display: none;
    }

    .capture-panel-button.is-open {
      border-color: #9b5cff;
      background: #30263b;
      box-shadow: 0 0 14px rgba(155, 92, 255, 0.35);
    }

    .debug-control {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 28px;
      color: #d9d0c2;
      font-size: 14px;
      user-select: none;
    }

    .route-test-controls {
      display: grid;
      gap: 8px;
    }

    .route-test-row {
      display: grid;
      grid-template-columns: 86px 1fr;
      gap: 8px;
      align-items: center;
      color: #d9d0c2;
      font-size: 13px;
    }

    .route-test-row select,
    .route-test-row input[type="text"] {
      min-width: 0;
      height: 32px;
      border: 1px solid #6e6257;
      border-radius: 6px;
      background: #2a2621;
      color: #f8f4ed;
      padding: 0 8px;
    }

    .route-test-output {
      min-height: 46px;
      max-height: 120px;
      overflow: auto;
      border: 1px solid #3f372f;
      border-radius: 6px;
      background: #171512;
      color: #d9d0c2;
      padding: 8px;
      font-size: 12px;
      line-height: 1.45;
    }

    .promotion-overlay {
      position: fixed;
      inset: 0;
      z-index: 80;
      display: none;
      place-items: center;
      padding: 20px;
      background: rgba(8, 8, 8, 0.58);
      backdrop-filter: blur(3px);
    }

    .promotion-overlay.is-open {
      display: grid;
    }

    .promotion-panel {
      width: min(360px, 100%);
      border: 1px solid #9b5cff;
      border-radius: 8px;
      background: #211d19;
      box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45), 0 0 26px rgba(155, 92, 255, 0.24);
      padding: 14px;
    }

    .promotion-title {
      margin: 0 0 12px;
      color: #f5efe6;
      font-size: 16px;
      font-weight: 800;
    }

    .promotion-options {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 8px;
    }

    .promotion-option {
      min-height: 64px;
      border: 1px solid #6e6257;
      border-radius: 8px;
      background: #2a2621;
      color: #f8f4ed;
      cursor: pointer;
      display: grid;
      place-items: center;
      gap: 2px;
      padding: 7px 4px;
    }

    .promotion-option:hover,
    .promotion-option:focus-visible {
      border-color: #9b5cff;
      background: #30263b;
      outline: none;
      box-shadow: 0 0 14px rgba(155, 92, 255, 0.35);
    }

    .promotion-symbol {
      font-size: 30px;
      line-height: 1;
    }

    .promotion-name {
      font-size: 11px;
      font-weight: 700;
    }

    .move-log {
      display: grid;
      gap: 6px;
      max-height: 260px;
      overflow: auto;
      padding-right: 4px;
    }

    .move-row {
      display: grid;
      grid-template-columns: 34px 1fr;
      gap: 8px;
      align-items: baseline;
      border-radius: 6px;
      padding: 6px 7px;
      background: #29251f;
      font-size: 13px;
    }

    .move-number {
      color: #b7aa99;
      font-variant-numeric: tabular-nums;
    }

    .empty-log {
      margin: 0;
      color: #a99c8d;
      font-size: 13px;
    }

    .rules-note {
      margin: 0;
      color: #c8bbaa;
      font-size: 13px;
      line-height: 1.45;
    }

    @media (max-width: 1040px) {
      .game-layout {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 700px) {
      .game-shell {
        padding: 10px;
      }


      /* =========================================================
   HEIGHT-FIRST RESPONSIVE PATCH
   РРЅС‚РµСЂС„РµР№СЃ Р·Р°РЅРёРјР°РµС‚ 100% С€РёСЂРёРЅС‹ Рё РІС‹СЃРѕС‚С‹ СЌРєСЂР°РЅР°.
   РџСЂРёРѕСЂРёС‚РµС‚: СЃРЅР°С‡Р°Р»Р° РІС‹СЃРѕС‚Р°, РїРѕС‚РѕРј С€РёСЂРёРЅР°.
   ========================================================= */

html,
body {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100dvh;
  overflow: hidden;
}

/* ---------- Р›РћР‘Р‘Р: РїРѕР»РЅС‹Р№ СЌРєСЂР°РЅ Р±РµР· РІРЅРµС€РЅРµРіРѕ СЃРєСЂРѕР»Р»Р° ---------- */

.lobby-screen {
  width: 100dvw;
  height: 100dvh;
  min-height: 0;
  padding: clamp(8px, 1.5vmin, 18px);
  overflow: hidden;
}

.lobby-shell {
  width: min(1680px, 100%);
  height: calc(100dvh - clamp(16px, 3vmin, 36px));
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(8px, 1.4vmin, 16px);
}

/* РЁР°РїРєР° РґРѕР»Р¶РЅР° Р±С‹С‚СЊ РєРѕРјРїР°РєС‚РЅРѕР№ Рё РЅРµ СЃСЉРµРґР°С‚СЊ РїРѕР»РѕРІРёРЅСѓ СЌРєСЂР°РЅР° */
.lobby-header {
  min-height: 0;
  display: grid;
  grid-template-columns:
    minmax(230px, 0.72fr)
    minmax(280px, 1fr)
    minmax(300px, 0.86fr);
  gap: clamp(10px, 1.4vmin, 18px);
  align-items: stretch;
}

.lobby-welcome {
  min-height: clamp(76px, 11dvh, 120px);
  padding: clamp(10px, 1.4vmin, 18px);
  grid-template-columns: clamp(46px, 7dvh, 72px) minmax(0, 1fr);
  gap: clamp(10px, 1.4vmin, 18px);
}

.lobby-welcome-icon {
  width: clamp(46px, 7dvh, 72px);
  height: clamp(46px, 7dvh, 72px);
  font-size: clamp(28px, 4.8dvh, 42px);
}

.lobby-welcome strong {
  font-size: clamp(14px, 1.3vw, 20px);
}

.lobby-welcome small {
  font-size: clamp(11px, 1vw, 13px);
}

.lobby-brand {
  display: grid;
  align-content: center;
  padding-top: 0;
}

.lobby-crown {
  font-size: clamp(16px, 3dvh, 24px);
}

.lobby-title {
  font-size: clamp(34px, min(5vw, 8dvh), 72px);
  line-height: 0.92;
  letter-spacing: clamp(0.04em, 1vw, 0.14em);
  word-break: normal;
  overflow-wrap: normal;
}

.lobby-subtitle {
  margin-top: clamp(5px, 1dvh, 10px);
  font-size: clamp(11px, min(1.15vw, 1.8dvh), 16px);
  letter-spacing: clamp(0.05em, 0.75vw, 0.13em);
}

.lobby-nav {
  max-width: none;
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.1vmin, 12px);
}

.lobby-nav-button {
  min-height: clamp(64px, 10dvh, 98px);
  padding: clamp(8px, 1.2vmin, 12px);
}

.lobby-nav-button span {
  font-size: clamp(24px, 4.8dvh, 38px);
}

.lobby-nav-button strong {
  font-size: clamp(10px, 1.1vw, 12px);
}

/* Р¦РµРЅС‚СЂР°Р»СЊРЅС‹Р№ СЂСЏРґ Р·Р°РЅРёРјР°РµС‚ РІСЃС‘ РѕСЃС‚Р°РІС€РµРµСЃСЏ РїСЂРѕСЃС‚СЂР°РЅСЃС‚РІРѕ */
.lobby-content {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns:
    minmax(260px, 0.82fr)
    minmax(330px, 1.12fr)
    minmax(280px, 0.94fr);
  gap: clamp(10px, 1.6vmin, 22px);
  align-items: stretch;
}

.lobby-panel {
  min-height: 0;
  padding: clamp(12px, 1.6vmin, 22px);
  overflow: auto;
  scrollbar-width: thin;
}

.lobby-panel-blue {
  padding-left: clamp(58px, 5vw, 76px);
}

.lobby-panel-heading {
  gap: clamp(8px, 1.2vmin, 14px);
  margin-bottom: clamp(8px, 1.4dvh, 18px);
}

.lobby-panel-icon {
  font-size: clamp(28px, 5dvh, 42px);
}

.lobby-panel h2,
.lobby-panel h3 {
  font-size: clamp(15px, min(1.5vw, 2.6dvh), 22px);
}

.lobby-panel p {
  font-size: clamp(11px, min(1vw, 1.8dvh), 14px);
}

/* Р’РёРґРµРѕ Рё РґРµРєРѕСЂР°С‚РёРІРЅС‹Рµ Р±Р»РѕРєРё С‚РµРїРµСЂСЊ СЃС‡РёС‚Р°СЋС‚ РІС‹СЃРѕС‚Сѓ РѕС‚ СЌРєСЂР°РЅР° */
.lobby-video-board {
  min-height: 0;
  height: clamp(130px, 28dvh, 300px);
}

.play-core {
  width: clamp(52px, 10dvh, 82px);
  height: clamp(52px, 10dvh, 82px);
  font-size: clamp(24px, 4.8dvh, 38px);
}

.lobby-video-meta {
  min-height: clamp(28px, 5dvh, 38px);
}

.lobby-feature-grid {
  gap: clamp(6px, 1.2vmin, 14px);
  font-size: clamp(11px, min(1.1vw, 1.8dvh), 14px);
}

.lobby-thumbs {
  gap: clamp(6px, 1vmin, 9px);
  margin-top: clamp(8px, 1.4dvh, 18px);
}

.lobby-thumbs span {
  height: clamp(28px, 6dvh, 56px);
}

.lobby-guest-card {
  padding: clamp(9px, 1.3vmin, 14px);
  margin-bottom: clamp(8px, 1.5dvh, 16px);
}

.lobby-factions {
  gap: clamp(6px, 1vmin, 10px);
  margin-bottom: clamp(10px, 2dvh, 22px);
}

.lobby-factions span {
  min-height: clamp(52px, 10dvh, 82px);
  padding: clamp(7px, 1.2vmin, 12px);
}

.lobby-big-cta,
.lobby-apply {
  min-height: clamp(38px, 6dvh, 50px);
  font-size: clamp(11px, 1vw, 13px);
}

.lobby-settings-layout {
  grid-template-columns: minmax(88px, 120px) minmax(0, 1fr);
  gap: clamp(10px, 1.4vmin, 18px);
}

.lobby-settings-list {
  gap: clamp(7px, 1.3dvh, 12px);
}

.lobby-settings-list label {
  padding-bottom: clamp(6px, 1.2dvh, 10px);
}

.lobby-settings-list strong {
  padding: clamp(6px, 1dvh, 8px) 10px;
}

/* Р¤СѓС‚РµСЂ С‚РѕР¶Рµ РЅРµ РґРѕР»Р¶РµРЅ СЂР°Р·РґСѓРІР°С‚СЊ РІС‹СЃРѕС‚Сѓ */
.lobby-footer {
  min-height: 0;
  padding: clamp(8px, 1.4vmin, 14px) clamp(10px, 1.5vmin, 18px);
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr)) minmax(180px, 1.25fr);
  gap: clamp(8px, 1.2vmin, 14px);
  font-size: clamp(11px, 1vw, 14px);
}

/* РќР° С€РёСЂРёРЅРµ 980вЂ“1240 РќР• СЃРєР»Р°РґС‹РІР°РµРј РІСЃС‘ РІ РєРѕР»РѕРЅРєСѓ.
   Р­С‚Рѕ РІР°Р¶РЅРѕ РґР»СЏ height-first: Р»СѓС‡С€Рµ СѓР¶Р°С‚СЊ РєРѕР»РѕРЅРєРё, С‡РµРј СЂР°СЃС‚СЏРЅСѓС‚СЊ СЃС‚СЂР°РЅРёС†Сѓ РІРЅРёР·. */
@media (max-width: 1240px) and (min-width: 980px) {
  .lobby-header {
    grid-template-columns:
      minmax(210px, 0.65fr)
      minmax(270px, 1fr)
      minmax(250px, 0.75fr);
  }

  .lobby-content {
    grid-template-columns:
      minmax(230px, 0.8fr)
      minmax(290px, 1.1fr)
      minmax(230px, 0.9fr);
  }

  .lobby-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: none;
  }

  .lobby-side-tabs {
    display: grid;
  }

  .lobby-footer {
    grid-template-columns: repeat(4, minmax(80px, 1fr)) minmax(160px, 1.25fr);
  }
}

/* РќРёР·РєРёР№ СЌРєСЂР°РЅ: РїСЂСЏС‡РµРј РІС‚РѕСЂРѕСЃС‚РµРїРµРЅРЅСѓСЋ РґРµРєРѕСЂР°С‚РёРІРєСѓ */
@media (max-height: 840px) and (min-width: 980px) {
  .lobby-welcome small,
  .lobby-panel-heading p,
  .lobby-panel-note {
    display: none;
  }

  .lobby-video-board {
    height: clamp(110px, 25dvh, 220px);
  }

  .lobby-thumbs span {
    height: clamp(22px, 5dvh, 42px);
  }

  .lobby-panel h3 {
    margin-top: 10px;
  }

  .lobby-factions span {
    min-height: clamp(44px, 8dvh, 64px);
  }
}

@media (max-height: 700px) and (min-width: 980px) {
  .lobby-crown,
  .lobby-thumbs,
  .lobby-settings-tabs {
    display: none;
  }

  .lobby-title {
    font-size: clamp(32px, min(4.4vw, 7dvh), 58px);
  }

  .lobby-welcome {
    min-height: 66px;
  }

  .lobby-nav-button {
    min-height: 58px;
  }

  .lobby-nav-button span {
    font-size: 24px;
  }

  .lobby-video-board {
    height: clamp(92px, 23dvh, 160px);
  }

  .lobby-footer {
    padding-top: 7px;
    padding-bottom: 7px;
  }
}

/* РЈР·РєРёРµ СЌРєСЂР°РЅС‹: Р·РґРµСЃСЊ РєРѕР»РѕРЅРєРё РЅРµРёР·Р±РµР¶РЅРѕ СЃРєР»Р°РґС‹РІР°СЋС‚СЃСЏ,
   РїРѕСЌС‚РѕРјСѓ СЂР°Р·СЂРµС€Р°РµРј РїСЂРѕРєСЂСѓС‚РєСѓ РІСЃРµРіРѕ Р»РѕР±Р±Рё */
@media (max-width: 979px) {
  body {
    overflow: auto;
  }

  .lobby-screen {
    height: 100dvh;
    overflow: auto;
  }

  .lobby-shell {
    height: auto;
    min-height: calc(100dvh - 20px);
  }

  .lobby-panel {
    overflow: visible;
  }
}

/* ---------- РР“Р Рђ: РґРѕСЃРєР° РїРѕРґ РІС‹СЃРѕС‚Сѓ, РїР°РЅРµР»СЊ СЃРєСЂРѕР»Р»РёС‚СЃСЏ РІРЅСѓС‚СЂРё ---------- */

.game-shell {
  width: 100dvw;
  max-width: none;
  height: 100dvh;
  min-height: 0;
  padding: clamp(8px, 1.5vmin, 16px);
  overflow: hidden;
}

.game-layout {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(280px, 22vw, 340px);
  gap: clamp(8px, 1.5vmin, 16px);
  align-items: stretch;
}

.board-area {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.topbar {
  margin-bottom: clamp(6px, 1.2vmin, 12px);
  display: grid;
  justify-items: start;
  align-items: start;
  gap: clamp(10px, 1.7vmin, 16px);
}

.topbar > div:first-child {
  display: grid;
  justify-items: start;
  gap: clamp(10px, 1.6vmin, 16px);
}

.topbar h1,
.sandbox-title {
  font-size: clamp(30px, min(4.1vw, 5.6dvh), 54px);
  line-height: 0.94;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #f6f0e7;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.34);
}

.sandbox-title span {
  color: #dca74a;
}

.sandbox-hero-copy {
  display: none !important;
  visibility: hidden !important;
  min-height: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.status-line {
  display: none !important;
  visibility: hidden !important;
  min-height: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

.turn-badge {
  width: fit-content;
  min-width: 180px;
  max-width: 220px;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: clamp(10px, 1.5vmin, 14px);
  align-items: center;
  align-self: flex-start;
  justify-self: start;
  flex: 0 0 auto;
  padding: 14px 18px;
  text-align: left;
  border-color: rgba(225, 164, 49, 0.78);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(41, 31, 18, 0.94), rgba(14, 13, 10, 0.9));
  box-shadow: 0 0 26px rgba(225, 164, 49, 0.24), inset 0 0 0 1px rgba(255, 219, 142, 0.08);
}

.turn-badge::before {
  content: "в™›";
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: clamp(34px, 4vmin, 46px);
  height: clamp(34px, 4vmin, 46px);
  border-radius: 999px;
  color: #dca74a;
  font-size: clamp(23px, 3vmin, 34px);
  background: rgba(225, 164, 49, 0.12);
  box-shadow: inset 0 0 0 1px rgba(225, 164, 49, 0.22);
}

.turn-label {
  color: rgba(248, 239, 218, 0.7);
  font-weight: 900;
  letter-spacing: 0.05em;
}

#turn-name {
  margin-top: 0;
  font-size: clamp(20px, min(2vw, 3.3dvh), 28px);
  text-transform: uppercase;
  color: #fff7e9;
}

.board-back-row {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 9999;
  padding: 0;
}

/* Р”РѕСЃРєР° С‚РµРїРµСЂСЊ СЃС‡РёС‚Р°РµС‚СЃСЏ РѕС‚ 100dvh.
   Р’С‹СЃРѕС‚Р° РІР°Р¶РЅРµРµ: РґРѕСЃРєР° РЅРµ РґРѕР»Р¶РЅР° РІС‹Р»РµР·Р°С‚СЊ РІРЅРёР·. */
#board {
  align-self: center;
  justify-self: center;
  width: min(100%, calc((100dvh - clamp(82px, 13dvh, 132px)) / 0.88));
  max-width: none;
}

.side-panel {
  height: 100%;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
}

.panel-section {
  padding: clamp(9px, 1.4vmin, 14px);
}

/* РќРёР·РєРёР№ СЌРєСЂР°РЅ РІ РёРіСЂРµ: РµС‰С‘ СЃРёР»СЊРЅРµРµ СѓР¶РёРјР°РµРј РІРµСЂС… Рё РїР°РЅРµР»СЊ */
@media (max-height: 760px) and (min-width: 1041px) {
  .game-shell {
    padding: 8px;
  }

  .topbar h1 {
    font-size: 26px;
  }

  .status-line {
    font-size: 12px;
  }

  .turn-badge {
    padding: 6px 8px;
  }

  #board {
    width: min(92%, calc((100dvh - 166px) / 0.88));
  }

  .panel-title {
    margin-bottom: 6px;
  }

  .panel-section {
    padding: 9px;
  }
}

/* РљРѕРіРґР° С€РёСЂРёРЅС‹ СѓР¶Рµ РјР°Р»Рѕ, Р±РѕРєРѕРІР°СЏ РїР°РЅРµР»СЊ СѓС…РѕРґРёС‚ РІРЅРёР·.
   РќР° С‚Р°РєРёС… СЌРєСЂР°РЅР°С… СЂР°Р·СЂРµС€Р°РµРј РѕР±С‰РёР№ СЃРєСЂРѕР»Р», РЅРѕ РґРѕСЃРєР° РІСЃС‘ СЂР°РІРЅРѕ СЃС‡РёС‚Р°РµС‚СЃСЏ РѕС‚ РІС‹СЃРѕС‚С‹. */
@media (max-width: 1040px) {
  body {
    overflow: auto;
  }

  .game-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .game-layout {
    height: auto;
    min-height: 100dvh;
    grid-template-columns: 1fr;
  }

  #board {
    width: min(94%, calc((100dvh - 190px) / 0.88));
  }

  .side-panel {
    height: auto;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 700px) {
  #board {
    width: min(94%, calc((100dvh - 204px) / 0.88));
  }

}

      .topbar {
        display: grid;
        grid-template-columns: 1fr;
      }

      .turn-badge {
        text-align: left;
      }
    }
/* =========================================================
   LOBBY SCROLL FIX
   РџРѕРєР° РѕС‚РєСЂС‹С‚Рѕ Р»РѕР±Р±Рё, СЃРєСЂРѕР»Р»РёС‚СЃСЏ С‚РѕР»СЊРєРѕ Р»РѕР±Р±Рё, РЅРµ body.
   РЈР±РёСЂР°РµС‚ РґРІРѕР№РЅРѕР№ СЃРєСЂРѕР»Р» СЃРїСЂР°РІР°.
   ========================================================= */

body.is-lobby-open {
  width: 100%;
  height: 100dvh;
  overflow: hidden !important;
}

body.is-lobby-open .lobby-screen {
  width: 100dvw;
  height: 100dvh;
  min-height: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body.is-lobby-open .lobby-shell {
  min-height: calc(100dvh - clamp(16px, 3vmin, 36px));
}

/* РќР° С€РёСЂРѕРєРёС… СЌРєСЂР°РЅР°С… РїС‹С‚Р°РµРјСЃСЏ РґРµСЂР¶Р°С‚СЊ РІРµСЃСЊ РёРЅС‚РµСЂС„РµР№СЃ РІ РѕРґРЅРѕРј СЌРєСЂР°РЅРµ */
@media (min-width: 980px) {
  body.is-lobby-open .lobby-screen {
    overflow-y: hidden !important;
  }

  body.is-lobby-open .lobby-shell {
    height: calc(100dvh - clamp(16px, 3vmin, 36px));
  }

  body.is-lobby-open .lobby-panel {
    overflow: auto;
  }
}

/* РќР° СѓР·РєРёС… СЌРєСЂР°РЅР°С… РѕСЃС‚Р°РІР»СЏРµРј РѕРґРёРЅ СЃРєСЂРѕР»Р»: С‚РѕР»СЊРєРѕ Сѓ Р»РѕР±Р±Рё */
@media (max-width: 979px) {
  body.is-lobby-open {
    overflow: hidden !important;
  }

  body.is-lobby-open .lobby-screen {
    overflow-y: auto !important;
  }

  body.is-lobby-open .lobby-panel {
    overflow: visible;
  }
}

/* =========================================================
   LOBBY PANELS SCALE PATCH
   РўСЂРё РјРёРЅРёР±Р»РѕРєР° Р»РѕР±Р±Рё РґРѕР»Р¶РЅС‹ РјРµРЅСЏС‚СЊ СЂР°Р·РјРµСЂ, Р° РЅРµ РїРѕР»СѓС‡Р°С‚СЊ
   РІРЅСѓС‚СЂРµРЅРЅРёРµ СЃРµСЂС‹Рµ СЃРєСЂРѕР»Р»С‹.
   ========================================================= */

/* РћР±С‰РёР№ РєСЂР°СЃРёРІС‹Р№ СЃРєСЂРѕР»Р» РЅР° СЃР»СѓС‡Р°Р№, РµСЃР»Рё РѕРЅ РІСЃС‘-С‚Р°РєРё РїРѕСЏРІРёС‚СЃСЏ */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(242, 201, 109, 0.72) rgba(5, 9, 12, 0.64);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background:
    linear-gradient(180deg, rgba(5, 9, 12, 0.78), rgba(14, 18, 20, 0.72));
  border: 1px solid rgba(242, 201, 109, 0.1);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  min-height: 42px;
  border: 2px solid rgba(5, 9, 12, 0.92);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(246, 197, 107, 0.92), rgba(145, 244, 255, 0.6));
  box-shadow:
    0 0 10px rgba(242, 201, 109, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

*::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, rgba(255, 220, 145, 0.98), rgba(155, 92, 255, 0.72));
  box-shadow:
    0 0 14px rgba(242, 201, 109, 0.42),
    0 0 10px rgba(155, 92, 255, 0.28);
}

/* РќР° РґРµСЃРєС‚РѕРїРµ Р»РѕР±Р±Рё РґРѕР»Р¶РЅРѕ Р¶РёС‚СЊ РІ РѕРґРЅРѕРј СЌРєСЂР°РЅРµ */
@media (min-width: 980px) {
  body.is-lobby-open {
    overflow: hidden !important;
  }

  body.is-lobby-open .lobby-screen {
    overflow: hidden !important;
  }

  body.is-lobby-open .lobby-shell {
    height: calc(100dvh - clamp(16px, 3vmin, 36px));
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  body.is-lobby-open .lobby-content {
    min-height: 0;
    height: 100%;
    align-items: stretch;
  }

  body.is-lobby-open .lobby-panel {
    min-height: 0;
    overflow: hidden !important;
    display: grid;
    align-content: stretch;
  }

  body.is-lobby-open .lobby-panel-blue {
    grid-template-rows: minmax(0, 1fr);
  }

  body.is-lobby-open .lobby-panel-body {
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, auto) auto auto;
    align-content: space-between;
    gap: clamp(7px, 1.2vmin, 14px);
  }

  body.is-lobby-open .lobby-panel-purple {
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
    gap: clamp(6px, 1vmin, 12px);
  }

  body.is-lobby-open .lobby-panel-green {
    grid-template-rows: auto minmax(0, 1fr);
  }

  body.is-lobby-open .lobby-settings-layout {
    min-height: 0;
    height: 100%;
    align-content: start;
  }

  body.is-lobby-open .lobby-settings-list {
    min-height: 0;
    align-content: start;
  }

  body.is-lobby-open .lobby-panel-heading {
    margin-bottom: clamp(6px, 1.1vmin, 14px);
  }

  body.is-lobby-open .lobby-panel-icon {
    font-size: clamp(26px, 4.4dvh, 42px);
  }

  body.is-lobby-open .lobby-panel h2 {
    font-size: clamp(16px, min(1.45vw, 2.55dvh), 24px);
  }

  body.is-lobby-open .lobby-panel h3 {
    margin-top: clamp(4px, 1dvh, 12px);
    font-size: clamp(13px, min(1.2vw, 2.1dvh), 17px);
  }

  body.is-lobby-open .lobby-panel p {
    font-size: clamp(10px, min(1vw, 1.75dvh), 14px);
    line-height: 1.25;
  }

  body.is-lobby-open .lobby-guest-card {
    margin-bottom: 0;
    padding: clamp(8px, 1.2vmin, 14px);
  }

  body.is-lobby-open .lobby-guest-card strong {
    font-size: clamp(14px, min(1.3vw, 2.2dvh), 18px);
  }

  body.is-lobby-open .lobby-factions {
    margin-bottom: 0;
    gap: clamp(6px, 1vmin, 10px);
  }

  body.is-lobby-open .lobby-factions span {
    min-height: clamp(42px, 9dvh, 82px);
    padding: clamp(6px, 1vmin, 12px);
    font-size: clamp(10px, min(1vw, 1.65dvh), 12px);
  }

  body.is-lobby-open .lobby-big-cta,
  body.is-lobby-open .lobby-apply {
    min-height: clamp(36px, 5.5dvh, 50px);
    font-size: clamp(10px, min(1vw, 1.7dvh), 13px);
    letter-spacing: clamp(0.04em, 0.7vw, 0.12em);
  }

  body.is-lobby-open .lobby-video-card {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  body.is-lobby-open .lobby-video-board {
    min-height: 0;
    height: auto;
  }

  body.is-lobby-open .play-core {
    width: clamp(46px, 9dvh, 82px);
    height: clamp(46px, 9dvh, 82px);
    font-size: clamp(22px, 4.6dvh, 38px);
  }

  body.is-lobby-open .lobby-video-meta {
    min-height: clamp(24px, 4.5dvh, 38px);
    font-size: clamp(10px, min(1vw, 1.6dvh), 12px);
  }

  body.is-lobby-open .lobby-feature-grid {
    margin-top: clamp(4px, 1dvh, 12px);
    gap: clamp(4px, 0.8vmin, 12px) clamp(8px, 1.2vmin, 18px);
    font-size: clamp(10px, min(1vw, 1.7dvh), 14px);
  }

  body.is-lobby-open .lobby-thumbs {
    margin-top: clamp(4px, 1dvh, 12px);
    gap: clamp(4px, 0.8vmin, 9px);
  }

  body.is-lobby-open .lobby-thumbs span {
    height: clamp(18px, 4.6dvh, 52px);
  }

  body.is-lobby-open .lobby-settings-tabs {
    gap: clamp(4px, 0.8dvh, 10px);
  }

  body.is-lobby-open .lobby-settings-tabs span {
    padding: clamp(6px, 1dvh, 11px) clamp(8px, 1vmin, 12px);
    font-size: clamp(10px, min(1vw, 1.6dvh), 12px);
  }

  body.is-lobby-open .lobby-settings-list {
    gap: clamp(5px, 1dvh, 12px);
  }

  body.is-lobby-open .lobby-settings-list label {
    padding-bottom: clamp(5px, 1dvh, 10px);
    font-size: clamp(11px, min(1vw, 1.8dvh), 14px);
  }

  body.is-lobby-open .lobby-settings-list strong {
    min-width: clamp(70px, 7vw, 92px);
    padding: clamp(5px, 0.9dvh, 8px) 10px;
  }
}

/* РЎСЂРµРґРЅСЏСЏ РІС‹СЃРѕС‚Р°: РїСЂСЏС‡РµРј С‚РѕР»СЊРєРѕ РґРµРєРѕСЂР°С‚РёРІРЅС‹Рµ РґРµС‚Р°Р»Рё, РЅРµ РѕСЃРЅРѕРІРЅРѕР№ СЃРјС‹СЃР» */
@media (min-width: 980px) and (max-height: 820px) {
  body.is-lobby-open .lobby-welcome small,
  body.is-lobby-open .lobby-panel-heading p,
  body.is-lobby-open .lobby-panel-note {
    display: none;
  }

  body.is-lobby-open .lobby-thumbs span {
    height: clamp(16px, 4dvh, 34px);
  }

  body.is-lobby-open .lobby-feature-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* РќРёР·РєРёР№ СЌРєСЂР°РЅ: СѓР±РёСЂР°РµРј РІС‚РѕСЂСѓСЋ РґРµРєРѕСЂР°С‚РёРІРЅСѓСЋ Р»РёРЅРёСЋ, С‡С‚РѕР±С‹ РЅРµ Р±С‹Р»Рѕ СЃРєСЂРѕР»Р»Р° */
@media (min-width: 980px) and (max-height: 700px) {
  body.is-lobby-open .lobby-crown,
  body.is-lobby-open .lobby-thumbs,
  body.is-lobby-open .lobby-settings-tabs,
  body.is-lobby-open .lobby-panel h3 {
    display: none;
  }

  body.is-lobby-open .lobby-title {
    font-size: clamp(30px, min(4.2vw, 6.8dvh), 56px);
    letter-spacing: clamp(0.03em, 0.75vw, 0.1em);
  }

  body.is-lobby-open .lobby-subtitle {
    font-size: clamp(10px, min(1vw, 1.6dvh), 13px);
  }

  body.is-lobby-open .lobby-welcome {
    min-height: 62px;
  }

  body.is-lobby-open .lobby-nav-button {
    min-height: 56px;
  }

  body.is-lobby-open .lobby-nav-button span {
    font-size: 24px;
  }

  body.is-lobby-open .lobby-panel {
    padding: clamp(9px, 1.2vmin, 14px);
  }

  body.is-lobby-open .lobby-video-card {
    min-height: 0;
  }

  body.is-lobby-open .lobby-feature-grid {
    font-size: 10px;
  }

  body.is-lobby-open .lobby-footer {
    min-height: 0;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 11px;
  }
}

/* РћС‡РµРЅСЊ РЅРёР·РєРёР№ СЌРєСЂР°РЅ: Р»СѓС‡С€Рµ РѕРґРёРЅ РѕР±С‰РёР№ РєСЂР°СЃРёРІС‹Р№ СЃРєСЂРѕР»Р»,
   С‡РµРј С‚СЂРё РјР°Р»РµРЅСЊРєРёС… СЃРєСЂРѕР»Р»Р° РІРЅСѓС‚СЂРё РєР°СЂС‚РѕС‡РµРє */
@media (min-width: 980px) and (max-height: 560px) {
  body.is-lobby-open .lobby-screen {
    overflow-y: auto !important;
  }

  body.is-lobby-open .lobby-shell {
    height: auto;
    min-height: calc(100dvh - clamp(16px, 3vmin, 36px));
  }

  body.is-lobby-open .lobby-panel {
    overflow: hidden !important;
  }
}

/* =========================================================
   COMPACT HARMONY PATCH
   Р”РµР»Р°РµРј Р»РѕР±Р±Рё РєРѕРјРїР°РєС‚РЅРµРµ, СЃРїРѕРєРѕР№РЅРµРµ Рё РіР°СЂРјРѕРЅРёС‡РЅРµРµ.
   ========================================================= */

@media (min-width: 980px) {
  /* РћР±С‰Р°СЏ СЃС†РµРЅР° */
  body.is-lobby-open .lobby-screen {
    padding: 12px 16px;
  }

  body.is-lobby-open .lobby-shell {
    width: min(1600px, 100%);
    height: calc(100dvh - 24px);
    gap: 12px;
  }

  /* ---------- РЁРђРџРљРђ ---------- */

  body.is-lobby-open .lobby-header {
    grid-template-columns:
      minmax(250px, 0.82fr)
      minmax(320px, 1fr)
      minmax(360px, 0.9fr);
    gap: 14px;
    align-items: center;
  }

  body.is-lobby-open .lobby-welcome,
  body.is-lobby-open .lobby-nav-button,
  body.is-lobby-open .lobby-footer {
    border-radius: 12px;
  }

  body.is-lobby-open .lobby-welcome {
    min-height: 96px;
    padding: 14px 18px;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 14px;
  }

  body.is-lobby-open .lobby-welcome-icon {
    width: 58px;
    height: 58px;
    font-size: 30px;
  }

  body.is-lobby-open .lobby-welcome strong {
    font-size: clamp(14px, 1.15vw, 18px);
    line-height: 1.14;
    letter-spacing: 0.03em;
  }

  body.is-lobby-open .lobby-welcome small {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.25;
    color: #bdb5aa;
  }

  body.is-lobby-open .lobby-brand {
    padding-top: 0;
    align-self: center;
  }

  body.is-lobby-open .lobby-crown {
    font-size: 18px;
    margin-bottom: 2px;
  }

  body.is-lobby-open .lobby-title {
    font-size: clamp(30px, 4vw, 58px);
    line-height: 0.9;
    letter-spacing: clamp(0.03em, 0.6vw, 0.08em);
    text-shadow:
      0 0 18px rgba(242, 201, 109, 0.2),
      0 3px 0 rgba(0, 0, 0, 0.34);
  }

  body.is-lobby-open .lobby-subtitle {
    margin-top: 6px;
    font-size: clamp(11px, 0.95vw, 15px);
    line-height: 1.14;
    letter-spacing: clamp(0.05em, 0.3vw, 0.09em);
    color: #d0c7bc;
  }

  body.is-lobby-open .lobby-nav {
    gap: 10px;
  }

  body.is-lobby-open .lobby-nav-button {
    min-height: 88px;
    padding: 10px 8px;
    gap: 4px;
  }

  body.is-lobby-open .lobby-nav-button span {
    font-size: 28px;
  }

  body.is-lobby-open .lobby-nav-button strong {
    font-size: 11px;
    letter-spacing: 0.03em;
  }

  /* ---------- Р¦Р•РќРўР РђР›Р¬РќР«Р• РљРђР РўРћР§РљР ---------- */

  body.is-lobby-open .lobby-content {
    grid-template-columns:
      minmax(290px, 0.95fr)
      minmax(340px, 0.93fr)
      minmax(350px, 1.08fr);
    gap: 16px;
  }

  body.is-lobby-open .lobby-panel {
    border-radius: 14px;
    padding: 16px 18px;
  }

  body.is-lobby-open .lobby-panel-blue {
    padding-left: 18px;
  }

  body.is-lobby-open .lobby-side-tabs {
    display: none;
  }

  body.is-lobby-open .lobby-panel-heading {
    gap: 10px;
    margin-bottom: 10px;
    align-items: start;
  }

  body.is-lobby-open .lobby-panel-icon {
    font-size: 30px;
  }

  body.is-lobby-open .lobby-panel h2 {
    font-size: clamp(16px, 1.3vw, 22px);
    line-height: 1.05;
    letter-spacing: 0.03em;
  }

  body.is-lobby-open .lobby-panel h3 {
    margin-top: 10px;
    font-size: 14px;
    letter-spacing: 0.02em;
  }

  body.is-lobby-open .lobby-panel p {
    margin-top: 3px;
    font-size: clamp(11px, 0.95vw, 14px);
    line-height: 1.24;
    color: #c7beb3;
  }

  /* Р›РµРІР°СЏ РєР°СЂС‚РѕС‡РєР° */
  body.is-lobby-open .lobby-guest-card {
    padding: 10px 12px;
    gap: 5px;
    margin-bottom: 12px;
    border-radius: 8px;
  }

  body.is-lobby-open .lobby-guest-card span,
  body.is-lobby-open .lobby-panel-note {
    font-size: 10px;
    letter-spacing: 0.06em;
  }

  body.is-lobby-open .lobby-guest-card strong {
    font-size: 15px;
  }

  body.is-lobby-open .lobby-factions {
    gap: 8px;
    margin-bottom: 14px;
  }

  body.is-lobby-open .lobby-factions span {
    min-height: 74px;
    padding: 10px 8px;
    font-size: 11px;
    border-radius: 8px;
  }

  body.is-lobby-open .lobby-big-cta {
    min-height: 44px;
    font-size: 11px;
    letter-spacing: 0.08em;
    border-radius: 8px;
  }

  /* Р¦РµРЅС‚СЂР°Р»СЊРЅР°СЏ РєР°СЂС‚РѕС‡РєР° */
  body.is-lobby-open .lobby-video-board {
    height: clamp(140px, 22dvh, 210px);
  }

  body.is-lobby-open .play-core {
    width: 62px;
    height: 62px;
    font-size: 28px;
  }

  body.is-lobby-open .lobby-video-meta {
    min-height: 30px;
    font-size: 11px;
    padding: 0 10px;
  }

  body.is-lobby-open .lobby-feature-grid {
    margin-top: 10px;
    gap: 6px 14px;
    font-size: 11px;
    line-height: 1.18;
  }

  body.is-lobby-open .lobby-thumbs {
    margin-top: 12px;
    gap: 8px;
  }

  body.is-lobby-open .lobby-thumbs span {
    height: 32px;
    border-radius: 6px;
  }

  /* РџСЂР°РІР°СЏ РєР°СЂС‚РѕС‡РєР° */
  body.is-lobby-open .lobby-settings-layout {
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 14px;
  }

  body.is-lobby-open .lobby-settings-tabs {
    gap: 6px;
  }

  body.is-lobby-open .lobby-settings-tabs span {
    padding: 8px 10px;
    font-size: 11px;
    border-radius: 6px;
  }

  body.is-lobby-open .lobby-settings-list {
    gap: 8px;
  }

  body.is-lobby-open .lobby-settings-list label {
    gap: 10px;
    padding-bottom: 8px;
    font-size: 12px;
  }

  body.is-lobby-open .lobby-settings-list strong {
    min-width: 78px;
    padding: 6px 9px;
    font-size: 11px;
    border-radius: 6px;
  }

  body.is-lobby-open .lobby-apply {
    min-height: 46px;
    margin-top: 8px;
    font-size: 11px;
    letter-spacing: 0.08em;
    border-radius: 8px;
  }

  /* ---------- Р¤РЈРўР•Р  ---------- */

  body.is-lobby-open .lobby-footer {
    min-height: 62px;
    padding: 10px 18px;
    grid-template-columns: repeat(4, minmax(100px, 1fr)) minmax(220px, 1.25fr);
    gap: 12px;
    font-size: 11px;
  }

  body.is-lobby-open .lobby-footer strong {
    font-size: 11px;
  }

  body.is-lobby-open .lobby-footer em {
    font-size: 11px;
    text-align: right;
  }
}

/* ---------- РќРР–Р• Р’Р«РЎРћРўРђ вЂ” Р•Р©РЃ РљРћРњРџРђРљРўРќР•Р• ---------- */

@media (min-width: 980px) and (max-height: 860px) {
  body.is-lobby-open .lobby-shell {
    gap: 10px;
  }

  body.is-lobby-open .lobby-welcome {
    min-height: 84px;
    padding: 12px 16px;
  }

  body.is-lobby-open .lobby-title {
    font-size: clamp(28px, 3.6vw, 50px);
  }

  body.is-lobby-open .lobby-subtitle {
    font-size: 12px;
  }

  body.is-lobby-open .lobby-nav-button {
    min-height: 78px;
  }

  body.is-lobby-open .lobby-panel {
    padding: 14px 16px;
  }

  body.is-lobby-open .lobby-video-board {
    height: clamp(120px, 20dvh, 180px);
  }

  body.is-lobby-open .lobby-factions span {
    min-height: 62px;
  }

  body.is-lobby-open .lobby-footer {
    min-height: 56px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

/* ---------- РЎР Р•Р”РќРР• Р”Р•РЎРљРўРћРџР« ---------- */

@media (min-width: 980px) and (max-width: 1320px) {
  body.is-lobby-open .lobby-header {
    grid-template-columns:
      minmax(220px, 0.78fr)
      minmax(280px, 1fr)
      minmax(300px, 0.9fr);
  }

  body.is-lobby-open .lobby-content {
    grid-template-columns:
      minmax(250px, 1fr)
      minmax(290px, 1fr)
      minmax(300px, 1fr);
  }

  body.is-lobby-open .lobby-title {
    font-size: clamp(28px, 3.3vw, 48px);
  }

  body.is-lobby-open .lobby-subtitle {
    font-size: 11px;
  }

  body.is-lobby-open .lobby-panel h2 {
    font-size: 18px;
  }
}

/* =========================================================
   Guest Lobby Final Skin
   Main first-entry screen. Game layout and rules stay untouched.
   ========================================================= */

body.is-lobby-open {
  width: 100%;
  height: 100dvh;
  overflow: hidden !important;
}

body.is-lobby-open .lobby-screen,
.lobby-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  width: 100dvw;
  height: 100dvh;
  min-height: 0;
  padding: clamp(16px, 2vw, 34px);
  color: #f2eee6;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background:
    radial-gradient(circle at 50% 18%, rgba(182, 96, 255, 0.28), transparent 18%),
    radial-gradient(circle at 25% 34%, rgba(28, 147, 255, 0.18), transparent 30%),
    radial-gradient(circle at 77% 42%, rgba(89, 221, 105, 0.14), transparent 30%),
    linear-gradient(180deg, #020811 0%, #061119 46%, #020505 100%);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.lobby-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.is-lobby-open .lobby-screen::before,
.lobby-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 35%, transparent 0 34%, rgba(0, 0, 0, 0.62) 100%);
  background-size: 72px 72px, 72px 72px, auto;
  opacity: 0.44;
}

body.is-lobby-open .lobby-bg-glow,
.lobby-bg-glow {
  position: fixed;
  left: 50%;
  top: 18%;
  width: min(1150px, 86vw);
  height: 360px;
  transform: translateX(-50%);
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(185, 79, 255, 0.66), transparent 13%),
    radial-gradient(circle at 27% 50%, rgba(0, 120, 255, 0.28), transparent 28%),
    radial-gradient(circle at 73% 52%, rgba(111, 235, 106, 0.2), transparent 30%);
  filter: blur(32px);
  opacity: 0.7;
}

body.is-lobby-open .lobby-shell,
.lobby-shell {
  position: relative;
  width: min(1710px, 100%);
  min-height: calc(100dvh - clamp(32px, 4vw, 68px));
  height: auto;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(22px, 2.6vw, 42px);
}

body.is-lobby-open .lobby-header,
.lobby-header {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(360px, 1fr) minmax(300px, 330px);
  gap: clamp(18px, 2vw, 30px);
  align-items: start;
}

body.is-lobby-open .lobby-welcome,
body.is-lobby-open .lobby-nav-button,
body.is-lobby-open .lobby-panel,
.lobby-welcome,
.lobby-nav-button,
.lobby-panel {
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: linear-gradient(180deg, rgba(16, 23, 31, 0.72), rgba(4, 8, 12, 0.9));
  box-shadow:
    0 22px 62px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(15px);
}

body.is-lobby-open .lobby-welcome,
.lobby-welcome {
  min-height: 96px;
  border-radius: 12px;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

body.is-lobby-open .lobby-welcome-icon,
.lobby-welcome-icon {
  width: 64px;
  height: 64px;
  border: 1px solid rgba(239, 196, 96, 0.58);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #f4c96f;
  font-size: 34px;
  text-shadow: 0 0 18px rgba(244, 201, 111, 0.46);
}

body.is-lobby-open .lobby-welcome strong,
.lobby-welcome strong {
  display: block;
  color: #f4d28c;
  font-size: clamp(17px, 1.25vw, 22px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

body.is-lobby-open .lobby-welcome small,
.lobby-welcome small {
  display: block;
  margin-top: 7px;
  color: #bfb8b0;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

body.is-lobby-open .lobby-brand,
.lobby-brand {
  min-width: 0;
  text-align: center;
  padding-top: 0;
  align-self: center;
}

body.is-lobby-open .lobby-crown,
.lobby-crown {
  display: block;
  color: #f5c565;
  font-size: 26px;
  line-height: 1;
  text-shadow: 0 0 16px rgba(245, 197, 101, 0.5);
}

body.is-lobby-open .lobby-title,
.lobby-title {
  max-width: 100%;
  margin: 12px 0 0;
  color: #f7f1e2;
  font-size: clamp(36px, 4.1vw, 68px);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: clamp(0.18em, 1.65vw, 0.34em);
  text-transform: uppercase;
  text-shadow:
    0 0 18px rgba(244, 201, 111, 0.28),
    0 0 36px rgba(255, 255, 255, 0.08);
  overflow-wrap: anywhere;
}

body.is-lobby-open .lobby-title::first-letter,
.lobby-title::first-letter {
  color: #f0c46e;
}

body.is-lobby-open .lobby-subtitle,
.lobby-subtitle {
  margin: 14px 0 0;
  color: #c9c2b8;
  font-size: clamp(12px, 1.1vw, 16px);
  line-height: 1.35;
  letter-spacing: clamp(0.14em, 0.95vw, 0.24em);
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

body.is-lobby-open .lobby-nav,
.lobby-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  width: min(330px, 100%);
  max-width: none;
  margin: 0;
  justify-self: end;
}

body.is-lobby-open .lobby-nav-button,
.lobby-nav-button {
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  border-radius: 10px;
  color: #d7d9d8;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 10px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

body.is-lobby-open .lobby-nav-button span,
.lobby-nav-button span {
  font-size: clamp(25px, 2.2vw, 36px);
  line-height: 1;
}

.lobby-nav-button:hover,
.lobby-nav-button:focus-visible,
.lobby-big-cta:hover,
.lobby-big-cta:focus-visible,
.lobby-guide-button:hover,
.lobby-guide-button:focus-visible,
.lobby-apply:hover,
.lobby-apply:focus-visible {
  transform: translateY(-2px);
  outline: none;
  border-color: rgba(155, 236, 255, 0.68);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(45, 191, 255, 0.2);
}

body.is-lobby-open .lobby-content,
.lobby-content {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(310px, 0.92fr) minmax(390px, 1.12fr) minmax(320px, 0.94fr);
  gap: clamp(20px, 2vw, 28px);
  align-items: stretch;
}

body.is-lobby-open .lobby-panel,
.lobby-panel {
  min-width: 0;
  min-height: 0;
  border-radius: 14px;
  padding: clamp(24px, 2.2vw, 32px);
  overflow: hidden !important;
  display: block;
}

body.is-lobby-open .lobby-panel-blue,
.lobby-panel-blue {
  border-color: rgba(48, 172, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(5, 35, 63, 0.8), rgba(2, 11, 20, 0.94)),
    radial-gradient(circle at 22% 12%, rgba(52, 180, 255, 0.18), transparent 36%);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.5), 0 0 28px rgba(48, 172, 255, 0.14);
}

body.is-lobby-open .lobby-panel-purple,
.lobby-panel-purple {
  border-color: rgba(171, 82, 255, 0.74);
  background:
    linear-gradient(180deg, rgba(25, 18, 58, 0.82), rgba(8, 7, 20, 0.94)),
    radial-gradient(circle at 50% 9%, rgba(181, 74, 255, 0.24), transparent 36%);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.5), 0 0 30px rgba(171, 82, 255, 0.18);
}

body.is-lobby-open .lobby-panel-green,
.lobby-panel-green {
  border-color: rgba(126, 224, 111, 0.68);
  background:
    linear-gradient(180deg, rgba(9, 44, 23, 0.8), rgba(3, 15, 8, 0.94)),
    radial-gradient(circle at 78% 10%, rgba(111, 235, 106, 0.17), transparent 36%);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.5), 0 0 28px rgba(126, 224, 111, 0.14);
}

body.is-lobby-open .lobby-panel-heading,
.lobby-panel-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 28px;
}

body.is-lobby-open .lobby-panel-icon,
.lobby-panel-icon {
  width: 66px;
  height: 66px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: #45bfff;
  display: grid;
  place-items: center;
  font-size: 32px;
  filter: drop-shadow(0 0 12px currentColor);
}

.lobby-panel-purple .lobby-panel-icon { color: #a865ff; }
.lobby-panel-green .lobby-panel-icon { color: #86df72; }

body.is-lobby-open .lobby-panel h2,
body.is-lobby-open .lobby-panel h3,
.lobby-panel h2,
.lobby-panel h3 {
  margin: 0;
  color: #ecf2f3;
  font-size: clamp(22px, 1.9vw, 30px);
  font-weight: 500;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

body.is-lobby-open .lobby-panel h3,
.lobby-panel h3 {
  margin-top: 26px;
  color: #b66dff;
  font-size: clamp(18px, 1.35vw, 22px);
}

body.is-lobby-open .lobby-panel p,
.lobby-panel p {
  margin: 7px 0 0;
  color: #c9c4bd;
  font-size: clamp(13px, 1vw, 15px);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

body.is-lobby-open .lobby-input-list,
.lobby-input-list {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

body.is-lobby-open .lobby-input-list div,
body.is-lobby-open .lobby-settings-list label,
.lobby-input-list div,
.lobby-settings-list label {
  min-width: 0;
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(4, 12, 18, 0.56);
  color: #c1c6c8;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  overflow-wrap: anywhere;
}

.lobby-input-list span {
  color: #ccd0d2;
  font-size: 20px;
}

body.is-lobby-open .lobby-section-label,
.lobby-section-label {
  margin: 0 0 12px;
  color: #eee9e0;
  font-size: 15px;
}

body.is-lobby-open .lobby-factions,
.lobby-factions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

body.is-lobby-open .lobby-factions span,
.lobby-factions span {
  min-width: 0;
  min-height: 136px;
  border: 1px solid currentColor;
  border-radius: 7px;
  display: grid;
  place-items: end center;
  padding: 18px 10px;
  background:
    radial-gradient(circle at 50% 38%, currentColor, transparent 28%),
    rgba(0, 0, 0, 0.2);
  font-size: clamp(14px, 1.1vw, 17px);
  overflow-wrap: anywhere;
}

.lobby-factions .blue { color: #2fb8ff; }
.lobby-factions .gold { color: #e9bf62; }
.lobby-factions .red { color: #ff554e; }

body.is-lobby-open .lobby-big-cta,
body.is-lobby-open .lobby-guide-button,
body.is-lobby-open .lobby-apply,
.lobby-big-cta,
.lobby-guide-button,
.lobby-apply {
  width: 100%;
  min-height: 68px;
  border: 1px solid rgba(48, 176, 255, 0.72);
  border-radius: 7px;
  color: #d6f0ff;
  background: linear-gradient(180deg, rgba(22, 98, 181, 0.88), rgba(7, 35, 76, 0.94));
  cursor: pointer;
  font-size: clamp(18px, 1.55vw, 24px);
  letter-spacing: 0.04em;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  overflow-wrap: anywhere;
}

body.is-lobby-open .lobby-login-line,
.lobby-login-line {
  text-align: center;
  margin-top: 24px !important;
}

.lobby-login-line span {
  color: #36baff;
}

body.is-lobby-open .lobby-video-card,
.lobby-video-card {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #030405;
  overflow: hidden;
}

.lobby-register-form {
  margin: 0;
}

.lobby-input-list label {
  min-width: 0;
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(5, 12, 18, 0.58);
  color: #bfc4c7;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
}

.lobby-input-list input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #f5efe6;
  font: inherit;
  outline: none;
}

.lobby-input-list input::placeholder {
  color: rgba(215, 220, 224, 0.7);
}

.lobby-factions label {
  position: relative;
  min-width: 0;
  min-height: 136px;
  cursor: pointer;
  color: inherit;
}

.lobby-factions label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

body.is-lobby-open .lobby-factions label span,
.lobby-factions label span {
  width: 100%;
  height: 100%;
}

.lobby-factions label:has(input:checked) span {
  background:
    radial-gradient(circle at 50% 38%, currentColor, transparent 31%),
    rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 2px currentColor, 0 0 24px color-mix(in srgb, currentColor 30%, transparent);
}

.lobby-factions label:has(input:focus-visible) span {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
}

.lobby-register-error {
  min-height: 22px;
  margin: -14px 0 14px;
  color: #f4d086;
  font-size: 14px;
  line-height: 1.35;
}

.lobby-login-line button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #36baff;
  font: inherit;
  cursor: pointer;
}

.lobby-welcome.is-mock-registered {
  border-color: rgba(126, 218, 111, 0.55);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.46), 0 0 22px rgba(126, 218, 111, 0.18);
}

.mock-register-modal[hidden] {
  display: none;
}

.mock-register-modal {
  position: fixed;
  inset: 0;
  z-index: 270;
  display: grid;
  place-items: center;
  padding: 20px;
}

.mock-register-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(7px);
}

.mock-register-modal__card {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  border: 1px solid rgba(126, 218, 111, 0.42);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(13, 28, 23, 0.98), rgba(6, 10, 13, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #f5efe6;
  padding: 24px;
}

.mock-register-modal__card h2 {
  margin: 0 0 12px;
  color: #bfeea7;
  font-size: 1.35rem;
}

.mock-register-modal__card p {
  margin: 0 0 12px;
  color: rgba(245, 239, 230, 0.82);
  line-height: 1.5;
}

.mock-register-modal__faction {
  color: #f4d086 !important;
}

.mock-register-modal__note {
  font-size: 0.94rem;
}

.mock-register-modal__continue {
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  border: 1px solid rgba(126, 218, 111, 0.62);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(67, 139, 75, 0.88), rgba(18, 66, 38, 0.94));
  color: #efffea;
  font: inherit;
  cursor: pointer;
}

:root[data-app-skin="imba-classic-light"] .lobby-input-list input,
:root[data-app-skin="imba-classic-light"] .mock-register-modal__card {
  color: var(--skin-page-text);
}

:root[data-app-skin="imba-classic-light"] .mock-register-modal__card {
  background: var(--skin-panel-bg-strong);
  border-color: var(--skin-panel-border);
  box-shadow: var(--skin-shadow-soft);
}

:root[data-app-skin="imba-classic-light"] .mock-register-modal__card p {
  color: var(--skin-muted);
}

body.is-lobby-open .lobby-video-board,
.lobby-video-board {
  min-height: clamp(250px, 23vw, 340px);
  height: auto;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 48%, rgba(176, 73, 255, 0.72), transparent 13%),
    linear-gradient(112deg, rgba(0, 98, 255, 0.54), transparent 38%),
    linear-gradient(248deg, rgba(255, 51, 45, 0.52), transparent 40%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 58px),
    linear-gradient(180deg, #101418, #060608);
}

body.is-lobby-open .play-core,
.play-core {
  width: 94px;
  height: 94px;
  border: 3px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #a762ff;
  font-size: 42px;
  background: rgba(0, 0, 0, 0.34);
  box-shadow: 0 0 30px rgba(155, 92, 255, 0.54);
}

body.is-lobby-open .lobby-video-meta,
.lobby-video-meta {
  min-height: 38px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #d8d2ca;
  font-size: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

body.is-lobby-open .lobby-feature-grid,
.lobby-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 28px;
  margin: 20px 0 26px;
  color: #d7d0c8;
  font-size: 15px;
}

.lobby-feature-grid span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lobby-feature-grid strong {
  color: #a762ff;
  margin-right: 8px;
}

body.is-lobby-open .lobby-guide-button,
.lobby-guide-button {
  border-color: rgba(167, 98, 255, 0.74);
  background: linear-gradient(180deg, rgba(93, 35, 150, 0.88), rgba(31, 13, 61, 0.94));
  color: #e0caff;
}

body.is-lobby-open .lobby-settings-list,
.lobby-settings-list {
  display: grid;
  gap: 14px;
  margin-bottom: 44px;
}

body.is-lobby-open .lobby-settings-list label,
.lobby-settings-list label {
  justify-content: space-between;
  background: rgba(3, 22, 12, 0.58);
}

body.is-lobby-open .lobby-settings-list strong,
.lobby-settings-list strong {
  min-width: 120px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  padding: 10px 12px;
  color: #dce9d9;
  background: rgba(0, 0, 0, 0.22);
  text-align: center;
  overflow-wrap: anywhere;
}

body.is-lobby-open .lobby-sandbox-copy,
body.is-lobby-open .guest-sandbox-description,
.lobby-sandbox-copy,
.guest-sandbox-description {
  max-width: 400px;
  margin: 0 auto 54px !important;
  text-align: center;
  color: #c9c4bc;
  font-size: 0.9rem;
  line-height: 1.42;
}

body.is-lobby-open .lobby-apply,
.lobby-apply {
  border-color: rgba(126, 224, 111, 0.76);
  color: #dff8d7;
  background: linear-gradient(180deg, rgba(43, 132, 59, 0.9), rgba(11, 55, 20, 0.94));
}

body.is-lobby-open .lobby-hint,
.lobby-hint {
  min-height: 20px;
  margin: 0;
  color: #c9c4bc;
  font-size: 13px;
  text-align: center;
  overflow-wrap: anywhere;
}

@media (max-width: 1260px) {
  body.is-lobby-open .lobby-header,
  .lobby-header {
    grid-template-columns: 1fr;
  }

  body.is-lobby-open .lobby-nav,
  .lobby-nav {
    justify-self: center;
  }

  body.is-lobby-open .lobby-content,
  .lobby-content {
    grid-template-columns: 1fr;
  }

  body.is-lobby-open .lobby-panel,
  .lobby-panel {
    overflow: visible !important;
  }
}

@media (max-width: 900px) {
  body.is-lobby-open .lobby-screen,
  .lobby-screen {
    padding: 12px;
  }

  body.is-lobby-open .lobby-shell,
  .lobby-shell {
    gap: 18px;
  }

  body.is-lobby-open .lobby-welcome,
  .lobby-welcome {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  body.is-lobby-open .lobby-welcome-icon,
  .lobby-welcome-icon {
    width: 56px;
    height: 56px;
    font-size: 29px;
  }

  body.is-lobby-open .lobby-feature-grid,
  .lobby-feature-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body.is-lobby-open .lobby-title,
  .lobby-title {
    font-size: clamp(30px, 10vw, 42px);
    letter-spacing: 0.08em;
  }

  body.is-lobby-open .lobby-subtitle,
  .lobby-subtitle {
    font-size: 11px;
    letter-spacing: 0.1em;
  }

  body.is-lobby-open .lobby-nav,
  .lobby-nav {
    width: 100%;
    gap: 8px;
  }

  body.is-lobby-open .lobby-panel,
  .lobby-panel {
    border-radius: 10px;
    padding: 16px;
  }

  body.is-lobby-open .lobby-panel-heading,
  .lobby-panel-heading {
    grid-template-columns: 1fr;
  }

  body.is-lobby-open .lobby-factions,
  .lobby-factions {
    grid-template-columns: 1fr;
  }

  body.is-lobby-open .lobby-settings-list label,
  .lobby-settings-list label {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  body.is-lobby-open .lobby-settings-list strong,
  .lobby-settings-list strong {
    width: 100%;
  }
}
/* =========================================================
   FINAL GUEST LOBBY FIT PATCH
   Р’РѕР·РІСЂР°С‰Р°РµС‚ РіРѕСЃС‚РµРІРѕРµ Р»РѕР±Р±Рё РІ 100dvh.
   РљРѕР»РѕРЅРєРё: 30% / 40% / 30%.
   Р¦РµРЅС‚СЂР°Р»СЊРЅР°СЏ РєРѕР»РѕРЅРєР° С€РёСЂРµ.
   РќРµ С‚СЂРѕРіР°РµС‚ РёРіСЂРѕРІСѓСЋ РґРѕСЃРєСѓ РїРѕСЃР»Рµ РІС…РѕРґР° РІ РїРµСЃРѕС‡РЅРёС†Сѓ.
   ========================================================= */

@media (min-width: 980px) {
  body.is-lobby-open {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    overflow: hidden !important;
  }

  body.is-lobby-open .lobby-screen {
    position: fixed;
    inset: 0;
    width: 100dvw;
    height: 100dvh;
    min-height: 0;
    padding: clamp(10px, 1.35vmin, 18px);
    overflow: hidden !important;
  }

  body.is-lobby-open .lobby-bg-glow {
    top: 10%;
    height: clamp(180px, 28dvh, 300px);
    opacity: 0.52;
  }

  body.is-lobby-open .lobby-shell {
    width: min(1720px, 100%);
    height: calc(100dvh - clamp(20px, 2.7vmin, 36px));
    min-height: 0;
    margin: 0 auto;
    display: grid;
    grid-template-rows: clamp(78px, 14dvh, 122px) minmax(0, 1fr) auto;
    gap: clamp(8px, 1.35vmin, 16px);
  }

  /* ---------- Р’Р•Р РҐ ---------- */

  body.is-lobby-open .lobby-header {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(240px, 0.9fr) minmax(360px, 1.2fr) minmax(220px, 0.9fr);
    gap: clamp(10px, 1.35vmin, 18px);
    align-items: start;
  }

  body.is-lobby-open .lobby-welcome {
    min-height: 0;
    height: clamp(62px, 10dvh, 92px);
    padding: clamp(10px, 1.2vmin, 14px);
    grid-template-columns: clamp(44px, 6.5dvh, 58px) minmax(0, 1fr);
    gap: clamp(10px, 1.2vmin, 14px);
    align-self: start;
  }

  body.is-lobby-open .lobby-welcome-icon {
    width: clamp(44px, 6.5dvh, 58px);
    height: clamp(44px, 6.5dvh, 58px);
    font-size: clamp(26px, 4.4dvh, 34px);
  }

  body.is-lobby-open .lobby-welcome strong {
    font-size: clamp(14px, min(1.15vw, 2.3dvh), 19px);
    line-height: 1.08;
  }

  body.is-lobby-open .lobby-welcome small {
    margin-top: 4px;
    font-size: clamp(10px, min(0.9vw, 1.7dvh), 12px);
    line-height: 1.16;
  }

  body.is-lobby-open .lobby-brand {
    min-height: 0;
    align-self: start;
    display: grid;
    align-content: start;
    padding-top: 0;
    text-align: center;
  }

  body.is-lobby-open .lobby-crown {
    font-size: clamp(14px, 2.6dvh, 22px);
    line-height: 1;
    margin-bottom: 2px;
  }

  body.is-lobby-open .lobby-title {
    margin: 0;
    font-size: clamp(34px, min(4.6vw, 8.2dvh), 76px);
    line-height: 0.88;
    letter-spacing: clamp(0.08em, 1.1vw, 0.2em);
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
  }

  body.is-lobby-open .lobby-subtitle {
    margin-top: clamp(5px, 0.9dvh, 9px);
    font-size: clamp(10px, min(1vw, 1.9dvh), 15px);
    line-height: 1.1;
    letter-spacing: clamp(0.08em, 0.8vw, 0.18em);
  }

  /* Р’ HTML СЃРµР№С‡Р°СЃ 4 РєРЅРѕРїРєРё: СЃРѕР»РЅС†Рµ, Р»СѓРЅР°, РЅР°СЃС‚СЂРѕР№РєРё, РІРѕРїСЂРѕСЃ.
     РџРѕСЌС‚РѕРјСѓ РґРµР»Р°РµРј РёРјРµРЅРЅРѕ 4 РєРѕРјРїР°РєС‚РЅС‹Рµ РєРѕР»РѕРЅРєРё, Р° РЅРµ 3. */
  body.is-lobby-open .lobby-nav {
    justify-self: end;
    align-self: start;
    width: auto;
    max-width: none;
    display: grid;
    grid-template-columns: repeat(4, clamp(48px, 6.7dvh, 68px));
    gap: clamp(7px, 1vmin, 12px);
    margin: 0;
  }

  body.is-lobby-open .lobby-nav-button {
    width: clamp(48px, 6.7dvh, 68px);
    height: clamp(48px, 6.7dvh, 68px);
    min-height: 0;
    aspect-ratio: 1;
    padding: 0;
    border-radius: 10px;
  }

  body.is-lobby-open .lobby-nav-button span {
    font-size: clamp(24px, 3.9dvh, 33px);
    line-height: 1;
  }

  /* ---------- Р¦Р•РќРўР : 30 / 40 / 30 ---------- */

  body.is-lobby-open .lobby-content {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 4fr) minmax(0, 3fr);
    gap: clamp(12px, 1.55vmin, 22px);
    align-items: stretch;
  }

  body.is-lobby-open .lobby-panel {
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden !important;
    padding: clamp(14px, 1.75vmin, 24px);
    border-radius: 14px;
    display: grid;
  }

  body.is-lobby-open .lobby-panel-blue,
  body.is-lobby-open .lobby-panel-green {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  }

  body.is-lobby-open .lobby-panel-purple {
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  }

  body.is-lobby-open .lobby-panel-heading {
    gap: clamp(10px, 1.25vmin, 16px);
    margin-bottom: clamp(10px, 1.4dvh, 18px);
  }

  body.is-lobby-open .lobby-panel-icon {
    width: clamp(44px, 6.2dvh, 62px);
    height: clamp(44px, 6.2dvh, 62px);
    font-size: clamp(23px, 3.7dvh, 31px);
  }

  body.is-lobby-open .lobby-panel h2 {
    font-size: clamp(18px, min(1.55vw, 3dvh), 28px);
    line-height: 1.05;
  }

  body.is-lobby-open .lobby-panel h3 {
    margin-top: clamp(8px, 1.4dvh, 16px);
    font-size: clamp(14px, min(1.25vw, 2.1dvh), 18px);
    line-height: 1.1;
  }

  body.is-lobby-open .lobby-panel p {
    font-size: clamp(11px, min(1vw, 1.8dvh), 14px);
    line-height: 1.25;
  }

  /* ---------- Р›Р•Р’РђРЇ РљРћР›РћРќРљРђ ---------- */

  body.is-lobby-open .lobby-input-list {
    gap: clamp(8px, 1.2dvh, 13px);
    margin-bottom: clamp(10px, 1.7dvh, 18px);
  }

  body.is-lobby-open .lobby-input-list div {
    min-height: clamp(36px, 5.5dvh, 48px);
    padding: 0 clamp(10px, 1.2vmin, 16px);
    gap: clamp(8px, 1.1vmin, 14px);
    font-size: clamp(11px, min(1vw, 1.8dvh), 14px);
  }

  body.is-lobby-open .lobby-input-list span {
    font-size: clamp(15px, 2.5dvh, 20px);
  }

  body.is-lobby-open .lobby-section-label {
    margin: 0 0 clamp(6px, 1dvh, 10px);
    font-size: clamp(11px, min(1vw, 1.8dvh), 14px);
  }

  body.is-lobby-open .lobby-factions {
    gap: clamp(8px, 1.2vmin, 12px);
    margin-bottom: clamp(10px, 1.8dvh, 20px);
  }

  body.is-lobby-open .lobby-factions span {
    min-height: clamp(66px, 11dvh, 104px);
    padding: clamp(8px, 1.2vmin, 14px);
    font-size: clamp(11px, min(1vw, 1.8dvh), 15px);
  }

  body.is-lobby-open .lobby-big-cta {
    min-height: clamp(42px, 6.2dvh, 56px);
    font-size: clamp(13px, min(1.2vw, 2dvh), 18px);
  }

  body.is-lobby-open .lobby-login-line {
    margin-top: clamp(8px, 1.4dvh, 16px) !important;
    font-size: clamp(11px, min(1vw, 1.7dvh), 13px);
  }

  /* ---------- Р¦Р•РќРўР РђР›Р¬РќРђРЇ РљРћР›РћРќРљРђ ---------- */

  body.is-lobby-open .lobby-video-card {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  body.is-lobby-open .lobby-video-board {
    min-height: 0;
    height: auto;
  }

  body.is-lobby-open .play-core {
    width: clamp(54px, 8.6dvh, 84px);
    height: clamp(54px, 8.6dvh, 84px);
    font-size: clamp(25px, 4.3dvh, 38px);
  }

  body.is-lobby-open .lobby-video-meta {
    min-height: clamp(25px, 4.2dvh, 36px);
    font-size: clamp(10px, 1vw, 12px);
  }

  body.is-lobby-open .lobby-feature-grid {
    gap: clamp(6px, 1.1vmin, 14px) clamp(10px, 1.4vmin, 20px);
    margin: clamp(9px, 1.45dvh, 16px) 0 clamp(9px, 1.45dvh, 16px);
    font-size: clamp(11px, min(1vw, 1.75dvh), 14px);
  }

  body.is-lobby-open .lobby-guide-button {
    min-height: clamp(38px, 5.8dvh, 52px);
    font-size: clamp(12px, min(1.1vw, 1.9dvh), 16px);
  }

  /* ---------- РџР РђР’РђРЇ РљРћР›РћРќРљРђ ---------- */

  body.is-lobby-open .lobby-settings-list {
    gap: clamp(8px, 1.3dvh, 14px);
    margin-bottom: clamp(12px, 2dvh, 24px);
  }

  body.is-lobby-open .lobby-settings-list label {
    min-height: clamp(36px, 5.4dvh, 48px);
    padding: 0 clamp(10px, 1.2vmin, 16px);
    font-size: clamp(11px, min(1vw, 1.75dvh), 14px);
  }

  body.is-lobby-open .lobby-settings-list strong {
    min-width: clamp(82px, 7.4vw, 118px);
    padding: clamp(5px, 0.9dvh, 8px) clamp(8px, 1vmin, 12px);
    font-size: clamp(10px, min(0.9vw, 1.6dvh), 12px);
  }

  body.is-lobby-open .lobby-sandbox-copy,
  body.is-lobby-open .guest-sandbox-description {
    max-width: 420px;
    margin: auto auto clamp(12px, 2dvh, 28px) !important;
    font-size: clamp(11px, min(1vw, 1.75dvh), 14px);
    line-height: 1.32;
  }

  body.is-lobby-open .lobby-apply {
    min-height: clamp(44px, 6.4dvh, 58px);
    font-size: clamp(13px, min(1.2vw, 2.1dvh), 18px);
  }

  /* ---------- РќРР— ---------- */

  body.is-lobby-open .lobby-hint {
    min-height: 0;
    margin: 0;
    padding-top: clamp(2px, 0.5dvh, 6px);
    font-size: clamp(10px, min(0.9vw, 1.6dvh), 12px);
    line-height: 1.2;
  }
}

/* Р•СЃР»Рё СЌРєСЂР°РЅ РЅРёР·РєРёР№, РЅРµ Р»РѕРјР°РµРј СЃРµС‚РєСѓ: РїСЂРѕСЃС‚Рѕ СѓР¶РёРјР°РµРј РІС‚РѕСЂРѕСЃС‚РµРїРµРЅРЅРѕРµ. */
@media (min-width: 980px) and (max-height: 760px) {
  body.is-lobby-open .lobby-shell {
    grid-template-rows: clamp(62px, 12dvh, 88px) minmax(0, 1fr) auto;
    gap: 8px;
  }

  body.is-lobby-open .lobby-welcome small,
  body.is-lobby-open .lobby-panel-heading p,
  body.is-lobby-open .lobby-video-meta,
  body.is-lobby-open .lobby-sandbox-copy,
  body.is-lobby-open .guest-sandbox-description {
    display: none;
  }

  body.is-lobby-open .lobby-panel {
    padding: clamp(10px, 1.45vmin, 16px);
  }

  body.is-lobby-open .lobby-factions span {
    min-height: clamp(50px, 9dvh, 74px);
  }

  body.is-lobby-open .lobby-settings-list {
    margin-bottom: auto;
  }
}

/* РќР° СѓР·РєРёС… СЌРєСЂР°РЅР°С… РєР°СЂС‚РѕС‡РєРё СЃРєР»Р°РґС‹РІР°СЋС‚СЃСЏ Рё Р»РѕР±Р±Рё РїРѕР»СѓС‡Р°РµС‚ РѕРґРёРЅ РѕР±С‰РёР№ СЃРєСЂРѕР»Р». */
@media (max-width: 979px) {
  body.is-lobby-open {
    overflow: hidden !important;
  }

  body.is-lobby-open .lobby-screen {
    width: 100dvw;
    height: 100dvh;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 10px;
  }

  body.is-lobby-open .lobby-shell {
    width: 100%;
    height: auto;
    min-height: calc(100dvh - 20px);
    grid-template-rows: auto auto auto;
    gap: 12px;
  }

  body.is-lobby-open .lobby-header,
  body.is-lobby-open .lobby-content {
    grid-template-columns: 1fr;
  }

  body.is-lobby-open .lobby-nav {
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.is-lobby-open .lobby-panel {
    height: auto;
    overflow: visible !important;
  }
}
/* Guest sandbox side panel */
.sandbox-panel {
  position: sticky;
  top: 18px;
  align-self: start;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(222, 181, 94, 0.28);
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 0%, rgba(222, 181, 94, 0.13), transparent 34%),
    radial-gradient(circle at 100% 10%, rgba(77, 221, 255, 0.1), transparent 32%),
    linear-gradient(180deg, rgba(18, 19, 22, 0.92), rgba(9, 10, 12, 0.92));
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
}

.sandbox-panel::-webkit-scrollbar {
  width: 8px;
}

.sandbox-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(222, 181, 94, 0.32);
}

.sandbox-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(222, 181, 94, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.sandbox-user-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border: 1px solid rgba(222, 181, 94, 0.48);
  border-radius: 50%;
  color: #f3c96d;
  font-size: 28px;
  background: rgba(222, 181, 94, 0.08);
  box-shadow: 0 0 24px rgba(222, 181, 94, 0.16);
}

.sandbox-head h2 {
  margin: 0;
  color: #f7dfaa;
  font-size: 1.45rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.sandbox-head p,
.sandbox-note,
.sandbox-option-text small {
  overflow-wrap: anywhere;
}

.sandbox-head p {
  margin: 5px 0 0;
  color: rgba(248, 239, 218, 0.68);
  font-size: 0.92rem;
  line-height: 1.35;
}

.sandbox-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.26);
}

.sandbox-tab,
.sandbox-choice {
  min-width: 0;
  border: 0;
  border-radius: 10px;
  color: rgba(248, 239, 218, 0.7);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.sandbox-tab {
  min-height: 42px;
  padding: 0 10px;
  font-weight: 700;
}

.sandbox-tab.is-active {
  color: #151008;
  background: linear-gradient(135deg, #f4d37b, #c9963e);
  box-shadow: 0 8px 22px rgba(222, 181, 94, 0.22);
}

.sandbox-tab-panel {
  display: none;
}

.sandbox-tab-panel.is-active {
  display: block;
  animation: sandbox-panel-in 180ms ease-out;
}

@keyframes sandbox-panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sandbox-section-title {
  margin: 16px 0 10px;
  color: #f0c96f;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sandbox-option {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: #f4efe4;
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.sandbox-option:not(.is-locked):hover {
  border-color: rgba(222, 181, 94, 0.34);
  background: rgba(222, 181, 94, 0.055);
}

.sandbox-option.is-enabled {
  border-color: rgba(222, 181, 94, 0.42);
  background: rgba(222, 181, 94, 0.08);
}

.sandbox-option.is-locked {
  opacity: 0.58;
  cursor: not-allowed;
  pointer-events: none;
}

.sandbox-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sandbox-option-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(222, 181, 94, 0.26);
  border-radius: 12px;
  color: #f0c96f;
  background: rgba(0, 0, 0, 0.22);
  font-size: 1.25rem;
}

.sandbox-option-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.sandbox-option-text strong {
  color: #fff8e8;
  font-size: 0.98rem;
  line-height: 1.2;
}

.sandbox-option-text small {
  color: rgba(248, 239, 218, 0.62);
  font-size: 0.78rem;
  line-height: 1.3;
}

.sandbox-switch {
  position: relative;
  width: 48px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.24);
}

.sandbox-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  transition: transform 160ms ease, background 160ms ease;
}

.sandbox-option input:checked + .sandbox-switch {
  border-color: rgba(222, 181, 94, 0.55);
  background: linear-gradient(135deg, rgba(222, 181, 94, 0.85), rgba(92, 209, 143, 0.8));
}

.sandbox-option input:checked + .sandbox-switch::after {
  transform: translateX(20px);
  background: #fff8e8;
}

.sandbox-lock {
  color: rgba(248, 239, 218, 0.7);
  font-size: 1.15rem;
}

.sandbox-highlight-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.sandbox-choice {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
}

.sandbox-choice.is-active {
  color: #150f07;
  border-color: rgba(222, 181, 94, 0.8);
  background: linear-gradient(135deg, #f2d77f, #c99a41);
}

.dice-chess-panel {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 11px;
  border: 1px solid rgba(92, 209, 143, 0.32);
  border-radius: 12px;
  color: #f4efe4;
  background: linear-gradient(135deg, rgba(92, 209, 143, 0.11), rgba(222, 181, 94, 0.08));
}

.dice-chess-die {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(92, 209, 143, 0.34);
  border-radius: 10px;
  color: #90e8b6;
  background: rgba(0, 0, 0, 0.24);
  font-size: 1.2rem;
}

.dice-chess-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dice-chess-copy strong,
.dice-chess-copy small {
  overflow-wrap: anywhere;
}

.dice-chess-copy strong {
  color: #fff8e8;
  font-size: 0.95rem;
  line-height: 1.15;
}

.dice-chess-copy small {
  color: rgba(248, 239, 218, 0.62);
  font-size: 0.72rem;
  line-height: 1.25;
}

.dice-chess-reroll {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(222, 181, 94, 0.3);
  border-radius: 9px;
  color: #f3d27e;
  background: rgba(0, 0, 0, 0.28);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.dice-chess-reroll:hover {
  border-color: rgba(222, 181, 94, 0.62);
  background: rgba(222, 181, 94, 0.1);
}

.sandbox-route-test {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(64px, 0.72fr);
  gap: 0.42rem;
  align-items: end;
}

.sandbox-field {
  display: grid;
  gap: 0.24rem;
  min-width: 0;
  color: rgba(248, 239, 218, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
}

.sandbox-field select,
.sandbox-field input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid rgba(222, 181, 94, 0.18);
  border-radius: 9px;
  color: #fff8e8;
  background: rgba(0, 0, 0, 0.32);
  font: inherit;
  padding: 0 0.5rem;
  outline: none;
}

.sandbox-field select:focus,
.sandbox-field input:focus {
  border-color: rgba(222, 181, 94, 0.64);
  box-shadow: 0 0 0 3px rgba(222, 181, 94, 0.13);
}

.sandbox-note {
  margin: 0 0 0.48rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: rgba(248, 239, 218, 0.62);
  background: transparent;
  font-size: 0.72rem;
  line-height: 1.25;
}

.sandbox-compat {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

/* V1: highlight toggle switches between single-color and player-color modes.
   Old bright/dim variant is intentionally disabled for now. */
body[data-highlight-mode="guest"] .board-cell-art.is-legal-move {
  --move-fill: #08bfff;
  --move-stroke: #9b5cff;
  --move-glow: rgba(0, 208, 255, 0.88);
}

body[data-highlight-mode="guest"] .cell-marker.is-legal-move {
  --marker-bg: #08bfff;
  --marker-border: #9b5cff;
  --marker-glow: rgba(0, 208, 255, 0.85);
}

body[data-highlight-mode="classic"] .board-cell-art.move-black {
  --move-fill: #4f6cff;
  --move-stroke: #b7c4ff;
  --move-glow: rgba(145, 168, 255, 0.9);
}

body[data-highlight-mode="classic"] .cell-marker.move-black {
  --marker-bg: #4f6cff;
  --marker-border: #b7c4ff;
  --marker-glow: rgba(145, 168, 255, 0.9);
}

body[data-move-highlight-visual-mode="player-colors"] .board-cell-art.move-white {
  --move-fill: rgba(255, 242, 185, 0.68);
  --move-stroke: rgba(255, 224, 95, 0.96);
  --move-glow: rgba(255, 220, 90, 0.68);
}

body[data-move-highlight-visual-mode="player-colors"] .board-cell-art.move-red {
  --move-fill: rgba(255, 55, 65, 0.72);
  --move-stroke: rgba(255, 210, 40, 0.96);
  --move-glow: rgba(255, 70, 70, 0.72);
}

body[data-move-highlight-visual-mode="player-colors"] .board-cell-art.move-black {
  --move-fill: rgba(18, 28, 46, 0.72);
  --move-stroke: rgba(70, 120, 180, 0.96);
  --move-glow: rgba(45, 105, 175, 0.58);
}

body[data-move-highlight-visual-mode="player-colors"] .cell-marker.move-white {
  --marker-bg: rgba(255, 242, 185, 0.82);
  --marker-border: rgba(255, 224, 95, 0.96);
  --marker-glow: rgba(255, 220, 90, 0.68);
}

body[data-move-highlight-visual-mode="player-colors"] .cell-marker.move-red {
  --marker-bg: rgba(255, 55, 65, 0.84);
  --marker-border: rgba(255, 210, 40, 0.96);
  --marker-glow: rgba(255, 70, 70, 0.72);
}

body[data-move-highlight-visual-mode="player-colors"] .cell-marker.move-black {
  --marker-bg: rgba(18, 28, 46, 0.82);
  --marker-border: rgba(70, 120, 180, 0.96);
  --marker-glow: rgba(45, 105, 175, 0.58);
}

body[data-sandbox-mode="polygon"][data-move-highlight-visual-mode="player-colors"] .board-cell-art.move-white {
  --move-fill: #fff7df;
  --move-stroke: #f2c96d;
  --move-glow: rgba(255, 236, 180, 0.92);
}

body[data-sandbox-mode="polygon"][data-move-highlight-visual-mode="player-colors"] .board-cell-art.move-red {
  --move-fill: #ff3b46;
  --move-stroke: #ffb35c;
  --move-glow: rgba(255, 53, 71, 0.95);
}

body[data-sandbox-mode="polygon"][data-move-highlight-visual-mode="player-colors"] .board-cell-art.move-black {
  --move-fill: #16181d;
  --move-stroke: #91f4ff;
  --move-glow: rgba(145, 244, 255, 0.9);
}

body[data-sandbox-mode="polygon"][data-move-highlight-visual-mode="player-colors"] .cell-marker.move-white {
  --marker-bg: #fff7df;
  --marker-border: #f2c96d;
  --marker-glow: rgba(255, 236, 180, 0.9);
}

body[data-sandbox-mode="polygon"][data-move-highlight-visual-mode="player-colors"] .cell-marker.move-red {
  --marker-bg: #ff3b46;
  --marker-border: #ffb35c;
  --marker-glow: rgba(255, 53, 71, 0.9);
}

body[data-sandbox-mode="polygon"][data-move-highlight-visual-mode="player-colors"] .cell-marker.move-black {
  --marker-bg: #171717;
  --marker-border: #91f4ff;
  --marker-glow: rgba(145, 244, 255, 0.9);
}

body[data-move-highlight-visual-mode="player-colors"] .board-cell-art.move-highlight-player-color.move-highlight-live {
  animation: moveHighlightPlayerColorPulse 1500ms ease-in-out infinite;
}

body[data-move-highlight-visual-mode="player-colors"] .board-cell-art.is-capture-move.move-highlight-player-color.move-highlight-live {
  animation-name: moveHighlightPlayerColorCapturePulse;
}

body[data-sandbox-mode="polygon"][data-move-highlight-visual-mode="player-colors"] .board-cell-art.move-highlight-player-color.move-highlight-live-volumetric {
  animation: moveHighlightPolygonVolumetricPulse 1350ms ease-in-out infinite;
}

body[data-sandbox-mode="polygon"][data-move-highlight-visual-mode="player-colors"] .board-cell-art.is-capture-move.move-highlight-player-color.move-highlight-live-volumetric {
  animation-name: moveHighlightPolygonVolumetricCapturePulse;
}

@keyframes moveHighlightPlayerColorPulse {
  0% {
    stroke-opacity: 0.88;
    fill-opacity: 0.72;
    filter: drop-shadow(0 0 6px var(--move-highlight-glow, rgba(255, 255, 255, 0.42)));
  }

  50% {
    stroke-opacity: 1;
    fill-opacity: 0.92;
    filter: drop-shadow(0 0 14px var(--move-highlight-glow, rgba(255, 255, 255, 0.72)));
  }

  100% {
    stroke-opacity: 0.88;
    fill-opacity: 0.72;
    filter: drop-shadow(0 0 6px var(--move-highlight-glow, rgba(255, 255, 255, 0.42)));
  }
}

@keyframes moveHighlightPlayerColorCapturePulse {
  0% {
    stroke-opacity: 0.92;
    fill-opacity: 0.78;
    filter: drop-shadow(0 0 8px var(--move-highlight-glow, rgba(255, 255, 255, 0.5)));
  }

  50% {
    stroke-opacity: 1;
    fill-opacity: 0.96;
    filter: drop-shadow(0 0 16px var(--move-highlight-glow, rgba(255, 255, 255, 0.78)));
  }

  100% {
    stroke-opacity: 0.92;
    fill-opacity: 0.78;
    filter: drop-shadow(0 0 8px var(--move-highlight-glow, rgba(255, 255, 255, 0.5)));
  }
}

@keyframes moveHighlightWhiteSoftPulse {
  0% {
    stroke-opacity: 0.28;
    fill-opacity: 0.12;
    filter: drop-shadow(0 0 2px var(--move-highlight-glow, rgba(255, 220, 140, 0.14)));
  }

  45% {
    stroke-opacity: 0.48;
    fill-opacity: 0.18;
    filter: drop-shadow(0 0 6px var(--move-highlight-glow, rgba(255, 220, 140, 0.22)));
  }

  100% {
    stroke-opacity: 0.28;
    fill-opacity: 0.12;
    filter: drop-shadow(0 0 2px var(--move-highlight-glow, rgba(255, 220, 140, 0.14)));
  }
}

@keyframes moveHighlightPolygonVolumetricPulse {
  0% {
    stroke-opacity: 0.72;
    fill-opacity: 0.52;
    filter:
      brightness(1.2)
      saturate(1.45)
      drop-shadow(0 0 5px var(--move-highlight-glow, rgba(255, 255, 255, 0.35)));
  }

  46% {
    stroke-opacity: 1;
    fill-opacity: 0.74;
    filter:
      brightness(1.48)
      saturate(1.85)
      drop-shadow(0 0 14px var(--move-highlight-glow, rgba(255, 255, 255, 0.72)))
      drop-shadow(0 0 5px var(--move-stroke, rgba(255, 255, 255, 0.4)));
  }

  100% {
    stroke-opacity: 0.72;
    fill-opacity: 0.52;
    filter:
      brightness(1.2)
      saturate(1.45)
      drop-shadow(0 0 5px var(--move-highlight-glow, rgba(255, 255, 255, 0.35)));
  }
}

@keyframes moveHighlightPolygonVolumetricCapturePulse {
  0% {
    stroke-opacity: 0.76;
    fill-opacity: 0.64;
    filter:
      brightness(1.28)
      saturate(1.65)
      drop-shadow(0 0 7px var(--move-highlight-glow, rgba(255, 255, 255, 0.42)));
  }

  46% {
    stroke-opacity: 1;
    fill-opacity: 0.86;
    filter:
      brightness(1.58)
      saturate(2)
      drop-shadow(0 0 18px var(--move-highlight-glow, rgba(255, 255, 255, 0.78)))
      drop-shadow(0 0 7px var(--move-stroke, rgba(255, 255, 255, 0.48)));
  }

  100% {
    stroke-opacity: 0.76;
    fill-opacity: 0.64;
    filter:
      brightness(1.28)
      saturate(1.65)
      drop-shadow(0 0 7px var(--move-highlight-glow, rgba(255, 255, 255, 0.42)));
  }
}

@media (max-width: 900px) {
  .sandbox-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .sandbox-panel {
    padding: 14px;
    border-radius: 14px;
  }

  .sandbox-head {
    padding: 12px;
  }

  .sandbox-route-test {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .sandbox-route-test {
    grid-template-columns: 1fr;
  }
}

.sandbox-back-button {
  border: 1px solid rgba(231, 190, 102, 0.46);
  border-radius: 999px;
  background: rgba(12, 10, 7, 0.58);
  color: #f7d68a;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0.46rem 0.72rem;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(231, 190, 102, 0.12);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.sandbox-back-button:hover {
  transform: translateY(-1px);
  border-color: rgba(247, 214, 138, 0.82);
  background: rgba(43, 31, 13, 0.74);
}

.sandbox-mode-card {
  cursor: pointer;
  border-color: rgba(231, 190, 102, 0.22);
}

.sandbox-mode-card .sandbox-option-text em {
  display: block;
  margin-top: 0.32rem;
  color: rgba(247, 214, 138, 0.78);
  font-style: normal;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sandbox-mode-card.is-active {
  border-color: rgba(247, 214, 138, 0.86);
  background:
    linear-gradient(135deg, rgba(247, 214, 138, 0.18), rgba(96, 214, 255, 0.08)),
    rgba(18, 14, 8, 0.68);
  box-shadow: 0 0 26px rgba(247, 214, 138, 0.18), inset 0 0 0 1px rgba(247, 214, 138, 0.2);
}

.sandbox-mode-card.is-locked {
  cursor: default;
}








#sandbox-tools-content {
  display: grid;
  gap: 0.48rem;
}

body[data-sandbox-tab="tools"] .sandbox-register-note {
  display: none !important;
}

.sandbox-position-compact {
  display: grid;
  gap: 0.36rem;
}

.sandbox-note-compact {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.18;
}

.sandbox-position-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.sandbox-position-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 0.42rem;
  border: 1px solid rgba(231, 190, 102, 0.2);
  border-radius: 8px;
  background: rgba(247, 214, 138, 0.075);
  color: rgba(248, 241, 223, 0.8);
  font-size: 0.66rem;
  font-weight: 700;
  white-space: nowrap;
}

.sandbox-position-actions {
  margin-top: 0.1rem;
}

.sandbox-tool-groups {
  display: grid;
  gap: 0.5rem;
}

.sandbox-tool-group {
  border: 1px solid rgba(222, 181, 94, 0.18);
  border-radius: 12px;
  background: rgba(7, 13, 18, 0.58);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.sandbox-tool-group-title {
  margin: 0;
  padding: 8px 10px 7px;
  color: #f0c96f;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sandbox-tool-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  min-height: 36px;
  padding: 0 9px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: transparent;
  color: #f8f1df;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.sandbox-tool-row:last-child {
  border-bottom: 0;
}

.sandbox-tool-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.sandbox-tool-row.is-active {
  background: linear-gradient(135deg, rgba(247, 214, 138, 0.07), rgba(95, 214, 255, 0.03));
}

.sandbox-tool-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #f0c96f;
  font-size: 0.86rem;
  opacity: 0.95;
}

.sandbox-tool-title {
  min-width: 0;
  color: #fff8e8;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sandbox-tool-switch {
  position: relative;
  width: 38px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.24);
}

.sandbox-tool-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  transition: transform 160ms ease, background 160ms ease;
}

.sandbox-tool-row.is-active .sandbox-tool-switch {
  border-color: rgba(222, 181, 94, 0.55);
  background: linear-gradient(135deg, rgba(222, 181, 94, 0.88), rgba(92, 209, 143, 0.78));
}

.sandbox-tool-row.is-active .sandbox-tool-switch::after {
  transform: translateX(17px);
  background: #fff8e8;
}

.sandbox-tool-mode {
  justify-self: end;
  min-width: 108px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(231, 190, 102, 0.28);
  background: rgba(247, 214, 138, 0.08);
  color: #f7d68a;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.sandbox-tool-mode::after {
  content: "в–ѕ";
  font-size: 0.7rem;
  opacity: 0.85;
}

.sandbox-route-card {
  border: 1px solid rgba(158, 96, 255, 0.34);
  border-radius: 13px;
  background:
    radial-gradient(circle at 28% 0%, rgba(158, 96, 255, 0.18), transparent 42%),
    rgba(9, 10, 20, 0.72);
  padding: 0.65rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035), 0 18px 48px rgba(0, 0, 0, 0.22);
}

.sandbox-command-field {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 0.55rem;
}

.sandbox-command-field span {
  color: rgba(248, 241, 223, 0.64);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sandbox-command-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.38rem;
  align-items: center;
}

.sandbox-command-field input {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(242, 201, 109, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff7df;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.42rem 0.58rem;
  outline: none;
}

.sandbox-command-row button {
  min-height: 34px;
  border: 1px solid rgba(242, 201, 109, 0.45);
  border-radius: 10px;
  background: rgba(242, 201, 109, 0.14);
  color: #f7d68a;
  cursor: pointer;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0 0.58rem;
}

.sandbox-command-row button:hover {
  border-color: rgba(242, 201, 109, 0.78);
  background: rgba(242, 201, 109, 0.2);
}

.sandbox-command-field input::placeholder {
  color: rgba(248, 241, 223, 0.42);
}

.sandbox-command-field input:focus {
  border-color: rgba(242, 201, 109, 0.72);
  box-shadow: 0 0 0 2px rgba(242, 201, 109, 0.12);
}

.sandbox-command-status {
  margin: -0.32rem 0 0.55rem;
  color: rgba(248, 241, 223, 0.64);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25;
}

.sandbox-command-status.is-error {
  color: #ff9c9c;
}

.sandbox-command-status.is-success {
  color: #f7d68a;
}

.sandbox-register-note {
  margin-top: auto;
  border: 1px solid rgba(231, 190, 102, 0.22);
  border-radius: 16px;
  background: rgba(247, 214, 138, 0.06);
  color: rgba(248, 241, 223, 0.72);
  font-size: 0.84rem;
  line-height: 1.45;
  padding: 0.9rem 1rem;
}

body:not(.show-move-coordinates) .cell-marker.is-legal-move {
  opacity: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: transparent;
  font-size: 0;
  pointer-events: none;
}

body.show-move-coordinates .cell-marker.is-legal-move,
body[data-sandbox-mode="polygon"] .cell-marker.is-legal-move {
  font-size: clamp(7px, 1vw, 9px);
}

body.show-move-coordinates .cell-marker.move-white,
body[data-sandbox-mode="polygon"] .cell-marker.move-white {
  color: #171613;
}

body.show-move-coordinates .cell-marker.move-red,
body.show-move-coordinates .cell-marker.move-black,
body[data-sandbox-mode="polygon"] .cell-marker.move-red,
body[data-sandbox-mode="polygon"] .cell-marker.move-black {
  color: #fff;
}

body[data-move-highlight-visual-mode="classic"] .cell-marker.is-legal-move {
  opacity: 1;
  width: clamp(6px, 0.78vw, 9px);
  height: clamp(6px, 0.78vw, 9px);
  background: rgba(130, 65, 65, 0.55);
  border-color: rgba(130, 65, 65, 0.75);
  border-width: 1px;
  box-shadow: none;
  color: transparent;
  font-size: 0;
  pointer-events: auto;
  animation: none;
  filter: none;
}

body[data-move-highlight-visual-mode="classic"] .cell-marker.is-capture-move {
  width: clamp(9px, 1.1vw, 13px);
  height: clamp(9px, 1.1vw, 13px);
  background: transparent;
  border-color: rgba(140, 75, 75, 0.85);
  border-width: 1.3px;
  box-shadow: none;
  transform: translate(-50%, -50%) rotate(var(--board-counter-rotation));
  animation: none;
  filter: none;
}

body[data-move-highlight-visual-mode="classic"] .cell-marker.is-capture-move::before,
body[data-move-highlight-visual-mode="classic"] .cell-marker.is-capture-move::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36%;
  height: 1.3px;
  border-radius: 999px;
  background: rgba(140, 75, 75, 0.85);
  pointer-events: none;
}

body[data-move-highlight-visual-mode="classic"] .cell-marker.is-capture-move::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

body[data-move-highlight-visual-mode="classic"] .cell-marker.is-capture-move::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

body[data-move-highlight-visual-mode="classic"] .piece.is-selected {
  outline: none;
  filter: none;
  animation: none;
}

body[data-move-highlight-visual-mode="classic"] .piece.is-selected::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46%;
  height: 46%;
  border: 1.8px solid rgba(140, 75, 75, 0.8);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: rgba(140, 75, 75, 0.05);
  box-shadow: none;
  animation: none;
  filter: none;
}

#board.show-markers .cell-marker:not(.is-legal-move):not(.is-check-cell) {
  opacity: 0;
}

body[data-polygon-tool="position"] #board > .piece:not(.sandbox-position-piece):not(.route-test-piece) {
  display: none;
  pointer-events: none;
}

.sandbox-position-piece {
  position: absolute;
  width: var(--sandbox-piece-size);
  height: var(--sandbox-piece-size);
  border: 2px dashed rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: rgba(18, 24, 32, 0.82);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: calc(var(--sandbox-piece-size) * 0.76);
  line-height: 1;
  transform: translate(-50%, -50%) rotate(var(--board-counter-rotation));
  z-index: 46;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.35);
}

.sandbox-position-piece.sandbox-position-selected {
  border-style: solid;
  outline: 3px solid rgba(32, 215, 255, 0.95);
  outline-offset: 2px;
  box-shadow: 0 0 22px rgba(32, 215, 255, 0.75);
}

.sandbox-tool-row.sandbox-tool-primary {
  border-color: rgba(255, 236, 153, 0.85);
  background: rgba(242, 201, 109, 0.16);
}

.debug-cell-center-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(var(--board-counter-rotation));
  z-index: 95;
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.7), 0 0 10px currentColor;
}

.debug-cell-center-old {
  color: #ff3b46;
  background: #ff3b46;
}

.debug-cell-center-new {
  color: #20d7ff;
  background: #20d7ff;
  width: 6px;
  height: 6px;
}

.sandbox-position-piece.piece-white {
  color: #fff7df;
  border-color: #f2c96d;
}

.sandbox-position-piece.piece-red {
  color: #ff3b46;
  border-color: #ffb35c;
}

.sandbox-position-piece.piece-black {
  color: #111;
  background: rgba(245, 250, 255, 0.86);
  border-color: #91f4ff;
}

.board-cell-art.sandbox-position-origin,
.cell-marker.sandbox-position-origin {
  fill: #fff7df !important;
  fill-opacity: 0.78;
  stroke: #ffb35c !important;
  stroke-width: 5px;
  filter: brightness(1.35) drop-shadow(0 0 12px rgba(255, 179, 92, 0.9));
}

.board-cell-art.sandbox-position-move,
.cell-marker.sandbox-position-move {
  fill: #20d7ff !important;
  fill-opacity: 0.62;
  stroke: #9b5cff !important;
  stroke-width: 4px;
  filter: brightness(1.25) drop-shadow(0 0 10px rgba(32, 215, 255, 0.9));
}

.board-cell-art.sandbox-position-attack,
.cell-marker.sandbox-position-attack {
  fill: #ff3b46 !important;
  fill-opacity: 0.48;
  stroke: #ffec99 !important;
  stroke-width: 4px;
  filter: brightness(1.28) drop-shadow(0 0 10px rgba(255, 59, 70, 0.8));
}

.cell-marker.sandbox-position-origin,
.cell-marker.sandbox-position-move,
.cell-marker.sandbox-position-attack {
  opacity: 1;
}

.sandbox-position-picker {
  position: absolute;
  min-width: 206px;
  padding: 0.42rem;
  border: 1px solid rgba(242, 201, 109, 0.58);
  border-radius: 12px;
  background: rgba(18, 17, 15, 0.94);
  color: #fff7df;
  transform: translate(12px, -50%) rotate(var(--board-counter-rotation));
  z-index: 90;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.4), 0 0 18px rgba(242, 201, 109, 0.08);
}

.sandbox-position-picker-row {
  display: grid;
  grid-template-columns: 52px repeat(6, 24px);
  gap: 0.18rem;
  align-items: center;
  margin-bottom: 0.22rem;
}

.sandbox-position-picker-row span {
  color: rgba(248, 241, 223, 0.74);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.sandbox-position-picker button {
  border: 1px solid rgba(242, 201, 109, 0.45);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  min-height: 24px;
  cursor: pointer;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
}

.sandbox-position-delete {
  width: 100%;
  margin-top: 0.18rem;
  font-size: 0.72rem !important;
}

.capture-board-toggle[hidden],
.view-controls[hidden],
.notation-widget[hidden],
.captures-board[hidden] {
  display: none !important;
}

body[data-sandbox-mode="polygon"] .capture-board-toggle,
body[data-sandbox-mode="polygon"] .view-controls,
body[data-sandbox-mode="polygon"] .notation-widget,
body[data-sandbox-mode="polygon"] .captures-board {
  display: none !important;
}
body.is-lobby-open .board-back-row {
  display: none !important;
}

body:not(.is-lobby-open) .board-back-row {
  display: block;
}

body:not(.is-lobby-open) .board-back-row .sandbox-back-button {
  position: fixed !important;
  left: 24px !important;
  bottom: 24px !important;
  z-index: 9999 !important;
}

@media (min-width: 1041px) {
  .game-shell {
    height: 100dvh;
    min-height: 0;
    padding: 8px;
    overflow: hidden;
  }

  .game-layout {
    height: 100%;
    min-height: 0;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) clamp(300px, 22vw, 326px);
  }

  .topbar {
    margin-bottom: 8px;
    gap: 8px;
  }

  .topbar > div:first-child {
    gap: 8px;
  }

  .topbar h1,
  .sandbox-title {
    font-size: clamp(30px, min(3.8vw, 5.1dvh), 44px);
  }

  .topbar .turn-badge {
    width: fit-content !important;
    min-width: 170px !important;
    max-width: 220px !important;
    min-height: 72px;
    align-self: flex-start !important;
    justify-self: start !important;
    flex: 0 0 auto !important;
    padding: 12px 18px;
    border-radius: 16px;
  }

  #board {
    width: min(92%, 920px, calc((100dvh - 154px) / 0.88));
  }

  .sandbox-panel {
    padding: 10px;
    overflow: hidden;
  }

  .sandbox-head {
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 12px;
  }

  .sandbox-user-icon {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    font-size: 23px;
  }

  .sandbox-head h2 {
    font-size: 1.2rem;
  }

  .sandbox-head p {
    margin-top: 3px;
    font-size: 0.78rem;
    line-height: 1.2;
  }

  .sandbox-tabs {
    gap: 6px;
    margin-bottom: 10px;
    padding: 4px;
    border-radius: 11px;
  }

  .sandbox-tab {
    min-height: 34px;
    padding: 0 8px;
    font-size: 0.88rem;
  }

  .sandbox-section-title {
    margin: 10px 0 7px;
    font-size: 0.7rem;
  }

  .sandbox-option {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 9px;
    min-height: 56px;
    margin-bottom: 8px;
    padding: 9px;
    border-radius: 12px;
  }

  .sandbox-option-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 1rem;
  }

  .sandbox-option-text {
    gap: 2px;
  }

  .sandbox-option-text strong {
    font-size: 0.88rem;
  }

  .sandbox-option-text small {
    font-size: 0.68rem;
    line-height: 1.18;
  }

  .sandbox-mode-card .sandbox-option-text em {
    margin-top: 0.2rem;
    font-size: 0.66rem;
  }

  .sandbox-switch {
    width: 42px;
    height: 24px;
  }

  .sandbox-switch::after {
    width: 16px;
    height: 16px;
  }

  #sandbox-tools-content {
    gap: 0.52rem;
  }

  .sandbox-tool-groups {
    gap: 0.45rem;
  }

  .sandbox-tool-group {
    border-radius: 12px;
  }

  .sandbox-tool-group-title {
    padding: 8px 10px 7px;
    font-size: 0.68rem;
  }

  .sandbox-tool-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 0.52rem;
    min-height: 34px;
    padding: 0 9px;
  }

  .sandbox-tool-icon {
    width: 24px;
    height: 24px;
    font-size: 0.86rem;
  }

  .sandbox-tool-title {
    font-size: 0.82rem;
  }

  .sandbox-tool-switch {
    width: 38px;
    height: 22px;
  }

  .sandbox-tool-switch::after {
    top: 3px;
    left: 4px;
    width: 14px;
    height: 14px;
  }

  .sandbox-tool-row.is-active .sandbox-tool-switch::after {
    transform: translateX(17px);
  }

  .sandbox-route-card {
    padding: 0.65rem;
    border-radius: 13px;
  }

  .sandbox-position-compact {
    gap: 0.32rem;
  }

  .sandbox-note-compact {
    font-size: 0.66rem;
  }

  .sandbox-position-chips {
    gap: 0.32rem;
  }

  .sandbox-position-chips span {
    min-height: 18px;
    padding: 0 0.38rem;
    font-size: 0.63rem;
  }

  .sandbox-register-note {
    padding: 10px 12px;
    font-size: 0.78rem;
    line-height: 1.28;
  }
}

/* Desktop sandbox viewport guard: prevent document-level scroll without changing board sizing. */
@media (min-width: 980px) {
  html {
    overflow: hidden;
  }

  body:not(.is-lobby-open) {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body:not(.is-lobby-open) .game-shell {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }
}
#notationWidget.notation-widget,
.notation-widget{
  position:fixed !important;
  right:auto !important;
  bottom:auto !important;
  width:56px !important;
  height:56px !important;
  margin:0 !important;
  transform:none !important;
  translate:none !important;
  z-index:80 !important;
}

#notationToggle{
  position:absolute !important;
  inset:0 !important;
  width:100% !important;
  height:100% !important;
  margin:0 !important;
  transform:none !important;
  translate:none !important;
}

.move-log-record-preview-debug {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99999;
  width: min(620px, calc(100vw - 48px));
  max-height: min(420px, calc(100vh - 48px));
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(230, 190, 110, 0.42);
  border-radius: 16px;
  background: rgba(18, 20, 24, 0.94);
  color: #f3ead8;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(10px);
}

.move-log-record-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font: 700 13px/1.2 system-ui, sans-serif;
  letter-spacing: 0.03em;
  color: #f0d28a;
}

.move-log-record-preview-close {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(240, 210, 138, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #f0d28a;
  cursor: pointer;
}

.move-log-record-preview-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.move-log-record-preview-row {
  display: grid;
  grid-template-columns: 32px 1fr 1fr 1fr;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.move-log-record-preview-num {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(240, 210, 138, 0.12);
  color: #f0d28a;
  font: 700 12px/1 system-ui, sans-serif;
}

.move-log-record-preview-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  white-space: nowrap;
}

.move-log-record-preview-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(240, 210, 138, 0.22);
}

.move-log-record-preview-dot.is-white {
  background: #f3ead8;
}

.move-log-record-preview-dot.is-red {
  background: #b9262f;
}

.move-log-record-preview-dot.is-black {
  background: #17171b;
  box-shadow: 0 0 0 1px rgba(240, 210, 138, 0.52);
}

.move-log-record-preview-unit {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  object-fit: contain;
}

.move-log-record-preview-route {
  overflow: visible;
  text-overflow: ellipsis;
  font: 600 13px/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #f7efe0;
}

.move-log-record-preview-empty-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.35);
}

.move-log-round-records {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(320px, calc(100vh - 220px));
  overflow: auto;
  padding-right: 3px;
}

.move-log-round-record {
  display: grid;
  grid-template-columns: 28px 1fr 1fr 1fr;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.move-log-round-record.is-selected-round {
  border-color: rgba(240, 210, 138, 0.72);
  background: rgba(240, 210, 138, 0.10);
}

.move-log-round-number {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(240, 210, 138, 0.12);
  color: #f0d28a;
  font: 700 12px/1 system-ui, sans-serif;
}

.move-log-round-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
  cursor: pointer;
}

.move-log-round-action.is-selected-action {
  border-radius: 8px;
  background: rgba(240, 210, 138, 0.14);
  box-shadow: 0 0 0 1px rgba(240, 210, 138, 0.28);
}

.move-log-round-action[data-empty="true"] {
  cursor: default;
  opacity: 0.55;
}

.move-log-round-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(240, 210, 138, 0.22);
}

.move-log-round-dot.is-white {
  background: #f3ead8;
}

.move-log-round-dot.is-red {
  background: #b9262f;
}

.move-log-round-dot.is-black {
  background: #17171b;
  box-shadow: 0 0 0 1px rgba(240, 210, 138, 0.52);
}

.move-log-round-route {
  overflow: visible;
  text-overflow: ellipsis;
  color: #f7efe0;
  font: 600 12px/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-app-skin="imba-dark"],
body[data-app-skin="imba-dark"] {
  color-scheme: dark;
}

:root[data-app-skin="imba-classic-light"] {
  color-scheme: light;
  --skin-page-bg: #f4efe3;
  --skin-page-text: #2a241a;
  --skin-muted: rgba(42, 36, 26, 0.68);
  --skin-panel-bg: rgba(255, 252, 242, 0.88);
  --skin-panel-bg-strong: rgba(255, 250, 236, 0.96);
  --skin-panel-border: rgba(111, 83, 43, 0.24);
  --skin-gold: #b78934;
  --skin-gold-soft: rgba(183, 137, 52, 0.18);
  --skin-green: #486f3d;
  --skin-green-strong: #31562f;
  --skin-board-light: #e7dfcf;
  --skin-board-dark: #a58f78;
  --skin-board-line: rgba(70, 52, 34, 0.26);
  --skin-shadow-soft: 0 18px 50px rgba(88, 65, 34, 0.14);
}

:root[data-app-skin="imba-classic-light"] body {
  background:
    radial-gradient(circle at 50% 0%, rgba(219, 179, 98, 0.24), transparent 42%),
    linear-gradient(180deg, #f7f1e4 0%, #efe6d5 100%);
  color: var(--skin-page-text);
}

:root[data-app-skin="imba-classic-light"] body.is-lobby-open .lobby-screen {
  background:
    radial-gradient(circle at 50% 15%, rgba(219, 179, 98, 0.28), transparent 34%),
    linear-gradient(180deg, #f7f1e4 0%, #efe6d5 100%);
  color: var(--skin-page-text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.is-lobby-open .topbar-actions,
.topbar-actions.lobby-nav {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.topbar-action-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(5, 8, 12, 0.42);
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.topbar-action-btn:hover,
.topbar-action-btn:focus-visible {
  border-color: rgba(255, 210, 95, 0.55);
  background: rgba(255, 210, 95, 0.08);
  transform: translateY(-1px);
}

.topbar-action-btn:focus-visible {
  outline: 2px solid rgba(255, 210, 95, 0.65);
  outline-offset: 2px;
}

:root[data-app-skin="imba-classic-light"] .topbar-action-btn {
  border-color: rgba(111, 83, 43, 0.22);
  background: rgba(255, 252, 242, 0.74);
  color: #3a3022;
  box-shadow: 0 8px 22px rgba(85, 62, 32, 0.1);
}

:root[data-app-skin="imba-classic-light"] .topbar-action-btn:hover,
:root[data-app-skin="imba-classic-light"] .topbar-action-btn:focus-visible {
  border-color: rgba(183, 137, 52, 0.55);
  background: rgba(255, 248, 229, 0.92);
  box-shadow: 0 10px 26px rgba(183, 137, 52, 0.16);
}

.shell-modal[hidden] {
  display: none;
}

.shell-modal {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 20px;
}

.shell-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
}

.shell-modal-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  border: 1px solid rgba(242, 201, 109, 0.36);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(16, 22, 27, 0.96), rgba(6, 10, 13, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #f5efe6;
  padding: 24px;
}

:root[data-app-skin="imba-classic-light"] .shell-modal-card {
  background: var(--skin-panel-bg-strong);
  border-color: var(--skin-panel-border);
  box-shadow: var(--skin-shadow-soft);
  color: var(--skin-page-text);
}

.shell-modal-card h2 {
  margin: 0 34px 10px 0;
  color: #f4d086;
  font-size: 1.25rem;
}

.shell-modal-card p {
  margin: 0;
  color: rgba(245, 239, 230, 0.78);
  line-height: 1.5;
}

:root[data-app-skin="imba-classic-light"] .shell-modal-card p {
  color: var(--skin-muted);
}

.shell-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  cursor: pointer;
}

.shell-help-page[hidden] {
  display: none;
}

body.is-shell-help-open #lobby-screen .lobby-shell {
  display: none !important;
}

body.is-shell-guide-open #lobby-screen .lobby-shell,
body.is-shell-settings-open #lobby-screen .lobby-shell {
  display: none !important;
}

.shell-help-page {
  position: relative;
  min-height: calc(100dvh - clamp(36px, 4vw, 68px));
  height: calc(100dvh - clamp(36px, 4vw, 68px));
  width: min(1480px, 100%);
  margin: 0 auto;
  display: grid;
  align-items: stretch;
  padding: clamp(8px, 1vw, 14px) 0;
  overflow: visible;
}

.shell-help-page-inner {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(10px, 1.2vw, 16px);
  min-height: 0;
}

.shell-help-back {
  justify-self: start;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(5, 8, 12, 0.42);
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font: inherit;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.shell-help-back:hover,
.shell-help-back:focus-visible {
  border-color: rgba(255, 210, 95, 0.55);
  background: rgba(255, 210, 95, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.shell-help-card {
  position: relative;
  min-height: 0;
  border: 1px solid rgba(242, 201, 109, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 16%, rgba(93, 58, 198, 0.24), transparent 28%),
    radial-gradient(circle at 78% 24%, rgba(58, 184, 255, 0.14), transparent 34%),
    radial-gradient(circle at 50% 82%, rgba(80, 220, 128, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(10, 18, 27, 0.72), rgba(3, 8, 12, 0.94));
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  color: #f5efe6;
  padding: clamp(14px, 1.5vw, 22px) clamp(20px, 2.8vw, 40px);
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  align-content: start;
  justify-items: center;
  text-align: center;
  overflow: visible;
  min-height: 0;
  row-gap: 0;
}

.shell-help-card::before,
.shell-help-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0.72;
}

.shell-help-card::before {
  inset: 18px;
  border-radius: 20px;
  border: 1px solid rgba(94, 194, 255, 0.08);
  background:
    linear-gradient(90deg, rgba(94, 194, 255, 0.18), transparent 22%, transparent 78%, rgba(106, 222, 126, 0.13)) top / 100% 1px no-repeat,
    linear-gradient(90deg, rgba(94, 194, 255, 0.12), transparent 18%, transparent 82%, rgba(106, 222, 126, 0.1)) bottom / 100% 1px no-repeat;
}

.shell-help-card::after {
  content: "♕";
  width: 86px;
  height: 86px;
  right: clamp(18px, 2vw, 34px);
  top: clamp(16px, 1.8vw, 30px);
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 201, 109, 0.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 50%, rgba(242, 201, 109, 0.18), transparent 56%),
    rgba(5, 8, 12, 0.24);
  box-shadow: 0 0 34px rgba(242, 201, 109, 0.08);
  color: rgba(242, 201, 109, 0.9);
  font-size: 34px;
}

.shell-help-kicker {
  margin: 0 0 clamp(6px, 0.7vw, 9px);
  color: #f4d086;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: clamp(0.68rem, 0.75vw, 0.78rem);
}

.shell-help-card h2 {
  margin: 0;
  font-size: clamp(32px, 3.65vw, 56px);
  line-height: 0.98;
  letter-spacing: 0.035em;
  color: #f1f0ec;
  background: linear-gradient(92deg, #f4c05f 0%, #fff3dd 45%, #c7a7ff 78%, #f7f2ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 34px rgba(156, 116, 255, 0.16);
}

.shell-help-card > p:not(.shell-help-kicker) {
  max-width: 660px;
  margin: clamp(5px, 0.55vw, 8px) auto 0;
  color: rgba(245, 239, 230, 0.76);
  line-height: 1.45;
  font-size: clamp(13px, 0.95vw, 15px);
  letter-spacing: 0.09em;
}

.shell-help-worldline {
  width: min(920px, 100%);
  position: relative;
  z-index: 1;
  margin: clamp(16px, 2vh, 24px) auto 0 !important;
  padding: clamp(9px, 0.9vw, 12px) clamp(18px, 1.7vw, 24px);
  border: 1px solid rgba(242, 201, 109, 0.28);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(60, 172, 255, 0.1), rgba(242, 201, 109, 0.12), rgba(106, 222, 126, 0.1)),
    rgba(5, 8, 12, 0.56);
  box-shadow:
    0 0 34px rgba(60, 172, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: rgba(255, 236, 185, 0.84) !important;
  font-size: clamp(0.78rem, 0.9vw, 0.95rem) !important;
  font-weight: 800;
  letter-spacing: 0.035em;
}

.shell-help-worldline::before {
  content: "♕";
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 12px;
  border: 1px solid rgba(242, 201, 109, 0.36);
  border-radius: 999px;
  color: rgba(242, 201, 109, 0.95);
  background: rgba(4, 8, 13, 0.62);
  box-shadow: 0 0 18px rgba(242, 201, 109, 0.16);
}

.help-flip-grid {
  width: min(1260px, 100%);
  min-height: 0;
  height: auto;
  margin-top: clamp(12px, 1.2vw, 18px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 2.25vw, 38px);
  align-items: stretch;
  perspective: 1200px;
}

.help-flip-card {
  --help-card-accent: rgba(242, 201, 109, 0.88);
  --help-card-accent-soft: rgba(242, 201, 109, 0.14);
  min-width: 0;
  min-height: clamp(310px, 33vh, 380px);
  height: auto;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  perspective: 1200px;
  position: relative;
  z-index: 1;
}

.help-flip-card:not(:last-child)::after {
  display: none;
}

.help-flip-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: block;
  transform-style: preserve-3d;
  transition: transform 640ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.help-flip-card.is-flipped .help-flip-card__inner {
  transform: rotateY(180deg);
}

.help-flip-card__face {
  position: absolute;
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--help-card-accent) 58%, transparent);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--help-card-accent) 22%, transparent), transparent 34%),
    linear-gradient(145deg, var(--help-card-accent-soft), transparent 46%),
    linear-gradient(180deg, rgba(15, 25, 36, 0.96), rgba(4, 10, 15, 0.98));
  box-shadow:
    0 22px 56px rgba(0, 0, 0, 0.5),
    0 0 34px color-mix(in srgb, var(--help-card-accent) 22%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backface-visibility: hidden;
  transform-style: preserve-3d;
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  align-content: start;
  justify-items: center;
  gap: clamp(8px, 0.75vw, 12px);
  padding: clamp(15px, 1.15vw, 19px);
  text-align: center;
  overflow: hidden;
}

.help-flip-card__face::after {
  content: "";
  position: absolute;
  inset: auto 13% clamp(12px, 1vw, 16px);
  height: 3px;
  border-radius: 999px;
  background: var(--help-card-accent);
  opacity: 0.72;
  box-shadow: 0 0 18px var(--help-card-accent);
}

.help-flip-card__face--front::before {
  display: none;
}

.help-flip-card__face--back {
  transform: rotateY(180deg);
  grid-template-rows: auto minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  text-align: center;
  padding: clamp(16px, 1.35vw, 20px) clamp(16px, 1.35vw, 20px) clamp(24px, 1.8vw, 28px);
}

.help-flip-card__number {
  justify-self: start;
  align-self: start;
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  min-height: 34px;
  border: 1px solid color-mix(in srgb, var(--help-card-accent) 48%, transparent);
  border-radius: 14px;
  background: rgba(5, 9, 14, 0.42);
  color: var(--help-card-accent);
  font-size: clamp(0.9rem, 1.2vw, 1.08rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  box-shadow: 0 0 18px var(--help-card-accent-soft);
}

.help-flip-card__icon {
  align-self: start;
  width: clamp(70px, 5vw, 96px);
  height: clamp(70px, 5vw, 96px);
  border: 1px solid color-mix(in srgb, var(--help-card-accent) 54%, transparent);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--help-card-accent) 32%, transparent), transparent 52%),
    rgba(255, 255, 255, 0.035);
  color: var(--help-card-accent);
  font-size: clamp(28px, 2.55vw, 44px);
  box-shadow:
    0 0 36px var(--help-card-accent-soft),
    inset 0 0 28px color-mix(in srgb, var(--help-card-accent) 16%, transparent);
  text-shadow: 0 0 22px var(--help-card-accent);
}

.help-flip-card strong {
  color: #f7f3ea;
  font-size: clamp(19px, 1.25vw, 23px);
  line-height: 1.08;
  overflow-wrap: anywhere;
  max-width: 95%;
}

.help-flip-card small {
  color: rgba(245, 239, 230, 0.72);
  font-size: clamp(0.78rem, 0.72vw, 0.88rem);
  line-height: 1.34;
  overflow: visible;
}

.help-flip-card__face--front small {
  max-width: 90%;
  align-self: start;
}

.help-flip-card__face--back small {
  max-width: 90%;
  align-self: center;
  line-height: 1.38;
}

.help-flip-card--rules {
  --help-card-accent: rgba(60, 172, 255, 0.9);
  --help-card-accent-soft: rgba(60, 172, 255, 0.16);
}

.help-flip-card--modes {
  --help-card-accent: rgba(242, 201, 109, 0.9);
  --help-card-accent-soft: rgba(242, 201, 109, 0.16);
}

.help-flip-card--sandbox {
  --help-card-accent: rgba(174, 95, 255, 0.9);
  --help-card-accent-soft: rgba(174, 95, 255, 0.16);
}

.help-flip-card--future {
  --help-card-accent: rgba(106, 222, 126, 0.88);
  --help-card-accent-soft: rgba(106, 222, 126, 0.15);
}

.help-flip-card:focus-visible {
  outline: 2px solid var(--help-card-accent);
  outline-offset: 4px;
}

.help-flip-card:hover .help-flip-card__inner {
  transform: translateY(-4px);
}

.help-flip-card.is-flipped:hover .help-flip-card__inner {
  transform: translateY(-4px) rotateY(180deg);
}

.shell-guide-page[hidden],
.shell-settings-page[hidden] {
  display: none;
}

.shell-guide-page,
.shell-settings-page {
  position: relative;
  min-height: calc(100dvh - clamp(36px, 4vw, 68px));
  height: calc(100dvh - clamp(36px, 4vw, 68px));
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  align-items: stretch;
  padding: clamp(10px, 1.2vw, 18px) 0;
  overflow: visible;
}

.shell-guide-page {
  width: min(1640px, 100%);
  padding: clamp(4px, 0.7vw, 10px) 0;
}

.shell-guide-page .shell-help-page-inner {
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  height: 100%;
}

.guide-page {
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
}

.guild-guide-slogan {
  margin-top: clamp(6px, 0.7vw, 9px) !important;
  color: rgba(255, 226, 150, 0.92) !important;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.guild-guide {
  width: 100%;
  min-height: 0;
  height: auto;
  margin-top: clamp(12px, 1.4vw, 18px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(clamp(150px, 19vh, 210px), 1fr));
  gap: clamp(10px, 1vw, 14px);
  align-items: stretch;
  perspective: 1200px;
}

.guild-guide-card {
  --guild-card-accent: rgba(242, 201, 109, 0.86);
  --guild-card-soft: rgba(242, 201, 109, 0.14);
  min-width: 0;
  min-height: clamp(150px, 19vh, 210px);
  height: auto;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  perspective: 1200px;
}

.guild-guide-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: block;
  transform-style: preserve-3d;
  transition: transform 640ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.guild-guide-card.is-flipped .guild-guide-card__inner {
  transform: rotateY(180deg);
}

.guild-guide-card__face {
  position: absolute;
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--guild-card-accent) 56%, transparent);
  border-radius: 18px;
  background:
    linear-gradient(145deg, var(--guild-card-soft), transparent 52%),
    linear-gradient(180deg, rgba(21, 28, 34, 0.96), rgba(7, 11, 15, 0.98));
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backface-visibility: hidden;
  transform-style: preserve-3d;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(8px, 0.9vw, 12px);
  padding: clamp(12px, 1.15vw, 17px);
  text-align: center;
  overflow: hidden;
}

.guild-guide-card__face--front > span {
  width: clamp(44px, 4.2vw, 58px);
  height: clamp(44px, 4.2vw, 58px);
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--guild-card-accent) 54%, transparent);
  border-radius: 18px;
  background: var(--guild-card-soft);
  color: var(--guild-card-accent);
  font-size: clamp(24px, 2.45vw, 32px);
  box-shadow: 0 0 24px var(--guild-card-soft);
}

.guild-guide-card__face--back {
  transform: rotateY(180deg);
}

.guild-guide-card strong {
  color: #f7f3ea;
  font-size: clamp(15px, 1.22vw, 20px);
  line-height: 1.12;
}

.guild-guide-card small {
  max-width: 210px;
  color: rgba(245, 239, 230, 0.72);
  font-size: clamp(0.76rem, 0.78vw, 0.86rem);
  line-height: 1.3;
}

.guild-guide-card--world,
.guild-guide-card--transit {
  --guild-card-accent: rgba(76, 196, 255, 0.86);
  --guild-card-soft: rgba(76, 196, 255, 0.14);
}

.guild-guide-card--poker,
.guild-guide-card--pieces {
  --guild-card-accent: rgba(255, 82, 92, 0.88);
  --guild-card-soft: rgba(255, 82, 92, 0.14);
}

.guild-guide-card--three,
.guild-guide-card--roles {
  --guild-card-accent: rgba(174, 95, 255, 0.88);
  --guild-card-soft: rgba(174, 95, 255, 0.14);
}

.guild-guide-card--four {
  --guild-card-accent: rgba(106, 222, 126, 0.86);
  --guild-card-soft: rgba(106, 222, 126, 0.14);
}

.guild-guide-card:focus-visible {
  outline: 2px solid var(--guild-card-accent);
  outline-offset: 4px;
}

.guild-guide-card:hover .guild-guide-card__inner {
  transform: translateY(-4px);
}

.guild-guide-card.is-flipped:hover .guild-guide-card__inner {
  transform: translateY(-4px) rotateY(180deg);
}

.settings-page {
  min-height: 0;
  height: 100%;
  width: 100%;
  display: grid;
}

.settings-dashboard {
  min-height: 0;
  display: grid;
}

.settings-dashboard__frame {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(210px, 0.72fr) minmax(360px, 1.36fr) minmax(210px, 0.72fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(12px, 1.2vw, 18px);
  border: 1px solid rgba(242, 201, 109, 0.24);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 12%, rgba(242, 201, 109, 0.18), transparent 32%),
    radial-gradient(circle at 18% 80%, rgba(60, 179, 126, 0.12), transparent 34%),
    radial-gradient(circle at 86% 68%, rgba(71, 178, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(13, 20, 26, 0.94), rgba(5, 9, 12, 0.98));
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  padding: clamp(14px, 1.4vw, 20px);
}

.settings-dashboard__frame::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 50% 45%, black, transparent 72%);
  pointer-events: none;
}

.settings-dashboard__left,
.settings-dashboard__right,
.settings-dashboard__center,
.settings-dashboard__bottom-bar {
  position: relative;
  z-index: 1;
}

.settings-dashboard__left,
.settings-dashboard__right {
  min-height: 0;
  display: grid;
  gap: clamp(10px, 1vw, 14px);
}

.settings-dashboard__center {
  min-height: 0;
  display: grid;
}

.settings-panel {
  min-width: 0;
  border: 1px solid rgba(242, 201, 109, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(242, 201, 109, 0.07), transparent 42%),
    rgba(7, 12, 16, 0.68);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 34px rgba(0, 0, 0, 0.26);
  padding: clamp(12px, 1.15vw, 16px);
  color: rgba(245, 239, 230, 0.82);
}

.settings-panel__title {
  margin: 0 0 clamp(9px, 0.9vw, 12px);
  color: #f4d086;
  font-size: clamp(0.74rem, 0.75vw, 0.86rem);
  font-weight: 900;
  letter-spacing: 0.16em;
}

.settings-panel__subtitle {
  margin: -4px 0 10px;
  color: rgba(245, 239, 230, 0.58);
  font-size: 0.82rem;
}

.settings-panel__list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(0.78rem, 0.84vw, 0.92rem);
  line-height: 1.25;
}

.settings-panel__list li {
  position: relative;
  padding-left: 14px;
}

.settings-panel__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(242, 201, 109, 0.78);
  box-shadow: 0 0 10px rgba(242, 201, 109, 0.28);
}

.settings-prep-meter {
  width: clamp(72px, 7vw, 92px);
  aspect-ratio: 1;
  margin: 0 auto clamp(10px, 1vw, 14px);
  display: grid;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(7, 12, 16, 0.95) 54%, transparent 56%),
    conic-gradient(from -35deg, rgba(242, 201, 109, 0.96), rgba(77, 214, 142, 0.82), rgba(242, 201, 109, 0.96));
  color: #fff1c5;
  font-weight: 900;
  box-shadow: 0 0 22px rgba(242, 201, 109, 0.16);
}

.settings-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.settings-chip-list span {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(245, 239, 230, 0.76);
  padding: 5px 9px;
  font-size: 0.74rem;
  font-weight: 800;
}

.settings-hero {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  justify-items: center;
  text-align: center;
  border: 1px solid rgba(113, 208, 255, 0.18);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 34%, rgba(242, 201, 109, 0.2), transparent 28%),
    radial-gradient(circle at 50% 72%, rgba(77, 214, 142, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(16, 27, 35, 0.9), rgba(5, 10, 13, 0.96));
  overflow: hidden;
  padding: clamp(18px, 2vw, 28px);
}

.settings-hero::before {
  content: "";
  position: absolute;
  inset: 18% 9% 15%;
  border: 1px solid rgba(242, 201, 109, 0.16);
  border-radius: 50%;
  transform: perspective(600px) rotateX(62deg);
  background:
    linear-gradient(90deg, transparent 48%, rgba(242, 201, 109, 0.14) 49%, rgba(242, 201, 109, 0.14) 51%, transparent 52%),
    linear-gradient(transparent 48%, rgba(113, 208, 255, 0.12) 49%, rgba(113, 208, 255, 0.12) 51%, transparent 52%);
  box-shadow:
    0 0 40px rgba(242, 201, 109, 0.12),
    inset 0 0 38px rgba(113, 208, 255, 0.08);
}

.settings-hero__eyebrow {
  position: relative;
  margin: 0 0 8px;
  color: #f4d086;
  font-size: clamp(0.68rem, 0.8vw, 0.82rem);
  font-weight: 900;
  letter-spacing: 0.22em;
}

.settings-hero__title {
  position: relative;
  margin: 0;
  color: #f7f3ea;
  font-size: clamp(34px, 4.3vw, 64px);
  line-height: 0.94;
  text-shadow: 0 0 24px rgba(242, 201, 109, 0.12);
}

.settings-hero__text {
  position: relative;
  max-width: 560px;
  margin: clamp(9px, 1vw, 13px) 0 0;
  color: rgba(230, 244, 248, 0.72);
  font-size: clamp(0.9rem, 1.05vw, 1.05rem);
  line-height: 1.35;
}

.settings-hero__stage {
  position: relative;
  width: min(420px, 82%);
  min-height: clamp(110px, 18vh, 190px);
  margin-top: clamp(12px, 1.6vw, 22px);
}

.settings-hero__stage::before,
.settings-hero__stage::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%) perspective(520px) rotateX(64deg);
}

.settings-hero__stage::before {
  width: 82%;
  height: 72%;
  border: 1px solid rgba(242, 201, 109, 0.28);
  box-shadow: 0 0 34px rgba(242, 201, 109, 0.16);
}

.settings-hero__stage::after {
  width: 50%;
  height: 42%;
  background: rgba(242, 201, 109, 0.12);
  filter: blur(12px);
}

.settings-hero__node {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: rgba(242, 201, 109, 0.88);
  box-shadow: 0 0 18px rgba(242, 201, 109, 0.4);
}

.settings-hero__node--north { left: 50%; top: 12%; }
.settings-hero__node--west { left: 17%; top: 58%; background: rgba(77, 214, 142, 0.86); }
.settings-hero__node--east { right: 17%; top: 58%; background: rgba(113, 208, 255, 0.86); }
.settings-hero__node--south { left: 50%; bottom: 8%; background: rgba(255, 82, 92, 0.8); }

.settings-hero__motto {
  position: relative;
  margin: 0;
  color: rgba(255, 226, 150, 0.9);
  font-size: clamp(0.7rem, 0.82vw, 0.86rem);
  font-weight: 900;
  letter-spacing: 0.12em;
}

.settings-panel--strategy p {
  margin: 0 0 7px;
  color: rgba(245, 239, 230, 0.72);
  font-size: clamp(0.78rem, 0.84vw, 0.92rem);
}

.settings-mini-map {
  height: 48px;
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.settings-mini-map span {
  border: 1px solid rgba(113, 208, 255, 0.2);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(113, 208, 255, 0.14), transparent),
    rgba(255, 255, 255, 0.035);
}

.settings-progress-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.settings-progress-list label {
  display: grid;
  gap: 5px;
  color: rgba(245, 239, 230, 0.72);
  font-size: 0.76rem;
}

.settings-progress-list i {
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(242, 201, 109, 0.86) var(--value), rgba(255, 255, 255, 0.09) var(--value));
}

.settings-dashboard__bottom-bar {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  border: 1px solid rgba(242, 201, 109, 0.16);
  border-radius: 18px;
  background: rgba(3, 7, 10, 0.7);
  padding: 9px;
}

.settings-bottom-nav__item {
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(245, 239, 230, 0.68);
  font: inherit;
  font-size: clamp(0.76rem, 0.86vw, 0.92rem);
  font-weight: 800;
}

.settings-bottom-nav__item.is-active {
  border-color: rgba(242, 201, 109, 0.5);
  background: rgba(242, 201, 109, 0.13);
  color: rgba(255, 236, 185, 0.96);
  box-shadow: 0 0 22px rgba(242, 201, 109, 0.12);
}

.figure-view {
  min-height: 0;
  height: 100%;
  width: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) minmax(36px, auto);
  gap: clamp(4px, 0.58vw, 9px);
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(26, 93, 190, 0.24), transparent 34%),
    radial-gradient(circle at 50% 100%, rgba(242, 201, 109, 0.1), transparent 34%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(180deg, rgba(2, 14, 34, 0.98), rgba(1, 5, 13, 0.99));
  background-size: auto, auto, 52px 52px, 52px 52px, auto;
  box-shadow: none;
  overflow: visible;
  padding: clamp(14px, 1.25vw, 20px) clamp(12px, 1.5vw, 24px) clamp(8px, 0.8vw, 12px);
}

.figure-view:focus {
  outline: none;
}

.figure-view__header {
  text-align: left;
}

.figure-view__panel-title {
  margin: 0 0 5px;
  color: #f4d086;
  font-size: clamp(0.62rem, 0.7vw, 0.76rem);
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.figure-view__eyebrow {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.figure-view__header h2 {
  margin: 0;
  color: #f7f3ea;
  font-size: clamp(22px, 2vw, 34px);
  line-height: 0.96;
}

.figure-view__header p:not(.figure-view__eyebrow) {
  max-width: 520px;
  margin: 2px 0 0;
  color: rgba(232, 242, 245, 0.42);
  font-size: clamp(0.64rem, 0.68vw, 0.76rem);
  line-height: 1.16;
}

.figure-view__top-tabs {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  padding-top: 4px;
}

.figure-tab {
  min-width: 0;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(245, 239, 230, 0.72);
  cursor: pointer;
  font: inherit;
  font-size: clamp(0.76rem, 0.84vw, 0.9rem);
  font-weight: 900;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.figure-tab:hover,
.figure-tab:focus-visible {
  border-color: rgba(242, 201, 109, 0.44);
  color: rgba(255, 238, 190, 0.92);
  outline: none;
  transform: translateY(-1px);
}

.figure-tab.is-active {
  border-color: rgba(242, 201, 109, 0.72);
  background:
    linear-gradient(135deg, rgba(242, 201, 109, 0.2), rgba(76, 196, 255, 0.07)),
    rgba(255, 255, 255, 0.06);
  color: #ffe9a8;
  box-shadow: 0 0 24px rgba(242, 201, 109, 0.12);
}

.figure-view__layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(520px, 1fr) minmax(320px, 400px);
  gap: clamp(14px, 1.55vw, 26px);
  align-items: stretch;
}

.figure-view__side,
.figure-view__details,
.figure-view__center {
  min-width: 0;
  min-height: 0;
}

.figure-view__side,
.figure-view__details {
  border: 1px solid rgba(242, 201, 109, 0.13);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(242, 201, 109, 0.045), transparent 44%),
    rgba(6, 11, 17, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: clamp(9px, 0.9vw, 13px);
}

.figure-view__side-menu {
  display: grid;
  gap: 7px;
}

.figure-view__side-menu button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: rgba(245, 239, 230, 0.72);
  font: inherit;
  font-weight: 800;
  text-align: left;
  padding: 0 12px;
}

.figure-view__side-menu button.is-active {
  border-color: rgba(242, 201, 109, 0.32);
  background: rgba(242, 201, 109, 0.1);
  color: rgba(255, 236, 185, 0.96);
}

.figure-view__center {
  display: grid;
  align-items: center;
}

.figure-piece-stage {
  position: relative;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 41%, rgba(78, 161, 255, 0.3), transparent 34%),
    radial-gradient(circle at 50% 58%, rgba(242, 201, 109, 0.06), transparent 34%),
    radial-gradient(ellipse at 50% 84%, rgba(242, 201, 109, 0.14), transparent 38%);
  overflow: hidden;
}

.figure-piece-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 47%, transparent 60%, rgba(2, 8, 18, 0.14) 84%, rgba(2, 8, 18, 0.36) 100%),
    radial-gradient(ellipse at 50% 81%, rgba(78, 161, 255, 0.2), transparent 36%),
    radial-gradient(ellipse at 50% 49%, transparent 34%, rgba(242, 201, 109, 0.06) 35%, transparent 36%, transparent 50%, rgba(242, 201, 109, 0.04) 51%, transparent 52%);
  box-shadow:
    inset 0 0 48px rgba(0, 0, 0, 0.38),
    inset 0 -22px 56px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}

.figure-piece-stage::before {
  content: "";
  position: absolute;
  z-index: 1;
  width: min(500px, 76%);
  height: 21%;
  left: 50%;
  bottom: 7%;
  border: 1px solid rgba(242, 201, 109, 0.22);
  border-radius: 50%;
  transform: translateX(-50%) perspective(560px) rotateX(66deg);
  background:
    radial-gradient(ellipse at 50% 50%, rgba(100, 182, 255, 0.2), transparent 58%),
    rgba(242, 201, 109, 0.045);
  box-shadow:
    0 0 54px rgba(48, 143, 255, 0.2),
    0 0 22px rgba(242, 201, 109, 0.1),
    inset 0 0 30px rgba(242, 201, 109, 0.08);
}

.figure-piece-stage__image {
  display: block;
  position: relative;
  z-index: 2;
  width: auto;
  height: clamp(360px, 58vh, 660px);
  max-width: var(--figure-image-max-width, 78%);
  max-height: 84%;
  margin: -2vh auto 0;
  object-fit: contain;
  object-position: var(--figure-image-object-position, center bottom);
  border-radius: 28px;
  transform:
    translate(
      var(--figure-image-offset-x, 0px),
      var(--figure-image-offset-y, 0px)
    )
    scale(var(--figure-image-scale, 1));
  transform-origin: center bottom;
  -webkit-mask-image: radial-gradient(ellipse at 50% 48%, #000 48%, rgba(0, 0, 0, 0.88) 64%, transparent 92%);
  mask-image: radial-gradient(ellipse at 50% 48%, #000 48%, rgba(0, 0, 0, 0.88) 64%, transparent 92%);
  filter:
    drop-shadow(0 24px 34px rgba(0, 0, 0, 0.58))
    drop-shadow(0 0 34px rgba(65, 145, 255, 0.16));
}

.figure-piece-stage__fallback {
  position: relative;
  z-index: 2;
  width: min(360px, 58%);
  aspect-ratio: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  border: 1px solid rgba(242, 201, 109, 0.36);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 245, 220, 0.16), transparent 42%),
    radial-gradient(circle at 50% 70%, rgba(76, 196, 255, 0.13), transparent 58%),
    rgba(2, 9, 20, 0.62);
  color: rgba(255, 245, 220, 0.94);
  line-height: 1;
  transform:
    translate(
      var(--figure-image-offset-x, 0px),
      var(--figure-image-offset-y, 0px)
    )
    scale(var(--figure-image-scale, 1));
  transform-origin: center bottom;
  box-shadow:
    0 0 56px rgba(76, 196, 255, 0.22),
    0 0 34px rgba(242, 201, 109, 0.13),
    inset 0 0 44px rgba(255, 245, 220, 0.055);
  text-shadow:
    0 0 34px rgba(242, 201, 109, 0.34),
    0 26px 44px rgba(0, 0, 0, 0.45);
}

.figure-piece-stage__fallback b {
  font-size: clamp(120px, 10.5vw, 220px);
  font-weight: 400;
}

.figure-piece-stage__fallback small {
  max-width: 230px;
  color: rgba(255, 236, 185, 0.78);
  font-size: clamp(0.74rem, 0.88vw, 0.94rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.figure-media-stage {
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  align-items: center;
}

.figure-media-stage__frame {
  position: relative;
  width: 100%;
  min-height: clamp(280px, 42vh, 520px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(242, 201, 109, 0.2);
  border-radius: 20px;
  background:
    radial-gradient(circle at 24% 18%, rgba(242, 201, 109, 0.16), transparent 30%),
    radial-gradient(circle at 74% 42%, rgba(77, 164, 255, 0.18), transparent 38%),
    linear-gradient(135deg, rgba(8, 19, 35, 0.96), rgba(3, 8, 17, 0.96));
  box-shadow:
    0 24px 72px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 60px rgba(34, 104, 190, 0.12);
}

.figure-media-stage__frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, transparent 50%, rgba(1, 5, 12, 0.68) 100%);
  background-size:
    42px 42px,
    42px 42px,
    100% 100%;
  opacity: 0.52;
  pointer-events: none;
}

.figure-media-stage__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.045),
    inset 0 0 48px rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.figure-media-stage__image,
.figure-media-stage__video {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: var(--figure-media-fit, contain);
  object-position: center center;
  background: rgba(2, 8, 18, 0.96);
}

.figure-media-stage__image[hidden],
.figure-media-stage__video[hidden],
.figure-media-stage__placeholder[hidden] {
  display: none;
}

.figure-media-stage__placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: clamp(22px, 3vw, 42px);
  text-align: center;
  color: rgba(255, 245, 220, 0.9);
  background:
    radial-gradient(circle at 50% 40%, rgba(242, 201, 109, 0.13), transparent 34%),
    radial-gradient(circle at 50% 58%, rgba(73, 157, 255, 0.14), transparent 44%);
}

.figure-media-stage__placeholder span {
  display: grid;
  place-items: center;
  width: clamp(72px, 8vw, 104px);
  height: clamp(72px, 8vw, 104px);
  border: 1px solid rgba(242, 201, 109, 0.34);
  border-radius: 999px;
  color: rgba(255, 238, 196, 0.86);
  font-size: clamp(2.25rem, 5vw, 4.6rem);
  line-height: 1;
  background: rgba(2, 8, 18, 0.46);
  box-shadow: 0 0 34px rgba(77, 164, 255, 0.16);
}

.figure-media-stage__placeholder strong {
  font-size: clamp(1.05rem, 1.5vw, 1.55rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.figure-media-stage__placeholder small {
  max-width: 430px;
  color: rgba(225, 217, 201, 0.72);
  font-size: clamp(0.84rem, 0.95vw, 1rem);
  font-weight: 700;
  line-height: 1.55;
}

.figure-view__details h3 {
  margin: 0;
  color: #f7f3ea;
  font-size: clamp(24px, 2.05vw, 34px);
  line-height: 1;
}

.figure-view__type {
  margin: 5px 0 7px;
  color: rgba(255, 226, 150, 0.88);
  font-weight: 800;
  font-size: clamp(0.78rem, 0.84vw, 0.92rem);
}

.figure-rating {
  display: flex;
  gap: 4px;
  color: rgba(242, 201, 109, 0.9);
  margin-bottom: 7px;
}

.figure-stats {
  display: grid;
  gap: 6px;
}

.figure-stat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  color: rgba(245, 239, 230, 0.72);
  font-size: clamp(0.7rem, 0.74vw, 0.82rem);
}

.figure-stat strong {
  color: rgba(255, 236, 185, 0.92);
}

.figure-stat__bar {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.figure-stat__fill {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(242, 201, 109, 0.9), rgba(76, 196, 255, 0.72));
  box-shadow: 0 0 12px rgba(242, 201, 109, 0.18);
}

.figure-view__description {
  margin: 10px 0 0;
  color: rgba(232, 242, 245, 0.72);
  font-size: clamp(0.72rem, 0.78vw, 0.86rem);
  line-height: 1.3;
}

.figure-section-panel {
  display: grid;
  gap: clamp(10px, 1vw, 14px);
  margin-top: 10px;
  color: rgba(232, 242, 245, 0.75);
  font-size: clamp(0.76rem, 0.84vw, 0.92rem);
  line-height: 1.38;
}

.figure-section-panel p {
  margin: 0;
}

.figure-section-note {
  color: rgba(232, 242, 245, 0.62);
  font-size: clamp(0.7rem, 0.76vw, 0.84rem);
  line-height: 1.32;
}

.figure-section-extra {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.figure-section-extra h4 {
  margin: 0;
  color: rgba(242, 201, 109, 0.88);
  font-size: clamp(0.8rem, 0.86vw, 0.96rem);
  line-height: 1.15;
}

.figure-section-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.figure-section-list li {
  position: relative;
  padding-left: 18px;
  color: rgba(255, 236, 185, 0.82);
  font-weight: 800;
}

.figure-section-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(242, 201, 109, 0.78);
  box-shadow: 0 0 12px rgba(242, 201, 109, 0.26);
}

.figure-section-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}

.figure-section-chips span {
  border: 1px solid rgba(242, 201, 109, 0.22);
  border-radius: 999px;
  background: rgba(242, 201, 109, 0.075);
  color: rgba(255, 236, 185, 0.78);
  padding: 5px 9px;
  font-size: clamp(0.66rem, 0.72vw, 0.78rem);
  font-weight: 900;
}

.figure-action-bar {
  display: grid;
  grid-template-columns: minmax(120px, max-content);
  gap: clamp(7px, 0.75vw, 10px);
  justify-content: start;
  align-self: end;
}

.figure-action-bar button {
  min-height: 32px;
  border: 1px solid rgba(192, 139, 69, 0.42);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(242, 201, 109, 0.12), rgba(5, 15, 31, 0.72)),
    rgba(255, 255, 255, 0.035);
  color: rgba(255, 230, 170, 0.9);
  font: inherit;
  font-size: clamp(0.7rem, 0.75vw, 0.84rem);
  font-weight: 900;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 10px 22px rgba(0, 0, 0, 0.2);
}

.figure-action-bar .figure-action-back {
  justify-self: stretch;
  padding: 0 14px;
  border-color: rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(5, 12, 24, 0.74)),
    rgba(5, 8, 12, 0.42);
  color: rgba(245, 239, 230, 0.84);
}

.figure-view__header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  text-align: left;
}

.figure-view__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.figure-view__crest {
  width: clamp(34px, 3.1vw, 46px);
  height: clamp(34px, 3.1vw, 46px);
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 201, 109, 0.34);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(242, 201, 109, 0.18), transparent 58%),
    rgba(255, 255, 255, 0.035);
  color: #ffe6a6;
  font-size: clamp(18px, 1.9vw, 26px);
  box-shadow: 0 0 26px rgba(242, 201, 109, 0.14);
}

.figure-view__top-tabs {
  width: min(680px, 100%);
  justify-self: center;
  align-items: start;
  gap: clamp(6px, 0.75vw, 10px);
  padding-top: 4px;
}

.figure-tab {
  min-height: auto;
  display: grid;
  justify-items: center;
  gap: 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(226, 190, 126, 0.78);
  padding: 0;
  box-shadow: none;
}

.figure-tab__icon {
  position: relative;
  width: clamp(42px, 4.1vw, 60px);
  height: clamp(42px, 4.1vw, 60px);
  display: grid;
  place-items: center;
  border: 1px solid rgba(192, 139, 69, 0.5);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 236, 180, 0.12), transparent 54%),
    rgba(2, 9, 20, 0.64);
  color: rgba(242, 201, 109, 0.86);
  font-size: clamp(22px, 2.4vw, 32px);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.figure-tab__label {
  color: inherit;
  font-size: clamp(0.68rem, 0.78vw, 0.88rem);
  font-weight: 800;
}

.figure-tab:hover,
.figure-tab:focus-visible {
  transform: none;
}

.figure-tab:hover .figure-tab__icon,
.figure-tab:focus-visible .figure-tab__icon {
  border-color: rgba(255, 232, 166, 0.74);
  color: #ffe8b1;
  transform: translateY(-2px);
}

.figure-tab.is-locked {
  color: rgba(226, 190, 126, 0.42);
  cursor: not-allowed;
  opacity: 0.58;
}

.figure-tab.is-locked .figure-tab__icon {
  border-color: rgba(192, 139, 69, 0.24);
  background: rgba(2, 9, 20, 0.42);
  color: rgba(242, 201, 109, 0.42);
  box-shadow: none;
  transform: none;
}

.figure-tab.is-locked .figure-tab__icon::after {
  content: "🔒";
  position: absolute;
  right: -5px;
  top: -6px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 201, 109, 0.32);
  border-radius: 999px;
  background: rgba(4, 8, 14, 0.92);
  color: rgba(255, 232, 166, 0.82);
  font-size: 10px;
  line-height: 1;
}

.figure-tab.is-locked:hover .figure-tab__icon,
.figure-tab.is-locked:focus-visible .figure-tab__icon {
  border-color: rgba(192, 139, 69, 0.24);
  color: rgba(242, 201, 109, 0.42);
  box-shadow: none;
  transform: none;
}

.figure-tab.is-active {
  background: transparent;
  box-shadow: none;
  color: #ffe8b1;
}

.figure-tab.is-active .figure-tab__icon {
  border-color: rgba(255, 242, 210, 0.9);
  color: #fff3d0;
  box-shadow:
    0 0 0 4px rgba(242, 201, 109, 0.08),
    0 0 30px rgba(255, 238, 190, 0.42);
}

.figure-view__layout {
  grid-template-columns: minmax(220px, 280px) minmax(520px, 1fr) minmax(320px, 400px);
  gap: clamp(18px, 2vw, 34px);
  align-items: stretch;
}

.figure-view__side {
  display: grid;
  grid-template-rows: auto auto;
  align-content: space-between;
  gap: clamp(10px, 1.1vw, 14px);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.figure-side-menu {
  align-content: start;
  gap: clamp(8px, 1.3vh, 16px);
}

.figure-side-menu__item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px !important;
  border: 0 !important;
  background: transparent !important;
  color: rgba(226, 190, 126, 0.78) !important;
  padding: 0 !important;
  cursor: pointer;
  transition:
    color 0.18s ease,
    text-shadow 0.18s ease,
    transform 0.18s ease;
}

.figure-side-menu__item:hover,
.figure-side-menu__item:focus-visible {
  color: rgba(255, 232, 178, 0.94) !important;
  outline: none;
  transform: translateX(2px);
}

.figure-side-menu__icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: rgba(242, 201, 109, 0.88);
  font-size: 1.25rem;
  text-shadow: 0 0 16px rgba(242, 201, 109, 0.18);
}

.figure-side-menu__label {
  font-size: clamp(0.9rem, 1.02vw, 1.18rem);
  line-height: 1.1;
}

.figure-side-menu__item.is-active {
  color: #fff3d0 !important;
  text-shadow: 0 0 18px rgba(255, 238, 190, 0.28);
}

.figure-side-menu__item.is-active .figure-side-menu__icon {
  color: #fff3d0;
  text-shadow:
    0 0 20px rgba(255, 238, 190, 0.32),
    0 0 10px rgba(242, 201, 109, 0.22);
}

.figure-side-menu__item.is-locked {
  color: rgba(226, 190, 126, 0.38) !important;
  cursor: not-allowed;
  opacity: 0.58;
}

.figure-side-menu__item.is-locked:hover,
.figure-side-menu__item.is-locked:focus-visible {
  color: rgba(226, 190, 126, 0.38) !important;
  transform: none;
  text-shadow: none;
}

.figure-side-menu__item.is-locked .figure-side-menu__icon {
  color: rgba(242, 201, 109, 0.38);
  text-shadow: none;
}

.figure-side-menu__item.is-locked .figure-side-menu__label::after {
  content: " 🔒";
  color: rgba(255, 232, 166, 0.72);
  font-size: 0.78em;
}

.figure-value-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(192, 139, 69, 0.38);
  border-radius: 28px;
  background: rgba(3, 10, 20, 0.58);
  padding: 10px;
}

.figure-value-card__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 201, 109, 0.38);
  border-radius: 999px;
  color: rgba(242, 201, 109, 0.9);
  font-size: 1.7rem;
}

.figure-value-card p {
  margin: 0;
  color: rgba(242, 201, 109, 0.9);
  font-size: clamp(0.92rem, 1vw, 1.05rem);
  font-weight: 900;
}

.figure-value-card strong {
  display: block;
  margin: 2px 0 7px;
  color: rgba(255, 245, 220, 0.9);
  font-size: 0.9rem;
}

.figure-value-card i {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.figure-value-card b {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(242, 201, 109, 0.95), rgba(255, 236, 180, 0.7));
}

.figure-piece-stage {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  border-color: rgba(192, 139, 69, 0.12);
  background:
    radial-gradient(circle at 50% 41%, rgba(78, 161, 255, 0.3), transparent 34%),
    radial-gradient(circle at 50% 58%, rgba(242, 201, 109, 0.06), transparent 34%),
    radial-gradient(ellipse at 50% 84%, rgba(242, 201, 109, 0.14), transparent 38%);
  background-size: auto;
}

.figure-piece-stage__image {
  display: block;
  width: auto;
  height: clamp(360px, 58vh, 660px);
  max-width: var(--figure-image-max-width, 78%);
  max-height: 84%;
  margin: -2vh auto 0;
  object-position: var(--figure-image-object-position, center bottom);
  border-radius: 28px;
  transform:
    translate(
      var(--figure-image-offset-x, 0px),
      var(--figure-image-offset-y, 0px)
    )
    scale(var(--figure-image-scale, 1));
  transform-origin: center bottom;
  -webkit-mask-image: radial-gradient(ellipse at 50% 48%, #000 48%, rgba(0, 0, 0, 0.88) 64%, transparent 92%);
  mask-image: radial-gradient(ellipse at 50% 48%, #000 48%, rgba(0, 0, 0, 0.88) 64%, transparent 92%);
  filter:
    drop-shadow(0 24px 34px rgba(0, 0, 0, 0.58))
    drop-shadow(0 0 34px rgba(65, 145, 255, 0.16));
}

.figure-piece-stage__fallback {
  width: min(360px, 58%);
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 245, 220, 0.16), transparent 42%),
    radial-gradient(circle at 50% 70%, rgba(76, 196, 255, 0.13), transparent 58%),
    rgba(2, 9, 20, 0.62);
}

.figure-piece-stage__fallback b {
  font-size: clamp(120px, 10.5vw, 220px);
}

.figure-view__details {
  align-self: stretch;
  display: grid;
  align-content: start;
  min-height: 0;
  overflow: visible;
  padding: clamp(8px, 0.75vw, 11px);
  border-color: rgba(192, 139, 69, 0.34);
  background:
    linear-gradient(180deg, rgba(6, 15, 30, 0.82), rgba(2, 7, 15, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 16px 42px rgba(0, 0, 0, 0.24);
}

.figure-profile-card {
  border: 1px solid rgba(192, 139, 69, 0.32);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  padding: 8px 9px;
}

.figure-more-button {
  width: 100%;
  min-height: 28px;
  margin-top: 7px;
  border: 1px solid rgba(242, 201, 109, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 236, 185, 0.9);
  font: inherit;
  font-weight: 900;
}

.figure-description-title {
  margin: 7px 0 3px;
  color: rgba(242, 201, 109, 0.88);
  font-size: clamp(0.88rem, 1vw, 1.05rem);
  text-align: center;
}

.figure-action-bar {
  width: 100%;
  justify-self: stretch;
  grid-template-columns: minmax(220px, 280px) minmax(520px, 1fr) minmax(320px, 400px);
  gap: clamp(18px, 2vw, 34px);
  margin-top: 0;
}

.figure-action-bar .figure-action-back {
  grid-column: 1;
  justify-self: start;
}

:root[data-app-skin="imba-classic-light"] .figure-view,
:root[data-app-skin="imba-classic-light"] .figure-view__side,
:root[data-app-skin="imba-classic-light"] .figure-view__details,
:root[data-app-skin="imba-classic-light"] .figure-piece-stage,
:root[data-app-skin="imba-classic-light"] .figure-media-stage__frame {
  background: rgba(255, 252, 242, 0.84);
  border-color: rgba(111, 83, 43, 0.22);
  color: var(--skin-page-text);
}

:root[data-app-skin="imba-classic-light"] .figure-view__header h2,
:root[data-app-skin="imba-classic-light"] .figure-view__details h3 {
  color: var(--skin-page-text);
}

:root[data-app-skin="imba-classic-light"] .figure-view__header p:not(.figure-view__eyebrow),
:root[data-app-skin="imba-classic-light"] .figure-view__description,
:root[data-app-skin="imba-classic-light"] .figure-stat {
  color: var(--skin-muted);
}

:root[data-app-skin="imba-classic-light"] .shell-help-back {
  border-color: rgba(111, 83, 43, 0.22);
  background: rgba(255, 252, 242, 0.74);
  color: #3a3022;
  box-shadow: 0 8px 22px rgba(85, 62, 32, 0.1);
}

:root[data-app-skin="imba-classic-light"] .shell-help-card {
  background: var(--skin-panel-bg-strong);
  border-color: var(--skin-panel-border);
  box-shadow: var(--skin-shadow-soft);
  color: var(--skin-page-text);
}

:root[data-app-skin="imba-classic-light"] .shell-help-kicker {
  color: var(--skin-gold);
}

:root[data-app-skin="imba-classic-light"] .shell-help-card h2 {
  color: var(--skin-page-text);
}

:root[data-app-skin="imba-classic-light"] .shell-help-card > p:not(.shell-help-kicker) {
  color: var(--skin-muted);
}

:root[data-app-skin="imba-classic-light"] .help-flip-card__face {
  border-color: rgba(111, 83, 43, 0.24);
  background:
    linear-gradient(145deg, var(--help-card-accent-soft), transparent 42%),
    rgba(255, 252, 242, 0.94);
}

:root[data-app-skin="imba-classic-light"] .help-flip-card strong {
  color: var(--skin-page-text);
}

:root[data-app-skin="imba-classic-light"] .help-flip-card small {
  color: var(--skin-muted);
}

:root[data-app-skin="imba-classic-light"] .guild-guide-card__face {
  border-color: rgba(111, 83, 43, 0.24);
  background:
    linear-gradient(145deg, var(--guild-card-soft), transparent 42%),
    rgba(255, 252, 242, 0.94);
}

:root[data-app-skin="imba-classic-light"] .guild-guide-card strong {
  color: var(--skin-page-text);
}

:root[data-app-skin="imba-classic-light"] .guild-guide-card small,
:root[data-app-skin="imba-classic-light"] .guild-guide-slogan {
  color: var(--skin-muted);
}

:root[data-app-skin="imba-classic-light"] .settings-dashboard__frame {
  background:
    radial-gradient(circle at 50% 12%, rgba(183, 137, 52, 0.16), transparent 32%),
    rgba(255, 252, 242, 0.95);
  border-color: var(--skin-panel-border);
  box-shadow: var(--skin-shadow-soft);
}

:root[data-app-skin="imba-classic-light"] .settings-panel,
:root[data-app-skin="imba-classic-light"] .settings-hero,
:root[data-app-skin="imba-classic-light"] .settings-dashboard__bottom-bar {
  background: rgba(255, 252, 242, 0.72);
  border-color: rgba(111, 83, 43, 0.22);
  color: var(--skin-page-text);
}

:root[data-app-skin="imba-classic-light"] .settings-hero__title,
:root[data-app-skin="imba-classic-light"] .settings-panel__title {
  color: var(--skin-page-text);
}

:root[data-app-skin="imba-classic-light"] .settings-hero__text,
:root[data-app-skin="imba-classic-light"] .settings-panel__list,
:root[data-app-skin="imba-classic-light"] .settings-panel--strategy p,
:root[data-app-skin="imba-classic-light"] .settings-progress-list label {
  color: var(--skin-muted);
}

@media (max-width: 1100px) {
  .help-flip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .help-flip-card::after {
    display: none !important;
  }

  .help-flip-card {
    min-height: clamp(300px, 34vh, 380px);
  }

  .settings-dashboard__frame {
    grid-template-columns: minmax(180px, 0.68fr) minmax(300px, 1.2fr) minmax(180px, 0.68fr);
    gap: 10px;
  }

  .settings-panel {
    padding: 11px;
  }

  .figure-view__layout {
    grid-template-columns: minmax(150px, 190px) minmax(300px, 1fr) minmax(230px, 290px);
    gap: 10px;
  }

  .figure-piece-stage {
    height: clamp(300px, 44vh, 460px);
  }

  .figure-media-stage__frame {
    min-height: clamp(250px, 36vh, 420px);
  }

  .figure-piece-stage__image {
    max-height: clamp(250px, 38vh, 420px);
  }

  .figure-view__details h3 {
    font-size: clamp(21px, 2vw, 30px);
  }

  .figure-side-menu__label {
    font-size: clamp(0.82rem, 0.95vw, 1rem);
  }
}

@media (max-width: 900px) {
  .guild-guide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(160px, auto));
  }

  .settings-dashboard__frame {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto auto;
  }

  .settings-dashboard__center {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 360px;
  }

  .settings-dashboard__left,
  .settings-dashboard__right {
    grid-row: 2;
  }

  .settings-dashboard__bottom-bar {
    grid-row: 3;
  }

  .figure-view {
    height: auto;
  }

  .figure-view__top-tabs {
    display: flex;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .figure-tab {
    flex: 0 0 auto;
    min-width: 112px;
  }

  .figure-view__layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .figure-view__side {
    order: 2;
  }

  .figure-view__center {
    order: 1;
    min-height: 0;
  }

  .figure-piece-stage {
    height: clamp(320px, 52vh, 500px);
  }

  .figure-media-stage__frame {
    min-height: clamp(240px, 46vh, 430px);
  }

  .figure-view__details {
    order: 3;
    overflow: visible;
  }
}

@media (max-width: 640px) {
  .shell-help-page {
    height: auto;
    min-height: calc(100dvh - clamp(36px, 4vw, 68px));
  }

  .shell-help-page-inner,
  .shell-help-card {
    min-height: 0;
  }

  .help-flip-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .help-flip-card {
    min-height: 300px;
    height: auto;
  }

  .shell-guide-page,
  .shell-settings-page {
    height: auto;
    min-height: calc(100dvh - clamp(36px, 4vw, 68px));
  }

  .settings-page,
  .settings-dashboard {
    height: auto;
  }

  .settings-dashboard__frame {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    padding: 12px;
  }

  .settings-dashboard__center,
  .settings-dashboard__left,
  .settings-dashboard__right,
  .settings-dashboard__bottom-bar {
    grid-column: 1;
    grid-row: auto;
  }

  .settings-dashboard__center {
    min-height: 360px;
  }

  .settings-dashboard__bottom-bar {
    grid-template-columns: 1fr;
  }

  .figure-action-bar {
    grid-template-columns: 1fr;
  }

  .figure-piece-stage__fallback {
    width: min(300px, 72%);
  }

  .figure-piece-stage__fallback b {
    font-size: clamp(92px, 28vw, 160px);
  }

  .figure-media-stage__frame {
    min-height: 220px;
    border-radius: 16px;
  }

  .guild-guide {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    height: auto;
  }

  .guild-guide-card {
    min-height: 210px;
    height: auto;
  }
}

.trailer-video-slot {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  overflow: hidden;
  border: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 210, 95, 0.16), transparent 44%),
    rgba(5, 8, 12, 0.72);
  cursor: pointer;
  padding: 0;
}

.trailer-video-poster {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.trailer-video-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.46));
}

.trailer-play-button {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 232, 160, 0.72);
  border-radius: 999px;
  background: rgba(12, 10, 5, 0.56);
  color: rgba(255, 232, 160, 0.96);
  font-size: 32px;
  box-shadow: 0 0 24px rgba(255, 210, 95, 0.22);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.trailer-video-slot:hover .trailer-play-button,
.trailer-video-slot:focus-visible .trailer-play-button {
  transform: translate(-50%, -50%) scale(1.04);
}

.trailer-video-slot:focus-visible {
  outline: 2px solid rgba(255, 210, 95, 0.65);
  outline-offset: 3px;
}

.trailer-video-slot.has-missing-poster::before {
  content: "Трейлер ИМБАCHESS";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 232, 160, 0.84);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trailer-modal[hidden] {
  display: none;
}

.trailer-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 32px;
}

.trailer-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.trailer-modal-card {
  position: relative;
  z-index: 1;
  width: min(1100px, 92vw);
  border: 1px solid rgba(255, 210, 95, 0.28);
  border-radius: 20px;
  background: rgba(5, 8, 12, 0.92);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.52);
  padding: 18px;
}

.trailer-modal-close {
  position: absolute;
  right: 14px;
  top: 10px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  cursor: pointer;
}

.trailer-modal-video-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background: #000;
}

.trailer-modal-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.trailer-video-fallback {
  color: #fff;
  padding: 18px;
}

/* =========================================================
   UI Skin: IMBA Classic Light
   Override layer only; IMBA Dark remains the protected baseline.
   ========================================================= */

:root[data-app-skin="imba-classic-light"] .lobby-welcome,
:root[data-app-skin="imba-classic-light"] .lobby-panel {
  background: var(--skin-panel-bg);
  border-color: var(--skin-panel-border);
  box-shadow: var(--skin-shadow-soft);
  color: var(--skin-page-text);
}

:root[data-app-skin="imba-classic-light"] .lobby-panel-blue,
:root[data-app-skin="imba-classic-light"] .lobby-panel-purple,
:root[data-app-skin="imba-classic-light"] .lobby-panel-green {
  background: var(--skin-panel-bg);
  border-color: var(--skin-panel-border);
}

:root[data-app-skin="imba-classic-light"] .lobby-title,
:root[data-app-skin="imba-classic-light"] .lobby-panel h2,
:root[data-app-skin="imba-classic-light"] .lobby-panel h3,
:root[data-app-skin="imba-classic-light"] .lobby-welcome strong {
  color: var(--skin-page-text);
  text-shadow: none;
}

:root[data-app-skin="imba-classic-light"] .lobby-subtitle,
:root[data-app-skin="imba-classic-light"] .lobby-panel p,
:root[data-app-skin="imba-classic-light"] .lobby-welcome small,
:root[data-app-skin="imba-classic-light"] .guest-sandbox-description,
:root[data-app-skin="imba-classic-light"] .lobby-hint {
  color: var(--skin-muted);
}

:root[data-app-skin="imba-classic-light"] .lobby-crown,
:root[data-app-skin="imba-classic-light"] .lobby-welcome-icon,
:root[data-app-skin="imba-classic-light"] .lobby-panel-icon {
  color: var(--skin-gold);
  filter: none;
  text-shadow: none;
}

:root[data-app-skin="imba-classic-light"] .lobby-big-cta,
:root[data-app-skin="imba-classic-light"] .lobby-guide-button,
:root[data-app-skin="imba-classic-light"] .lobby-apply {
  background: linear-gradient(180deg, var(--skin-green), var(--skin-green-strong));
  border-color: rgba(49, 86, 47, 0.42);
  box-shadow: 0 14px 34px rgba(49, 86, 47, 0.18);
  color: #fffaf0;
}

:root[data-app-skin="imba-classic-light"] .lobby-settings-list label,
:root[data-app-skin="imba-classic-light"] .lobby-input-list div,
:root[data-app-skin="imba-classic-light"] .lobby-feature-grid span,
:root[data-app-skin="imba-classic-light"] .lobby-video-card,
:root[data-app-skin="imba-classic-light"] .sandbox-register-note {
  background: rgba(255, 250, 236, 0.72);
  border-color: var(--skin-panel-border);
  color: var(--skin-page-text);
  box-shadow: none;
}

:root[data-app-skin="imba-classic-light"] .board-art {
  filter: drop-shadow(0 18px 34px rgba(88, 65, 34, 0.18));
}

:root[data-app-skin="imba-classic-light"] .board-cell-art:not(.is-legal-move):not(.is-capture-move):not(.is-check-cell) {
  stroke: var(--skin-board-line);
  stroke-width: 1.5px;
}

:root[data-app-skin="imba-classic-light"] .piece {
  /* Hook for future classic piece assets/filters. */
}

:root[data-app-skin="imba-classic-light"] .board-cell-art.is-legal-move {
  /* Hook for future lower-neon move highlight skin. */
}

:root[data-app-skin="imba-classic-light"] .trailer-video-slot {
  background:
    radial-gradient(circle at 50% 40%, rgba(183, 137, 52, 0.16), transparent 44%),
    rgba(255, 252, 242, 0.78);
  box-shadow: 0 18px 40px rgba(88, 65, 34, 0.12);
}

:root[data-app-skin="imba-classic-light"] .trailer-play-button {
  border-color: rgba(111, 83, 43, 0.34);
  background: rgba(255, 250, 236, 0.82);
  color: #7a5521;
  box-shadow: 0 10px 28px rgba(88, 65, 34, 0.14);
}

:root[data-app-skin="imba-classic-light"] .trailer-video-slot.has-missing-poster::before {
  color: #7a5521;
}

:root[data-app-skin="imba-classic-light"] .trailer-modal-card {
  background: rgba(255, 252, 242, 0.96);
  border-color: rgba(111, 83, 43, 0.24);
}

:root[data-app-skin="imba-classic-light"] .trailer-modal-close {
  background: rgba(255, 250, 236, 0.84);
  border-color: rgba(111, 83, 43, 0.24);
  color: #3a3022;
}
