:root {
      --bg: #101720;
      --panel: #18222d;
      --panel-2: #1d2936;
      --panel-3: #253342;
      --line: #354659;
      --line-soft: #293847;
      --text: #f2f6f8;
      --muted: #8190a2;
      --accent: #55e6b5;
      --accent-2: #23b98c;
      --accent-soft: rgba(85, 230, 181, .12);
      --danger: #ff5d68;
      --warning: #ffb84d;
      --fold: #3a4655;
      --call: #23a875;
      --limp: #29a8a8;
      --openRaise: #e34e59;
      --threeBet: #9f2837;
      --fourBet: #965ee8;
      --push: #ed8b3b;
      --radius: 18px;
      --shadow: 0 18px 60px rgba(0, 0, 0, .26);
    }

    * { box-sizing: border-box; }
    html { color-scheme: dark; }
    body {
      margin: 0;
      min-width: 320px;
      min-height: 100vh;
      color: var(--text);
      background:
        radial-gradient(circle at 75% -10%, rgba(44, 180, 139, .09), transparent 32rem),
        radial-gradient(circle at -10% 80%, rgba(64, 99, 175, .09), transparent 30rem),
        linear-gradient(145deg, #111923, #17222d 58%, #101820);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      -webkit-font-smoothing: antialiased;
    }

    button, input, select { font: inherit; }
    button { color: inherit; }
    button:focus-visible, input:focus-visible, select:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .app-shell { min-height: 100vh; }
    .sidebar {
      position: fixed;
      inset: 0 auto 0 0;
      width: 238px;
      padding: 22px 16px;
      border-right: 1px solid var(--line-soft);
      background: rgba(18, 26, 36, .95);
      backdrop-filter: blur(18px);
      z-index: 30;
      display: flex;
      flex-direction: column;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 11px;
      padding: 4px 8px 26px;
      cursor: pointer;
      border-radius: 10px;
    }
    .brand:hover { filter: brightness(1.08); }

    .brand-mark {
      width: 38px;
      height: 38px;
      aspect-ratio: 1;
      border-radius: 11px;
      box-shadow: 0 0 30px rgba(85, 230, 181, .18);
      object-fit: cover;
      flex: 0 0 auto;
    }

    .brand strong { display: block; font-size: 16px; letter-spacing: .01em; }
    .brand small { color: var(--muted); font-size: 12px; }

    .nav-list { display: grid; gap: 6px; }
    .nav-divider {
      height: 1px;
      margin: 7px 8px;
      background: var(--line-soft);
    }
    .nav-btn {
      border: 0;
      width: 100%;
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 11px 12px;
      border-radius: 10px;
      background: transparent;
      color: #92a0b1;
      cursor: pointer;
      text-align: left;
      transition: .18s ease;
      font-size: 14px;
      font-weight: 700;
    }
    .nav-btn:hover { background: #141c25; color: #dce5eb; }
    .nav-btn.active { background: var(--accent-soft); color: var(--accent); }
    .nav-btn svg { width: 18px; height: 18px; stroke-width: 1.8; }
    .sidebar-bottom {
      margin-top: auto;
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding-top: 14px;
    }

    .save-state {
      padding: 11px 12px;
      border: 1px solid var(--line);
      border-radius: 11px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
      overflow-wrap: anywhere;
    }
    .save-state.dirty { color: #ffc46b; border-color: rgba(255, 184, 77, .22); }
    .save-state.saved { color: #72ddb8; border-color: rgba(85, 230, 181, .18); }

    .main { margin-left: 238px; min-height: 100vh; display: flex; flex-direction: column; }
    .topbar {
      height: 72px;
      padding: 0 30px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid var(--line-soft);
      background: rgba(9, 13, 18, .72);
      backdrop-filter: blur(18px);
      position: sticky;
      top: 0;
      z-index: 20;
    }
    .topbar h1 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
    .top-actions { display: flex; gap: 9px; align-items: center; }
    .content { width: 100%; flex: 1; padding: 28px 30px 56px; max-width: 1500px; margin: 0 auto; }
    .support-link {
      border: 0;
      background: transparent;
      color: #818FA2;
      padding: 8px 4px;
      cursor: pointer;
      font-size: 13px;
      font-weight: 750;
    }
    .support-link:hover { color: #a6b2c2; }
    .app-footer {
      padding: 16px 30px 20px;
      color: #718094;
      font-size: 12px;
      text-align: center;
      border-top: 1px solid var(--line-soft);
    }
    .support-modal { width: min(540px, 100%); }
    .support-copy {
      display: grid;
      gap: 10px;
      margin-top: 22px;
    }
    .support-wallet {
      padding: 12px 14px;
      border: 1px solid var(--line-soft);
      border-radius: 11px;
      background: rgba(10,16,22,.42);
    }
    .support-wallet-label { color: #dce5eb; font-size: 12px; font-weight: 850; margin-bottom: 7px; }
    .support-wallet-row { display: flex; align-items: center; gap: 9px; }
    .support-address {
      min-width: 0;
      flex: 1;
      color: #aebbc7;
      font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
      font-size: 13px;
      line-height: 1.45;
      overflow-wrap: anywhere;
    }
    .support-address a { color: #aebbc7; text-decoration: none; }
    .support-address a:hover { color: var(--accent); }
    .support-text { color: #c2ccd4; font-size: 13px; line-height: 1.65; }
    .support-text a { color: var(--accent); text-decoration: none; }
    .support-thanks { margin: 22px 0 0; text-align: center; color: #c8b5ff; font-size: 14px; font-weight: 750; }

    .btn {
      border: 1px solid var(--line);
      border-radius: 10px;
      background: #151d27;
      padding: 9px 14px;
      min-height: 38px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      cursor: pointer;
      font-weight: 700;
      font-size: 14px;
      transition: transform .16s ease, border-color .16s ease, background .16s ease;
    }
    .btn:hover { transform: translateY(-1px); border-color: #3c4b5d; background: #1b2531; }
    .btn.primary { border-color: transparent; color: #06110e; background: var(--accent); }
    .btn.primary:hover { background: #6cebc1; }
    .btn.danger { color: #ff8991; background: rgba(255, 93, 104, .08); border-color: rgba(255, 93, 104, .2); }
    .btn.ghost { background: transparent; }
    .btn.icon { width: 38px; padding: 0; }
    .btn svg { width: 16px; height: 16px; }
    .btn:disabled { opacity: .42; pointer-events: none; }

    .mobile-menu { display: none; }
    .hero-row {
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      gap: 24px;
      margin-bottom: 24px;
    }
    .hero-row h2 { margin: 0 0 7px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.035em; }
    .hero-row p { margin: 0; color: var(--muted); max-width: 720px; line-height: 1.6; font-size: 15px; }
    .eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 800; margin-bottom: 9px; }

    .stats-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 14px;
      margin-bottom: 22px;
    }
    .stat-card, .panel, .training-card {
      border: 1px solid var(--line-soft);
      background: linear-gradient(145deg, rgba(29, 41, 54, .98), rgba(21, 31, 42, .98));
      border-radius: var(--radius);
      box-shadow: 0 12px 34px rgba(0,0,0,.1);
    }
    .stat-card { padding: 18px 20px; }
    .stat-card .label { color: var(--muted); font-size: 13px; margin-bottom: 9px; }
    .stat-card .value { font-size: 30px; font-weight: 780; letter-spacing: -.03em; }
    .stat-card .hint { color: #77869a; font-size: 12px; margin-top: 4px; }

    .panel { padding: 20px; }
    .panel-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 16px;
    }
    .panel-head h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
    .panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }

    .library-layout {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 290px;
      gap: 18px;
      align-items: start;
    }
    .training-list { display: grid; gap: 10px; }
    .folder-list { display: grid; gap: 12px; }
    .spot-folder {
      border: 1px solid var(--line-soft);
      border-radius: 13px;
      background: rgba(12, 18, 25, .34);
      overflow: hidden;
      transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
    }
    .spot-folder.drag-over {
      border-color: var(--accent);
      background: rgba(85, 230, 181, .08);
      box-shadow: 0 0 0 3px rgba(85, 230, 181, .1);
    }
    .spot-folder.folder-dragging { opacity: .45; }
    .spot-folder.folder-drop-before { box-shadow: 0 -4px 0 #ffd83d; }
    .spot-folder.folder-drop-after { box-shadow: 0 4px 0 #ffd83d; }
    .spot-folder summary {
      list-style: none;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 13px 15px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 850;
      color: #dce5eb;
      user-select: none;
    }
    .spot-folder summary::-webkit-details-marker { display: none; }
    .spot-folder summary[draggable="true"] { cursor: grab; }
    .spot-folder.folder-dragging summary { cursor: grabbing; }
    .folder-summary-main { display: flex; align-items: center; gap: 9px; }
    .folder-summary-main svg { width: 18px; height: 18px; color: #91a2b2; }
    .folder-selected-count {
      padding: 4px 9px;
      border-radius: 99px;
      background: rgba(85, 230, 181, .13);
      color: var(--accent);
      font-size: 12px;
      font-weight: 800;
      white-space: nowrap;
    }
    .folder-name-input {
      width: min(280px, 38vw);
      height: 34px;
      border: 1px solid var(--accent);
      border-radius: 7px;
      background: #101821;
      color: var(--text);
      padding: 0 9px;
      font-size: 14px;
      font-weight: 800;
    }
    .folder-arrow { color: var(--accent); transition: transform .18s ease; }
    .spot-folder[open] .folder-arrow { transform: rotate(90deg); }
    .folder-trainings { padding: 0 10px 10px; display: grid; gap: 9px; }
    .training-card {
      padding: 15px;
      display: grid;
      grid-template-columns: auto 1fr auto;
      gap: 14px;
      align-items: center;
      transition: .18s ease;
    }
    .training-card[draggable="true"] { cursor: grab; }
    .training-card.dragging { opacity: .42; transform: scale(.985); cursor: grabbing; }
    .training-card.drop-before { box-shadow: 0 -3px 0 var(--accent); }
    .training-card.drop-after { box-shadow: 0 3px 0 var(--accent); }
    .training-card:hover { border-color: #344254; transform: translateY(-1px); }
    .training-card.selected { border-color: rgba(85, 230, 181, .42); background: linear-gradient(145deg, rgba(25, 44, 42, .9), rgba(14, 22, 29, .96)); }
    .check {
      width: 28px; height: 28px; border-radius: 8px;
      border: 2px solid #46586b; background: #0d131a; display: grid; place-items: center;
      cursor: pointer; color: #07120f;
      transition: .16s ease;
    }
    .check:hover { border-color: var(--accent); background: rgba(85,230,181,.08); }
    .check.checked { background: var(--accent); border-color: var(--accent); }
    .check svg { width: 18px; height: 18px; stroke-width: 2.7; }
    .training-name { font-weight: 760; font-size: 17px; margin-bottom: 8px; }
    .meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 12px; }
    .tag { padding: 4px 9px; border-radius: 99px; background: #1d2733; color: #b4c0cb; }
    .tag.accent { color: var(--accent); background: var(--accent-soft); }
    .card-actions { display: flex; gap: 5px; }
    .mini-btn {
      width: 40px; height: 40px; border-radius: 10px; border: 1px solid #2b3948;
      display: grid; place-items: center; background: #19232e; color: #b7c4cf; cursor: pointer;
      transition: .16s ease;
    }
    .mini-btn:hover {
      color: var(--accent);
      background: rgba(85,230,181,.1);
      border-color: rgba(85,230,181,.4);
      transform: translateY(-1px);
    }
    .mini-btn[data-copy]:hover {
      color: #72aaff;
      background: rgba(76,137,235,.12);
      border-color: rgba(76,137,235,.42);
    }
    .mini-btn.danger:hover {
      color: #ff7a83;
      background: rgba(255,93,104,.11);
      border-color: rgba(255,93,104,.4);
    }
    .mini-btn svg { width: 19px; height: 19px; stroke-width: 2.2; }

    .session-panel { position: sticky; top: 92px; }
    .selected-count { font-size: 35px; font-weight: 800; letter-spacing: -.04em; margin: 6px 0; }
    .selection-names { min-height: 58px; color: var(--muted); font-size: 13px; line-height: 1.65; }
    .selection-names div { overflow-wrap: anywhere; }
    .selection-names div + div { margin-top: 3px; }
    .question-setting { margin: 18px 0; }
    .question-setting label { color: var(--muted); font-size: 13px; display: block; margin-bottom: 8px; }
    .stepper { display: flex; align-items: center; gap: 8px; }
    .stepper button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #151e28; cursor: pointer; }
    .stepper input { width: 72px; text-align: center; height: 34px; border: 1px solid var(--line); background: #0d131a; border-radius: 8px; color: var(--text); }
    .full { width: 100%; }

    .empty {
      padding: 50px 20px;
      text-align: center;
      color: var(--muted);
      border: 1px dashed #283544;
      border-radius: 14px;
    }
    .empty strong { color: #dfe7ec; display: block; margin-bottom: 7px; }

    .table-wrap { overflow: auto; }
    table { width: 100%; border-collapse: collapse; min-width: 680px; }
    th, td { text-align: left; padding: 15px 14px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
    th { color: #8391a3; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
    td { color: #c9d2da; }
    tr:last-child td { border-bottom: 0; }
    .score { color: var(--accent); font-weight: 750; }
    .quality-badges { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
    .quality-badge {
      min-width: 22px;
      height: auto;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: transparent;
      font-size: 13px;
      font-weight: 900;
    }
    .quality-badge.correct { color: #43A047; }
    .quality-badge.acceptable { color: #d0ba20; }
    .quality-badge.marginal { color: #FB8C00; }
    .quality-badge.wrong { color: #e45c66; }
    .history-training-state { margin-top: 4px; font-size: 10px; font-weight: 750; }
    .history-training-state.changed { color: #ffc45f; }
    .history-training-state.deleted { color: #ff7780; }
    .quality-legend { display: flex; gap: 5px; align-items: center; }
    .quality-dot {
      width: 20px;
      height: 20px;
      border: 2px solid currentColor;
      border-radius: 5px;
      display: inline-grid;
      place-items: center;
      background: transparent;
      font-size: 12px;
      font-weight: 950;
      line-height: 1;
    }

    .backup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    .backup-card { padding: 28px; min-height: 210px; display: flex; flex-direction: column; justify-content: space-between; }
    .backup-card .orb {
      width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px;
      background: var(--accent-soft); color: var(--accent); margin-bottom: 20px;
    }
    .backup-card h3 { margin: 0 0 8px; }
    .backup-card p { color: var(--muted); line-height: 1.55; font-size: 12px; max-width: 440px; }
    .help-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
      align-items: start;
    }
    .help-card { padding: 22px 24px; }
    .help-card-wide { grid-column: 1 / -1; }
    .help-card h3 {
      margin: 0 0 10px;
      font-size: 18px;
      letter-spacing: -.01em;
    }
    .help-card p {
      margin: 0 0 12px;
      color: #c7d1da;
      line-height: 1.6;
      font-size: 14px;
    }
    .help-card ul {
      margin: 0;
      padding-left: 19px;
      color: var(--muted);
      line-height: 1.65;
      font-size: 13px;
    }
    .help-card li + li { margin-top: 5px; }
    .color-settings { display: grid; gap: 10px; }
    .color-setting {
      display: grid;
      grid-template-columns: minmax(150px, 1fr) 46px minmax(120px, 160px) 42px;
      align-items: center;
      gap: 10px;
      padding: 12px 14px;
      border: 1px solid var(--line-soft);
      border-radius: 12px;
      background: rgba(12,18,25,.32);
    }
    .color-setting-name { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 800; }
    .color-setting-dot { width: 14px; height: 14px; border-radius: 4px; background: var(--action-color); box-shadow: 0 0 12px color-mix(in srgb, var(--action-color) 42%, transparent); }
    .color-picker {
      width: 46px;
      height: 38px;
      padding: 3px;
      border: 1px solid var(--line);
      border-radius: 9px;
      background: #101821;
      cursor: pointer;
    }
    .color-hex {
      width: 100%;
      height: 38px;
      border: 1px solid var(--line);
      border-radius: 9px;
      background: #101821;
      color: var(--text);
      padding: 0 10px;
      font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
      text-transform: uppercase;
    }
    .color-setting .mini-btn { width: 38px; height: 38px; }

    .modal-backdrop {
      position: fixed; inset: 0; z-index: 100; padding: 22px;
      background: rgba(2, 5, 8, .78); backdrop-filter: blur(12px);
      display: none; align-items: center; justify-content: center;
    }
    .modal-backdrop.open { display: flex; animation: fadeIn .18s ease; }
    .modal {
      width: min(1480px, 100%);
      max-height: calc(100vh - 44px);
      overflow-y: auto;
      overflow-x: hidden;
      border: 1px solid #293746;
      border-radius: 20px;
      background: #18222d;
      box-shadow: var(--shadow);
      animation: modalIn .22s ease;
    }
    .modal.small { width: min(480px, 100%); }
    .modal-head, .modal-foot {
      position: sticky; z-index: 5; background: rgba(24,34,45,.97); backdrop-filter: blur(14px);
      display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px;
    }
    .modal-head { top: 0; border-bottom: 1px solid var(--line-soft); }
    .modal-foot { bottom: 0; border-top: 1px solid var(--line-soft); justify-content: flex-end; }
    .editor-save-area { display: grid; justify-items: end; gap: 6px; }
    .editor-save-status { color: var(--muted); font-size: 12px; }
    .editor-save-status.dirty { color: #ffc46b; }
    .editor-save-status.saved { color: var(--accent); }
    .modal-head h2 { margin: 0; font-size: 17px; }
    .modal-body { padding: 22px; }
    .editor-layout { display: grid; grid-template-columns: minmax(320px, .9fr) minmax(500px, 1.25fr) minmax(290px, .72fr); gap: 20px; align-items: start; }
    .editor-tools { position: sticky; top: 84px; display: grid; gap: 14px; min-width: 0; }
    .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-bottom: 18px; }
    .field:first-child { grid-column: 1 / -1; }
    .field.full-width { grid-column: 1 / -1; }
    .field label { display: block; color: var(--muted); font-size: 10px; margin: 0 0 7px; font-weight: 700; }
    .field input, .field select {
      width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 9px;
      background: #0a1016; color: var(--text); padding: 0 11px;
    }

    .poker-table-wrap { padding: 22px 28px 28px; }
    .poker-table {
      position: relative; margin: 22px auto 12px; width: min(100%, 550px); aspect-ratio: 2 / 1.15;
      border-radius: 48%;
      background:
        radial-gradient(ellipse at 50% 40%, rgba(68, 177, 139, .18), transparent 40%),
        linear-gradient(145deg, #173e36, #0d2b27 70%);
      border: 8px solid #1f2b35;
      box-shadow: inset 0 0 0 2px #34534d, inset 0 0 70px rgba(0,0,0,.4), 0 16px 32px rgba(0,0,0,.25);
    }
    .table-center { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.25); font-size: 10px; letter-spacing: .16em; font-weight: 800; }
    .table-hole-group {
      position: absolute;
      left: var(--cards-x, 50%);
      top: var(--cards-y, 50%);
      transform: translate(-50%, -50%);
      z-index: 4;
    }
    .table-hole-cards {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
    }
    .table-hole-cards .playing-card {
      width: 78px;
      border-radius: 11px;
      padding: 9px 10px;
      font-size: 30px;
      transform: rotate(-3deg);
    }
    .table-hole-cards .playing-card + .playing-card { transform: rotate(3deg); }
    .table-hole-cards .playing-card .suit { font-size: 40px; }
    .table-hand-name {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      color: rgba(235,241,244,.92);
      font-size: 20px;
      font-weight: 400;
      line-height: 1;
      letter-spacing: .05em;
      text-shadow: 0 2px 5px rgba(0,0,0,.72);
      z-index: 3;
      pointer-events: none;
    }
    .seat-anchor {
      position: absolute;
      transform: translate(-50%, -50%);
      z-index: 4;
      isolation: isolate;
    }
    .seat {
      position: relative;
      z-index: 2;
      min-width: 76px; padding: 10px 13px; text-align: center;
      color: #c1ccd7; font-size: 12px; font-weight: 900;
      border: 1px solid #435568; border-radius: 10px; background: #1a2531;
      box-shadow: 0 7px 17px rgba(0,0,0,.28); transition: .2s ease;
      letter-spacing: .02em;
    }
    .seat-card-backs {
      position: absolute;
      left: 50%;
      bottom: calc(100% - 4px);
      transform: translateX(-50%);
      z-index: 1;
      pointer-events: none;
    }
    .seat.hero {
      min-width: 84px;
      color: #06120e;
      background: var(--accent);
      border-color: #a7f7dc;
      font-size: 13px;
      box-shadow: 0 0 0 5px rgba(85,230,181,.16), 0 9px 24px rgba(0,0,0,.4);
    }
    .seat.opponent {
      color: #fff;
      background: #7d4de1;
      border-color: #ad8cff;
      box-shadow: 0 0 0 4px rgba(150,94,232,.15), 0 8px 22px rgba(0,0,0,.34);
    }
    .opponent-visual {
      position: absolute;
      left: var(--opponent-x);
      top: var(--opponent-y);
      transform: translate(-50%, -50%);
      z-index: 3;
      pointer-events: none;
    }
    .opponent-visual {
      display: flex;
      align-items: center;
      gap: 7px;
    }
    .hu-opponent-bet {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 5px;
    }
    .card-backs { display: flex; gap: 3px; }
    .card-back {
      width: 30px;
      aspect-ratio: .7;
      border: 2px solid #e7edf4;
      border-radius: 5px;
      background:
        repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0 2px, transparent 2px 5px),
        linear-gradient(145deg, #6742c6, #342074);
      box-shadow: 0 5px 12px rgba(0,0,0,.28), inset 0 0 0 2px rgba(255,255,255,.12);
    }
    .card-back + .card-back { margin-left: -11px; transform: rotate(6deg); }
    .opponent-bet { display: flex; align-items: center; gap: 6px; }
    .chip-stack { position: relative; width: 22px; height: 24px; }
    .chip {
      position: absolute;
      left: 0;
      width: 22px;
      height: 8px;
      border: 2px dashed rgba(255,255,255,.85);
      border-radius: 50%;
      background: #e64f5b;
      box-shadow: 0 2px 3px rgba(0,0,0,.25);
    }
    .chip:nth-child(1) { bottom: 0; }
    .chip:nth-child(2) { bottom: 6px; background: #388de7; }
    .chip:nth-child(3) { bottom: 12px; background: #e64f5b; }
    .table-marker {
      position: absolute;
      left: var(--marker-x);
      top: var(--marker-y);
      transform: translate(-50%, -50%);
      z-index: 5;
      pointer-events: none;
    }
    .dealer-button {
      width: 31px;
      height: 31px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      border: 2px solid #fff1a3;
      background: #ffd83d;
      color: #151515;
      font-size: 13px;
      font-weight: 950;
      box-shadow: 0 0 0 3px rgba(255,216,61,.18), 0 5px 13px rgba(0,0,0,.36);
    }
    .blind-marker { display: flex; align-items: center; gap: 4px; }
    .blind-marker .chip-stack { transform: scale(.72); transform-origin: center; margin-right: -3px; }
    .blind-label {
      padding: 3px 5px;
      border-radius: 5px;
      background: rgba(9,14,20,.82);
      color: #dfe7ec;
      font-size: 8px;
      font-weight: 900;
    }
    .opponent-action-label {
      max-width: 120px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 7px 10px;
      border-radius: 9px;
      background: rgba(7, 13, 18, .82);
      border: 0;
      color: #ffd85a;
      font-size: 13px;
      font-weight: 800;
      letter-spacing: .015em;
      white-space: nowrap;
      text-shadow: none;
      box-shadow: 0 6px 16px rgba(0,0,0,.22);
    }
    .spot-type-help {
      grid-column: 1 / -1;
      margin-top: -2px;
      padding: 13px 15px;
      border-left: 3px solid var(--accent);
      border-radius: 8px;
      background: rgba(85, 230, 181, .065);
      color: #cbd5dc;
      font-size: 13px;
      line-height: 1.55;
    }
    .palette {
      margin-top: 0;
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: rgba(10, 16, 22, .34);
    }
    .palette-title { color: #aebbc8; font-size: 11px; margin-bottom: 12px; font-weight: 850; letter-spacing: .06em; }
    .palette-list { display: flex; flex-wrap: wrap; gap: 9px; }
    .available-actions {
      margin: 0 0 17px;
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: 11px;
      background: rgba(10, 16, 22, .32);
    }
    .available-actions .palette-title {
      margin-bottom: 13px;
      color: #d3dce3;
      font-size: 12px;
    }
    .available-actions-list {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 9px;
    }
    .available-action {
      display: inline-flex;
      align-items: center;
      gap: 9px;
      min-height: 42px;
      padding: 9px 11px;
      border: 1px solid #2c3a49;
      border-radius: 9px;
      background: #1a2531;
      color: #e1e8ed;
      font-size: 11px;
      font-weight: 800;
      cursor: pointer;
    }
    .available-action:has(input:checked) {
      border-color: color-mix(in srgb, var(--action) 75%, #2c3a49);
      background: color-mix(in srgb, var(--action) 12%, #1a2531);
    }
    .available-action input {
      width: 18px;
      height: 18px;
      flex: 0 0 auto;
      accent-color: var(--action);
    }
    .action-chip {
      min-height: 42px;
      border: 1px solid transparent; border-radius: 10px; background: #1b2632; padding: 10px 14px;
      color: #e4ebf0; cursor: pointer; display: inline-flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 850;
    }
    .action-chip .dot { width: 13px; height: 13px; border-radius: 4px; background: var(--chip); box-shadow: 0 0 12px color-mix(in srgb, var(--chip) 45%, transparent); }
    .action-chip.active {
      border-color: var(--chip);
      background: color-mix(in srgb, var(--chip) 16%, #1b2632);
      box-shadow: inset 0 0 0 1px var(--chip), 0 5px 16px color-mix(in srgb, var(--chip) 18%, transparent);
    }

    .matrix-wrap { position: relative; user-select: none; touch-action: none; }
    .chart-confirm {
      position: absolute;
      inset: 38px 0 0;
      z-index: 8;
      display: grid;
      place-items: center;
      pointer-events: none;
    }
    .chart-confirm-card {
      width: min(340px, calc(100% - 32px));
      padding: 18px;
      border: 1px solid #3a4958;
      border-radius: 13px;
      background: #1b2632;
      box-shadow: 0 12px 32px rgba(0,0,0,.32);
      pointer-events: auto;
    }
    .chart-confirm-card strong { display: block; margin-bottom: 7px; font-size: 15px; }
    .chart-confirm-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
    .chart-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
    .matrix-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: 10px; }
    .range-matrix {
      display: grid;
      grid-template-columns: repeat(13, minmax(28px, 1fr));
      gap: 3px;
      width: 100%;
    }
    .hand-cell {
      aspect-ratio: 1;
      min-width: 0;
      border: 0;
      border-radius: 5px;
      color: rgba(255,255,255,.92);
      background: var(--cell);
      cursor: crosshair;
      font-size: clamp(9px, .88vw, 12px);
      font-weight: 900;
      line-height: 1;
      letter-spacing: 0;
      text-rendering: geometricPrecision;
      -webkit-font-smoothing: antialiased;
      transition: filter .1s, box-shadow .1s;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,.055);
      padding: 0;
    }
    .hand-cell.unmarked {
      color: #647386;
      background:
        linear-gradient(145deg, rgba(35, 47, 61, .82), rgba(25, 35, 46, .82));
      box-shadow: inset 0 0 0 1px rgba(255,255,255,.035);
    }
    .hand-cell:hover {
      filter: brightness(1.22);
      box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 0 0 2px rgba(255,255,255,.12);
      z-index: 1;
    }
    .hand-cell.selected-hand,
    .hand-cell.multi-selected { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.95); }
    .strategy-editor {
      margin-top: 0;
      padding: 15px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: rgba(10,16,22,.38);
      min-width: 0;
      overflow: hidden;
    }
    .strategy-editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
    .strategy-editor-head strong { font-size: 16px; }
    .strategy-add-title { margin: 14px 0 8px; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .06em; }
    .strategy-add-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .strategy-add-btn {
      min-height: 36px;
      border: 1px solid color-mix(in srgb, var(--action) 55%, var(--line));
      border-radius: 8px;
      background: color-mix(in srgb, var(--action) 10%, #18232e);
      color: #dfe7ec;
      cursor: pointer;
      font-size: 10px;
      font-weight: 800;
      text-align: left;
      padding: 7px 9px;
    }
    .strategy-add-btn:hover { background: color-mix(in srgb, var(--action) 22%, #18232e); }
    .strategy-row {
      display: grid;
      grid-template-columns: 72px minmax(0,1fr) 46px 34px;
      gap: 7px;
      align-items: center;
      margin-top: 9px;
      font-size: 12px;
      font-weight: 750;
    }
    .strategy-row > span:first-child {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 11px;
    }
    .strategy-row input[type="range"] {
      width: 100%;
      min-width: 0;
      height: 22px;
      accent-color: var(--strategy-color);
      cursor: pointer;
    }
    .strategy-row input[type="range"].locked {
      pointer-events: none;
      cursor: default;
      opacity: 1;
    }
    .strategy-weight { text-align: right; color: #dce5eb; }

    .training-screen { position: relative; max-width: 1320px; margin: 0 auto; }
    .session-confirm {
      position: absolute;
      inset: 0;
      z-index: 20;
      display: grid;
      place-items: center;
      pointer-events: none;
    }
    .poker-table > .session-confirm { border-radius: inherit; }
    .session-confirm-card {
      width: min(390px, calc(100% - 32px));
      padding: 20px;
      border: 1px solid #3a4958;
      border-radius: 14px;
      background: #1b2632;
      box-shadow: 0 14px 38px rgba(0,0,0,.34);
      pointer-events: auto;
    }
    .session-confirm-card strong { display: block; margin-bottom: 8px; font-size: 16px; }
    .session-confirm-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
    .session-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
    .training-layout {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 250px;
      gap: 18px;
      align-items: start;
    }
    .training-table-card { padding: 16px 24px 22px; }
    .training-table-card .poker-table { width: min(100%, 760px); }
    .training-table-card .poker-table-wrap { padding: 24px 38px 34px; }
    .table-feedback {
      min-height: 34px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: -8px;
      font-size: 14px;
      font-weight: 800;
      text-align: center;
    }
    .spot-info { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: -2px; padding-bottom: 8px; }
    .progress-label { color: var(--muted); font-size: 10px; margin-bottom: 13px; }
    .cards { display: flex; justify-content: center; gap: 9px; margin: 10px 0 18px; }
    .playing-card {
      width: 82px; aspect-ratio: .72; border-radius: 12px;
      color: #fff; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between;
      padding: 10px 11px; box-shadow: 0 12px 28px rgba(0,0,0,.32), inset 0 0 0 1px rgba(255,255,255,.18);
      font-size: 32px; font-weight: 900; line-height: 1;
      text-shadow: 0 2px 5px rgba(0,0,0,.22);
    }
    .playing-card .suit { align-self: flex-end; font-size: 42px; line-height: .8; color: #fff; }
    .playing-card.hearts { background: linear-gradient(145deg, #f14e5d, #bd2637); }
    .playing-card.diamonds { background: linear-gradient(145deg, #398ff0, #175db7); }
    .playing-card.clubs { background: linear-gradient(145deg, #34bd78, #167b4a); }
    .playing-card.spades { background: linear-gradient(145deg, #586577, #252e3a); }
    .hand-label { font-size: 14px; color: var(--muted); font-weight: 700; }
    .answer-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
    .answer-btn {
      min-width: 126px; min-height: 52px; border: 1px solid color-mix(in srgb, var(--action) 88%, white);
      background: linear-gradient(145deg, color-mix(in srgb, var(--action) 90%, white 10%), var(--action));
      color: #fff;
      padding: 15px 22px; border-radius: 12px; cursor: pointer; font-weight: 850; font-size: 14px;
      box-shadow: 0 7px 18px color-mix(in srgb, var(--action) 28%, transparent), inset 0 1px rgba(255,255,255,.16);
      text-shadow: 0 1px 3px rgba(0,0,0,.25);
    }
    .answer-btn:hover { filter: brightness(1.13); transform: translateY(-2px); }
    .answer-btn:disabled { cursor: default; }
    .answer-btn.reveal-correct {
      filter: brightness(1.25);
      box-shadow: 0 0 0 3px rgba(85,230,181,.7), 0 9px 24px color-mix(in srgb, var(--action) 42%, transparent);
    }
    .answer-btn.reveal-acceptable {
      filter: brightness(1.18);
      box-shadow: 0 0 0 3px rgba(229,210,47,.82), 0 9px 24px rgba(229,210,47,.24);
    }
    .answer-btn.reveal-marginal {
      filter: brightness(1.18);
      box-shadow: 0 0 0 3px rgba(251,140,0,.78), 0 9px 24px rgba(251,140,0,.24);
    }
    .answer-btn.reveal-wrong {
      filter: saturate(.55) brightness(.75);
      box-shadow: 0 0 0 2px rgba(255,93,104,.7);
    }
    .feedback { color: var(--muted); }
    .feedback.correct { color: var(--accent); }
    .feedback.acceptable { color: #e5d22f; }
    .feedback.marginal { color: #FB8C00; }
    .feedback.wrong { color: #ff7780; }
    .session-sidebar { position: sticky; top: 92px; }
    .session-stats { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .session-stats .stat-card { text-align: left; padding: 15px 17px; }
    .session-stats .value { font-size: 22px; }
    .progress-track { height: 4px; background: #1b2631; border-radius: 99px; overflow: hidden; margin-bottom: 18px; }
    .progress-fill { height: 100%; background: var(--accent); transition: width .28s ease; }

    .result { text-align: center; padding: 20px 0; }
    .result-ring {
      width: 140px; aspect-ratio: 1; margin: 12px auto 26px; border-radius: 50%;
      display: grid; place-items: center; background: conic-gradient(var(--accent) var(--score), #202a35 0);
      position: relative;
    }
    .result-ring::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: #0f151d; }
    .result-ring strong { position: relative; z-index: 1; font-size: 31px; }
    .result-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 20px 0 26px; }

    .toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: grid; gap: 8px; }
    .toast {
      padding: 12px 15px; border: 1px solid #304050; border-radius: 10px; background: #16202a;
      box-shadow: 0 12px 35px rgba(0,0,0,.3); font-size: 12px; animation: toastIn .2s ease;
    }

    .onboarding { text-align: center; padding: 16px 12px 6px; }
    .onboarding .brand-mark { margin: 0 auto 18px; width: 58px; font-size: 31px; }
    .onboarding h2 { font-size: 25px; margin: 0 0 9px; }
    .onboarding p { color: var(--muted); line-height: 1.6; font-size: 12px; max-width: 390px; margin: 0 auto 23px; }
    .onboarding-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

    @keyframes fadeIn { from { opacity: 0 } }
    @keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985) } }
    @keyframes toastIn { from { opacity: 0; transform: translateY(8px) } }

    @media (max-width: 1250px) {
      .editor-layout { grid-template-columns: 1fr; }
      .editor-tools { position: static; }
      .poker-table-wrap { max-width: 650px; margin: 0 auto; }
      .hand-cell { font-size: 11px; }
    }

    @media (max-width: 880px) {
      .sidebar { transform: translateX(-100%); transition: .22s ease; }
      .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
      .main { margin-left: 0; }
      .mobile-menu { display: inline-flex; }
      .stats-grid { grid-template-columns: 1fr 1fr; }
      .help-grid { grid-template-columns: 1fr; }
      .library-layout, .training-layout { grid-template-columns: 1fr; }
      .session-panel { position: static; order: -1; }
      .session-sidebar { position: static; }
      .session-stats { grid-template-columns: repeat(5, 1fr); }
      .session-stats .stat-card { text-align: center; padding: 12px 8px; }
    }

    @media (max-width: 600px) {
      .topbar { height: 62px; padding: 0 15px; }
      .topbar h1 { font-size: 14px; }
      .top-actions .btn span { display: none; }
      .content { padding: 20px 14px 40px; }
      .support-link { font-size: 11px; }
      .app-footer { padding: 14px; }
      .support-wallet-row { align-items: stretch; flex-direction: column; }
      .hero-row { align-items: flex-start; flex-direction: column; }
      .hero-row .btn { width: 100%; }
      .stats-grid { gap: 9px; }
      .stat-card { padding: 14px; }
      .stat-card .value { font-size: 20px; }
      .training-card { grid-template-columns: auto 1fr; }
      .card-actions { grid-column: 2; }
      .backup-grid { grid-template-columns: 1fr; }
      .color-setting { grid-template-columns: 1fr 46px 42px; }
      .color-hex { grid-column: 1 / -1; grid-row: 2; }
      .modal-backdrop { padding: 0; }
      .modal { height: 100vh; max-height: none; border-radius: 0; border: 0; }
      .form-grid { grid-template-columns: 1fr; }
      .field:first-child { grid-column: auto; }
      .modal-body { padding: 16px; }
      .range-matrix { gap: 2px; }
      .hand-cell { border-radius: 3px; font-size: 8px; }
      .available-actions-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .session-stats { grid-template-columns: repeat(3, 1fr); }
      .training-table-card { padding: 12px 8px 18px; }
      .training-table-card .poker-table-wrap { padding: 18px 25px 28px; }
      .seat { min-width: 55px; padding: 7px 8px; font-size: 9px; border-radius: 8px; }
      .seat.hero { min-width: 62px; font-size: 10px; }
      .seat.opponent { font-size: 9px; }
      .card-back { width: 22px; border-radius: 4px; }
      .opponent-visual { gap: 4px; }
      .opponent-action-label { font-size: 10px; padding: 5px 7px; gap: 5px; }
      .chip-stack { transform: scale(.8); }
      .table-hole-cards .playing-card { width: 58px; padding: 7px; font-size: 23px; }
      .table-hole-cards .playing-card .suit { font-size: 30px; }
      .table-hand-name { font-size: 14px; }
      .playing-card { width: 68px; }
      .result-grid { grid-template-columns: 1fr; }
      .onboarding-actions { grid-template-columns: 1fr; }
    }
