    :root {
      --panel: rgba(17, 24, 39, 0.78);
      --panel-soft: rgba(31, 41, 55, 0.72);
      --border: rgba(255, 255, 255, 0.14);
      --table-aura: rgba(255, 92, 168, 0.18);
      --table-aura-2: rgba(157, 78, 221, 0.18);
      --table-bg: rgba(18, 10, 24, 0.88);
      --table-bg-2: rgba(8, 8, 16, 0.78);
      --text: #f9fafb;
      --muted: #a7b0c0;
      --accent: #ff4fa3;
      --accent-2: #ff8fab;
      --danger: #ff3d71;
      --hot-pink: #ff5ca8;
      --violet: #9d4edd;
      --neon: #ff89c7;
      --win: #22c55e;
      --card: rgba(255, 255, 255, 0.9);
      --card-text: #111827;
    }

    * { box-sizing: border-box; }

    html, body {
      margin: 0;
      width: 100%;
      min-height: 100%;
      background: transparent;
      font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
      color: var(--text);
      overflow: hidden;
      user-select: none;
    }

    body {
      display: grid;
      place-items: center;
      padding: 6px;
    }

    body.embed-mode {
      padding: 0;
    }

    .game {
      width: min(1040px, 98vw);
      height: min(820px, calc(100vh - 12px));
      background:
        radial-gradient(circle at top, var(--table-aura), transparent 40%),
        radial-gradient(circle at bottom right, var(--table-aura-2), transparent 38%),
        linear-gradient(145deg, var(--table-bg), var(--table-bg-2));
      border: 1px solid var(--border);
      border-radius: 24px;
      box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
      backdrop-filter: blur(14px);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      position: relative;
    }

    body.embed-mode .game {
      width: 100vw;
      height: 100vh;
      border-radius: 0;
      border-color: rgba(255, 255, 255, 0.1);
      box-shadow: none;
    }

    body.embed-mode .setup-screen {
      padding: 0;
    }

    body.embed-mode .brand span {
      display: none;
    }

    .topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 14px 18px;
      border-bottom: 1px solid var(--border);
      background: rgba(255, 255, 255, 0.04);
    }

    .brand {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .brand strong {
      font-size: 18px;
      letter-spacing: 0.02em;
    }

    .brand span {
      font-size: 12px;
      color: var(--muted);
    }

    .status-pill {
      padding: 8px 12px;
      border-radius: 999px;
      background: rgba(20, 184, 166, 0.16);
      border: 1px solid rgba(20, 184, 166, 0.35);
      color: #bff7ef;
      font-size: 13px;
      white-space: nowrap;
    }

    .status-pill.spectator {
      background: rgba(45, 212, 191, 0.14);
      border-color: rgba(45, 212, 191, 0.42);
      color: #ccfbf1;
    }

    .top-status {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: wrap;
    }

    .code-pill {
      padding: 8px 11px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.14);
      color: var(--muted);
      font-size: 12px;
      line-height: 1;
    }

    .code-pill strong {
      color: #fff;
      letter-spacing: 0.12em;
      margin-left: 4px;
    }

    #historyBtn strong {
      letter-spacing: 0;
    }

    .table {
      display: grid;
      grid-template-columns: minmax(170px, 0.72fr) minmax(430px, 1.45fr) minmax(170px, 0.72fr);
      gap: 12px;
      padding: 12px;
      min-height: 0;
      flex: 1;
    }

    .panel {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 12px;
      min-height: 0;
    }

    .player-card {
      display: flex;
      flex-direction: column;
      gap: 10px;
      height: 100%;
      min-height: 0;
    }

    .player-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .name {
      font-weight: 800;
      font-size: 16px;
    }

    .score {
      font-size: 12px;
      color: var(--muted);
    }

    .avatar {
      box-shadow: inset 0 0 40px rgba(255, 92, 168, 0.12), 0 0 20px rgba(255, 92, 168, 0.08);
      width: 100%;
      min-height: 96px;
      display: grid;
      place-items: center;
      border-radius: 18px;
      border: 1px solid rgba(255,255,255,0.1);
      background:
        radial-gradient(circle at 50% 20%, rgba(255, 92, 168, 0.25), transparent 40%),
        linear-gradient(180deg, rgba(40, 14, 40, 0.65), rgba(0,0,0,0.25));
      position: relative;
      overflow: hidden;
    }

    .avatar .figure {
      position: relative;
      overflow: hidden;
      width: 78px;
      height: 86px;
      border-radius: 38px 38px 16px 16px;
      background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06));
      border: 1px solid rgba(255,255,255,0.16);
      display: grid;
      place-items: center;
      font-size: 40px;
      box-shadow: 0 0 30px rgba(255, 92, 168, 0.18);
    }

    .layers {
      display: grid;
      gap: 8px;
    }

    .layer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 7px 9px;
      border-radius: 12px;
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.08);
      font-size: 12px;
    }

    .layer.lost {
      opacity: 0.42;
      text-decoration: line-through;
    }

    .center {
      display: flex;
      flex-direction: column;
      gap: 10px;
      min-height: 0;
    }

    .center > * {
      flex-shrink: 0;
    }

    .round-info {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
    }

    .stat {
      background: var(--panel-soft);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 9px 10px;
      text-align: center;
    }

    .stat span {
      display: block;
      font-size: 11px;
      color: var(--muted);
      margin-bottom: 4px;
    }

    .stat strong {
      font-size: 18px;
    }

    .room-panel {
      display: grid;
      grid-template-columns: 1fr auto;
      align-items: center;
      gap: 10px;
      padding: 10px;
      border-radius: 16px;
      border: 1px solid var(--border);
      background: var(--panel-soft);
    }

    .spectator-mode .room-panel {
      border-color: rgba(45, 212, 191, 0.3);
      box-shadow: inset 0 0 24px rgba(45, 212, 191, 0.05);
    }

    .room-meta {
      display: grid;
      gap: 3px;
      min-width: 0;
    }

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

    .room-meta strong {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 13px;
    }

    .match-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: wrap;
    }

    .match-actions button {
      padding: 10px 12px;
      border-radius: 12px;
    }

    .roster-panel {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      min-width: 0;
    }

    .roster-block {
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      gap: 7px;
      padding: 10px;
      border-radius: 16px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.055);
      min-width: 0;
      min-height: 98px;
    }

    .section-title small {
      color: var(--muted);
      font-size: 10px;
      text-transform: none;
      letter-spacing: 0;
      font-weight: 800;
      overflow: hidden;
      text-align: right;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .roster-list {
      display: grid;
      gap: 6px;
      min-height: 32px;
      overflow: auto;
    }

    .roster-row {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) minmax(48px, auto);
      align-items: center;
      gap: 7px;
      min-width: 0;
      padding: 6px 8px;
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,0.08);
      background: rgba(0,0,0,0.14);
      font-size: 12px;
    }

    .roster-row span {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .roster-row strong {
      color: #fff;
      font-size: 10px;
      overflow: hidden;
      text-align: right;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .roster-row.dealer {
      border-color: rgba(255, 140, 195, 0.5);
      box-shadow: 0 0 18px rgba(255, 92, 168, 0.1);
    }

    .roster-empty {
      color: var(--muted);
      font-size: 12px;
      padding: 7px 2px;
    }

    .cards {
      display: grid;
      gap: 8px;
      min-height: 164px;
      padding: 14px;
      border-radius: 20px;
      background: rgba(0,0,0,0.18);
      border: 1px dashed rgba(255,255,255,0.14);
      overflow: hidden;
      position: relative;
    }

    .empty-cards {
      min-height: 132px;
      display: grid;
      place-items: center;
      color: var(--muted);
      font-size: 13px;
      text-align: center;
    }

    .hand-board {
      display: grid;
      gap: 10px;
      width: 100%;
    }

    .hand-row {
      display: grid;
      grid-template-columns: 88px minmax(0, 1fr);
      align-items: center;
      gap: 10px;
      min-width: 0;
    }

    .hand-label {
      display: grid;
      gap: 2px;
      min-width: 0;
      color: var(--muted);
      font-size: 10px;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }

    .hand-label strong {
      overflow: hidden;
      color: #fff;
      font-size: 12px;
      text-overflow: ellipsis;
      white-space: nowrap;
      letter-spacing: 0;
      text-transform: none;
    }

    .hand-cards {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 8px;
      min-width: 0;
    }

    .card {
      border: 1px solid rgba(255,255,255,0.18);
      width: 50px;
      height: 72px;
      background: var(--card);
      color: var(--card-text);
      border-radius: 12px;
      box-shadow: 0 8px 18px rgba(0,0,0,0.25);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      padding: 8px;
      font-weight: 900;
      transform: translateY(0);
      animation: pop 220ms ease-out;
      position: relative;
      overflow: hidden;
    }

    .card.red { color: #b91c1c; }
    .card .rank { font-size: 18px; }
    .card .suit { font-size: 18px; align-self: flex-end; }

    .card::before,
    .card::after {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      opacity: 0;
      transition: opacity 160ms ease, transform 160ms ease;
    }

    .card span {
      position: relative;
      z-index: 1;
    }

    .deck-skin-neon .cards .card,
    .deck-preview.deck-skin-neon .card {
      border-color: rgba(94, 234, 212, 0.72);
      background: linear-gradient(145deg, rgba(10, 14, 26, 0.92), rgba(24, 10, 34, 0.82));
      color: #dffcff;
      box-shadow: 0 0 16px rgba(45, 212, 191, 0.22), inset 0 0 18px rgba(255, 79, 163, 0.08);
      text-shadow: 0 0 8px rgba(94, 234, 212, 0.62);
    }

    .deck-skin-neon .cards .card.red,
    .deck-preview.deck-skin-neon .card.red {
      color: #ff7abf;
      text-shadow: 0 0 9px rgba(255, 92, 168, 0.76);
    }

    .deck-skin-neon .cards .card:hover,
    .deck-preview.deck-skin-neon .card:hover {
      border-color: rgba(255, 140, 195, 0.9);
      box-shadow: 0 0 24px rgba(255, 92, 168, 0.34), 0 0 14px rgba(45, 212, 191, 0.24);
    }

    .deck-skin-neon .cards .card:hover .suit,
    .deck-preview.deck-skin-neon .card:hover .suit {
      filter: drop-shadow(0 0 8px currentColor);
    }

    .deck-skin-holographic .cards .card,
    .deck-preview.deck-skin-holographic .card {
      border-color: rgba(255, 255, 255, 0.58);
      background:
        linear-gradient(120deg, rgba(255,255,255,0.82), rgba(218, 234, 255, 0.78)),
        linear-gradient(135deg, rgba(255, 92, 168, 0.42), rgba(45, 212, 191, 0.38), rgba(250, 204, 21, 0.34));
      background-blend-mode: screen;
      color: #111827;
      box-shadow: 0 10px 24px rgba(157, 78, 221, 0.22);
    }

    .deck-skin-holographic .cards .card::before,
    .deck-preview.deck-skin-holographic .card::before {
      opacity: 0.7;
      background: linear-gradient(110deg, transparent 12%, rgba(255,255,255,0.62) 35%, transparent 58%);
      transform: translateX(-70%);
      animation: holoShine 1.8s ease-in-out infinite;
    }

    .deck-skin-holographic .cards .card.red,
    .deck-preview.deck-skin-holographic .card.red {
      color: #b91c7a;
    }

    .deck-skin-vip .cards .card,
    .deck-preview.deck-skin-vip .card {
      border-color: rgba(250, 204, 21, 0.82);
      background: linear-gradient(145deg, #0a0a10, #19120b);
      color: #fde68a;
      box-shadow: 0 12px 24px rgba(0,0,0,0.34), inset 0 0 0 2px rgba(250, 204, 21, 0.2);
      font-family: Georgia, Cambria, serif;
    }

    .deck-skin-vip .cards .card.red,
    .deck-preview.deck-skin-vip .card.red {
      color: #f8b4c8;
    }

    .deck-skin-vip .cards .card::after,
    .deck-preview.deck-skin-vip .card::after {
      opacity: 1;
      inset: 4px;
      border: 1px solid rgba(250, 204, 21, 0.32);
      border-radius: 8px;
    }

    .deck-skin-cyber .cards .card,
    .deck-preview.deck-skin-cyber .card {
      border-color: rgba(129, 140, 248, 0.7);
      background:
        linear-gradient(135deg, rgba(23, 16, 48, 0.96), rgba(8, 20, 36, 0.92)),
        repeating-linear-gradient(90deg, transparent 0 8px, rgba(45, 212, 191, 0.14) 8px 9px);
      color: #bfdbfe;
      box-shadow: 0 0 18px rgba(129, 140, 248, 0.2), inset 0 0 18px rgba(45, 212, 191, 0.07);
      animation: pop 220ms ease-out, cyberDeal 520ms steps(2, end);
    }

    .deck-skin-cyber .cards .card.red,
    .deck-preview.deck-skin-cyber .card.red {
      color: #f0abfc;
    }

    .deck-skin-cyber .cards .card::before,
    .deck-preview.deck-skin-cyber .card::before {
      opacity: 0.45;
      background: linear-gradient(180deg, transparent 0 46%, rgba(45, 212, 191, 0.32) 47% 50%, transparent 51%);
    }

    .deck-skin-pink .cards .card,
    .deck-preview.deck-skin-pink .card {
      border-color: rgba(244, 114, 182, 0.56);
      background: linear-gradient(145deg, #fff1f8, #ffd8eb 54%, #fbcfe8);
      color: #831843;
      box-shadow: 0 10px 22px rgba(244, 114, 182, 0.22);
    }

    .deck-skin-pink .cards .card.red,
    .deck-preview.deck-skin-pink .card.red {
      color: #be185d;
    }

    .deck-skin-pink .cards .card::before,
    .deck-preview.deck-skin-pink .card::before {
      opacity: 0.5;
      background:
        radial-gradient(circle at 18% 28%, rgba(255,255,255,0.85) 0 2px, transparent 3px),
        radial-gradient(circle at 78% 62%, rgba(255,255,255,0.68) 0 1px, transparent 2px),
        radial-gradient(circle at 52% 18%, rgba(244, 114, 182, 0.48) 0 1px, transparent 2px);
    }

    .deck-skin-classic .cards .card,
    .deck-preview.deck-skin-classic .card {
      border-color: rgba(255,255,255,0.2);
      background: linear-gradient(145deg, rgba(17, 24, 39, 0.88), rgba(31, 41, 55, 0.78));
      color: #f9fafb;
      box-shadow: 0 10px 18px rgba(0,0,0,0.32), inset 0 0 18px rgba(255,255,255,0.04);
      font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
      text-shadow: none;
    }

    .deck-skin-classic .cards .card.red,
    .deck-preview.deck-skin-classic .card.red {
      color: #fca5a5;
    }

    @keyframes holoShine {
      0%, 32% { transform: translateX(-78%); }
      72%, 100% { transform: translateX(78%); }
    }

    @keyframes cyberDeal {
      0% { filter: hue-rotate(0deg); clip-path: inset(0 0 0 0); }
      35% { filter: hue-rotate(70deg); clip-path: inset(8% 0 3% 0); }
      70% { filter: hue-rotate(-30deg); clip-path: inset(0 4% 0 2%); }
      100% { filter: hue-rotate(0deg); clip-path: inset(0 0 0 0); }
    }

    @keyframes pop {
      from { transform: translateY(10px) scale(0.96); opacity: 0; }
      to { transform: translateY(0) scale(1); opacity: 1; }
    }

    .message {
      backdrop-filter: blur(10px);
      min-height: 56px;
      padding: 11px 12px;
      border-radius: 18px;
      background: rgba(255,255,255,0.06);
      border: 1px solid var(--border);
      color: #e5e7eb;
      line-height: 1.4;
      font-size: 13px;
      position: static;
    }

    .message strong { color: #fff; }

    .history-list {
      display: grid;
      gap: 6px;
      overflow: auto;
    }

    .history-row {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      align-items: center;
      gap: 8px;
      min-width: 0;
      padding: 7px 9px;
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,0.08);
      background: rgba(0,0,0,0.13);
      font-size: 12px;
    }

    .history-row span {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .history-row strong {
      color: #fff;
      font-size: 11px;
      white-space: nowrap;
    }

    .history-empty {
      color: var(--muted);
      font-size: 12px;
      padding: 3px 0;
    }

    .modal-backdrop {
      position: absolute;
      inset: 0;
      z-index: 8;
      display: grid;
      place-items: center;
      padding: 18px;
      background: rgba(8, 8, 16, 0.52);
      backdrop-filter: blur(8px);
    }

    .history-modal {
      width: min(560px, 92vw);
      max-height: min(520px, calc(100vh - 64px));
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      gap: 12px;
      padding: 16px;
      border-radius: 22px;
      border: 1px solid rgba(255, 255, 255, 0.16);
      background:
        radial-gradient(circle at top, rgba(255, 92, 168, 0.16), transparent 44%),
        linear-gradient(145deg, rgba(30, 18, 34, 0.94), rgba(10, 10, 20, 0.9));
      box-shadow: 0 26px 80px rgba(0, 0, 0, 0.48);
    }

    .match-modal {
      width: min(540px, 92vw);
      display: grid;
      gap: 14px;
      padding: 16px;
      border-radius: 22px;
      border: 1px solid rgba(255, 255, 255, 0.16);
      background:
        radial-gradient(circle at top, rgba(255, 92, 168, 0.18), transparent 44%),
        linear-gradient(145deg, rgba(32, 18, 36, 0.95), rgba(10, 10, 20, 0.91));
      box-shadow: 0 26px 80px rgba(0, 0, 0, 0.5);
    }

    .customize-modal {
      width: min(680px, 94vw);
      max-height: min(620px, calc(100vh - 48px));
      display: grid;
      grid-template-rows: auto auto minmax(0, 1fr);
      gap: 14px;
      padding: 16px;
      border-radius: 22px;
      border: 1px solid rgba(255, 255, 255, 0.16);
      background:
        radial-gradient(circle at top left, rgba(45, 212, 191, 0.12), transparent 42%),
        radial-gradient(circle at top right, rgba(255, 92, 168, 0.18), transparent 42%),
        linear-gradient(145deg, rgba(30, 18, 34, 0.95), rgba(10, 10, 20, 0.92));
      box-shadow: 0 26px 80px rgba(0, 0, 0, 0.5);
      overflow: hidden;
    }

    .modal-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .modal-head div {
      display: grid;
      gap: 2px;
      min-width: 0;
    }

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

    .modal-head strong {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 18px;
    }

    .modal-close {
      width: 38px;
      height: 38px;
      display: grid;
      place-items: center;
      padding: 0;
      border-radius: 14px;
      font-size: 22px;
      line-height: 1;
    }

    .modal-history-list {
      max-height: 390px;
      padding-right: 2px;
    }

    .modal-history-list .history-row {
      grid-template-columns: 44px minmax(0, 1fr) minmax(76px, auto);
      padding: 10px;
    }

    .style-controls {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .style-controls.single {
      grid-template-columns: minmax(220px, 320px);
    }

    .host-style-note {
      margin: 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.4;
    }

    .customize-modal.read-only .host-style-note {
      color: var(--accent-2);
    }

    .style-field {
      display: grid;
      gap: 7px;
      min-width: 0;
      color: #fce7f3;
      font-size: 11px;
      font-weight: 900;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .deck-preview-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
      min-height: 0;
      overflow: auto;
      padding-right: 2px;
    }

    .deck-preview {
      display: grid;
      gap: 10px;
      min-width: 0;
      min-height: 138px;
      padding: 11px;
      border-radius: 16px;
      border-color: rgba(255, 255, 255, 0.12);
      background: rgba(255, 255, 255, 0.06);
      text-align: left;
      transform: none;
    }

    .deck-preview:hover {
      transform: none;
      border-color: rgba(255, 140, 195, 0.48);
      background: rgba(255, 255, 255, 0.09);
    }

    .deck-preview:disabled {
      cursor: not-allowed;
      opacity: 0.58;
      transform: none;
    }

    .deck-preview.selected {
      border-color: rgba(255, 140, 195, 0.82);
      box-shadow: 0 0 20px rgba(255, 92, 168, 0.16), inset 0 0 18px rgba(255, 92, 168, 0.08);
    }

    .deck-preview > span {
      overflow: hidden;
      color: #fff;
      font-size: 12px;
      font-weight: 900;
      letter-spacing: 0.02em;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .preview-hand {
      display: flex;
      justify-content: center;
      gap: 6px;
      min-width: 0;
    }

    .preview-hand .card {
      width: 42px;
      height: 60px;
      padding: 6px;
      border-radius: 10px;
    }

    .preview-hand .card .rank,
    .preview-hand .card .suit {
      font-size: 15px;
    }

    .match-summary {
      display: grid;
      gap: 12px;
    }

    .winner-badge {
      padding: 14px;
      border-radius: 18px;
      border: 1px solid rgba(255, 140, 195, 0.42);
      background: rgba(255, 92, 168, 0.12);
      color: #fff;
      font-size: 20px;
      font-weight: 900;
      text-align: center;
      box-shadow: inset 0 0 30px rgba(255, 92, 168, 0.08);
    }

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

    .match-stats div {
      display: grid;
      gap: 4px;
      padding: 10px;
      border-radius: 14px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      background: rgba(0, 0, 0, 0.14);
      text-align: center;
    }

    .match-stats span {
      color: var(--muted);
      font-size: 10px;
      font-weight: 900;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .match-stats strong {
      color: #fff;
      font-size: 17px;
    }

    .match-last {
      padding: 11px 12px;
      border-radius: 16px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      background: rgba(255, 255, 255, 0.055);
      color: #e5e7eb;
      font-size: 13px;
      line-height: 1.35;
    }

    .modal-actions {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
    }

    .modal-actions.two-actions {
      grid-template-columns: repeat(2, 1fr);
    }

    .actions {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
    }

    .spectator-mode .actions {
      display: none;
    }

    .social-panel {
      display: grid;
      gap: 10px;
      padding: 12px;
      border-radius: 18px;
      background: rgba(255,255,255,0.055);
      border: 1px solid var(--border);
      position: relative;
      overflow: visible;
    }

    .section-title {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      align-items: center;
      gap: 8px;
      color: #fce7f3;
      font-size: 12px;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }

    .section-title span {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .reaction-grid {
      display: grid;
      grid-template-columns: repeat(6, 1fr);
      gap: 8px;
    }

    .reaction-btn {
      min-width: 0;
      min-height: 42px;
      padding: 8px;
      border-radius: 12px;
      font-size: 20px;
    }

    .reaction-burst {
      position: absolute;
      left: 50%;
      top: 50%;
      pointer-events: none;
      z-index: 4;
      font-size: 42px;
      filter: drop-shadow(0 0 14px rgba(255, 92, 168, 0.8));
      animation: floatReaction 900ms ease-out forwards;
    }

    @keyframes floatReaction {
      from { transform: translate(-50%, -20%) scale(0.85); opacity: 0; }
      18% { opacity: 1; }
      to { transform: translate(-50%, -105%) scale(1.28); opacity: 0; }
    }

    .theme-select {
      min-width: 0;
      border-radius: 12px;
      border: 1px solid rgba(255, 255, 255, 0.14);
      background: rgba(255, 255, 255, 0.08);
      color: white;
      outline: none;
      font-size: 13px;
    }

    .theme-select:focus {
      border-color: rgba(255, 92, 168, 0.72);
      box-shadow: 0 0 0 3px rgba(255, 92, 168, 0.14);
    }

    .theme-select {
      padding: 9px 10px;
    }

    .theme-select option {
      background: #111827;
      color: #fff;
    }

    button {
      appearance: none;
      border: 0;
      border-radius: 14px;
      padding: 12px 14px;
      cursor: pointer;
      color: white;
      font-weight: 800;
      background: rgba(255,255,255,0.1);
      border: 1px solid rgba(255,255,255,0.12);
      transition: transform 120ms ease, background 120ms ease, border 120ms ease;
    }

    button:hover { transform: translateY(-1px); background: rgba(255,255,255,0.16); }
    button:active { transform: translateY(0); }
    button.primary {
      background: linear-gradient(135deg, rgba(255, 79, 163, 0.45), rgba(157, 78, 221, 0.45));
      border-color: rgba(255, 140, 195, 0.65);
      box-shadow: 0 0 20px rgba(255, 92, 168, 0.18);
    }
    button.gold {
      background: linear-gradient(135deg, rgba(255, 143, 171, 0.38), rgba(255, 92, 168, 0.28));
      border-color: rgba(255, 143, 171, 0.58);
    }
    button.danger {
      background: linear-gradient(135deg, rgba(255, 61, 113, 0.38), rgba(120, 16, 50, 0.38));
      border-color: rgba(255, 61, 113, 0.58);
    }
    button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

    .footer {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
      padding: 8px 14px 10px;
      color: var(--muted);
      font-size: 12px;
    }

    .sound-control {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: min(520px, 100%);
    }

    .sound-toggle {
      min-width: 82px;
      padding: 9px 12px;
      border-radius: 12px;
      font-size: 11px;
    }

    .sound-toggle[aria-pressed="true"] {
      color: var(--muted);
      border-color: rgba(255, 255, 255, 0.16);
      background: rgba(255, 255, 255, 0.06);
      box-shadow: none;
    }

    .opacity-control,
    .range-control {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: min(280px, 100%);
      color: var(--muted);
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }

    .range-control {
      min-width: 150px;
      flex: 1;
    }

    .opacity-control input,
    .range-control input {
      flex: 1;
      min-width: 84px;
      accent-color: var(--accent);
    }

    .opacity-control strong,
    .range-control strong {
      width: 38px;
      color: #fff;
      font-size: 11px;
      text-align: right;
    }

    .setup-screen {
      position: fixed;
      inset: 0;
      display: grid;
      place-items: center;
      padding: 18px;
      background: transparent;
      z-index: 10;
    }

    .setup-card {
      width: min(520px, 94vw);
      padding: 22px;
      border-radius: 26px;
      border: 1px solid rgba(255, 255, 255, 0.16);
      background:
        radial-gradient(circle at top, rgba(255, 92, 168, 0.22), transparent 44%),
        linear-gradient(145deg, rgba(18, 10, 24, 0.92), rgba(8, 8, 16, 0.84));
      box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
      backdrop-filter: blur(16px);
    }

    .setup-card h1 {
      margin: 0 0 6px;
      font-size: 26px;
      letter-spacing: 0.02em;
    }

    .setup-card p {
      margin: 0 0 18px;
      color: var(--muted);
      font-size: 14px;
      line-height: 1.45;
    }

    .field {
      display: grid;
      gap: 8px;
      margin-bottom: 16px;
    }

    .field label {
      color: #fce7f3;
      font-size: 13px;
      font-weight: 800;
    }

    .field input {
      width: 100%;
      padding: 13px 14px;
      border-radius: 16px;
      border: 1px solid rgba(255, 255, 255, 0.14);
      background: rgba(255, 255, 255, 0.08);
      color: white;
      outline: none;
      font-size: 15px;
    }

    .field input:focus {
      border-color: rgba(255, 92, 168, 0.72);
      box-shadow: 0 0 0 3px rgba(255, 92, 168, 0.14);
    }

    .emoji-grid {
      display: grid;
      grid-template-columns: repeat(6, 1fr);
      gap: 10px;
      margin-bottom: 18px;
    }

    .emoji-option {
      min-height: 54px;
      display: grid;
      place-items: center;
      border-radius: 16px;
      border: 1px solid rgba(255, 255, 255, 0.12);
      background: rgba(255, 255, 255, 0.07);
      font-size: 26px;
    }

    .emoji-option.selected {
      border-color: rgba(255, 140, 195, 0.85);
      background: rgba(255, 92, 168, 0.22);
      box-shadow: 0 0 24px rgba(255, 92, 168, 0.2);
    }

    .room-tools {
      display: grid;
      gap: 10px;
      margin-bottom: 16px;
      padding: 12px;
      border-radius: 18px;
      border: 1px solid rgba(255, 255, 255, 0.12);
      background: rgba(255, 255, 255, 0.055);
    }

    .room-actions {
      display: grid;
      grid-template-columns: 0.9fr 1.1fr;
      gap: 10px;
    }

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

    .join-row input {
      min-width: 0;
      padding: 12px;
      border-radius: 14px;
      border: 1px solid rgba(255, 255, 255, 0.14);
      background: rgba(255, 255, 255, 0.08);
      color: white;
      outline: none;
      text-transform: uppercase;
    }

    .join-row input:focus {
      border-color: rgba(255, 92, 168, 0.72);
      box-shadow: 0 0 0 3px rgba(255, 92, 168, 0.14);
    }

    .room-status {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
    }

    .hidden { display: none !important; }

    @media (max-width: 820px) {
      body { overflow: hidden; }
      .game { height: calc(100vh - 12px); overflow: hidden; }
      .table {
        grid-template-columns: 1fr;
        overflow: auto;
      }
      .topbar { align-items: flex-start; }
      .actions { grid-template-columns: 1fr; }
      .modal-actions,
      .match-stats {
        grid-template-columns: 1fr;
      }
      .style-controls,
      .deck-preview-grid {
        grid-template-columns: 1fr;
      }
      .customize-modal {
        max-height: calc(100vh - 28px);
      }
      .round-info { grid-template-columns: 1fr; }
      .room-panel { grid-template-columns: 1fr; }
      .roster-panel { grid-template-columns: 1fr; }
      .hand-row { grid-template-columns: 1fr; }
      .match-actions { justify-content: stretch; }
      .match-actions button { flex: 1; }
      .reaction-grid { grid-template-columns: repeat(3, 1fr); }
      .room-actions { grid-template-columns: 1fr; }
    }

    @media (max-height: 760px) and (min-width: 821px) {
      .topbar {
        padding: 9px 18px;
      }

      .brand strong {
        font-size: 17px;
      }

      .brand span,
      .footer {
        font-size: 11px;
      }

      .table {
        gap: 10px;
        padding: 10px;
      }

      .panel,
      .social-panel {
        padding: 9px;
      }

      .player-card,
      .center {
        gap: 8px;
      }

      .center {
        display: grid;
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
        align-content: start;
      }

      .round-info,
      .room-panel,
      .roster-panel,
      .cards,
      .social-panel,
      .message,
      .actions {
        grid-column: 1 / -1;
      }

      .avatar {
        min-height: 84px;
      }

      .avatar .figure {
        width: 68px;
        height: 76px;
        font-size: 34px;
      }

      .layer {
        padding: 6px 8px;
      }

      .round-info {
        gap: 8px;
      }

      .stat {
        padding: 7px 9px;
      }

      .stat strong {
        font-size: 17px;
      }

      .room-panel,
      .roster-block {
        padding: 8px;
      }

      .roster-block {
        min-height: 88px;
      }

      .roster-row {
        padding: 5px 7px;
      }

      .cards {
        min-height: 128px;
        padding: 8px;
      }

      .empty-cards {
        min-height: 108px;
      }

      .hand-board {
        gap: 8px;
      }

      .hand-row {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 8px;
      }

      .card {
        width: 40px;
        height: 54px;
        border-radius: 10px;
        padding: 6px;
      }

      .card .rank,
      .card .suit {
        font-size: 15px;
      }

      .social-panel {
        gap: 8px;
      }

      .reaction-grid {
        gap: 6px;
      }

      .reaction-btn {
        min-height: 34px;
        padding: 5px;
        font-size: 18px;
      }

      .customize-modal {
        max-height: calc(100vh - 32px);
        gap: 10px;
        padding: 12px;
      }

      .deck-preview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }

      .deck-preview {
        min-height: 112px;
        gap: 8px;
        padding: 9px;
      }

      .preview-hand .card {
        width: 34px;
        height: 48px;
      }

      .message {
        min-height: 48px;
        max-height: 68px;
        overflow: hidden;
        padding: 9px 10px;
        font-size: 12px;
        line-height: 1.28;
      }

      .history-row {
        padding: 5px 8px;
      }

      button {
        padding: 10px 12px;
      }

      .footer {
        padding: 5px 14px 7px;
      }
    }
