body
{
   background-color: #FFFFFF;
   color: #000000;
   font-family: Arial;
   font-weight: normal;
   font-size: 13px;
   line-height: 1.1875;
   margin: 0;
   padding: 0;
}
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    background-color: #1a5c1a;
    background-repeat: repeat;
    background-size: 300px 200px;
    min-height: 100vh;
    overflow-y: auto;
    font-family: Georgia, serif;
    color: #f0d080;
    user-select: none;
    margin: 0; padding: 0;
  }
  h1 {
    font-size: 1.3em; text-align: center; margin-bottom: 2px;
    text-shadow: 0 0 20px #f0a020, 0 0 40px #c07000;
    letter-spacing: 3px;
  }
  .subtitle { font-size: 0.7em; color: #9070b0; margin-bottom: 6px; letter-spacing: 2px; }

  .hud { display: flex; gap: 8px; margin-bottom: 2px; align-items: center; flex-wrap: wrap; justify-content: center; }
  .hud-box {
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(240,160,32,0.5);
    border-radius: 8px; padding: 3px 12px; text-align: center; min-width: 68px;
    backdrop-filter: blur(2px);
  }
  .hud-label { font-size: 0.55em; color: #9070b0; text-transform: uppercase; letter-spacing: 1px; }
  .hud-value { font-size: 1.1em; font-weight: bold; color: #f0d080; }

  #btn-music {
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(240,160,32,0.5);
    color: #f0d080; font-size: 0.72em;
    font-family: Georgia, serif;
    padding: 5px 12px;
    border-radius: 7px; cursor: pointer;
    transition: all 0.2s; letter-spacing: 0.5px;
  }
  #btn-music:hover { background: rgba(240,160,32,0.2); transform: scale(1.05); }
  #btn-music.playing { border-color: #f0d080; color: #ffcc44; box-shadow: 0 0 8px rgba(240,160,32,0.4); }

  #btn-new {
    background: linear-gradient(135deg, #5a1a00, #c87020, #f0d060, #c87020, #5a1a00);
    background-size: 200% auto;
    animation: royalShine 3s linear infinite;
    border: 2px solid #f0d080;
    color: #fff8e0;
    font-size: 0.95em;
    letter-spacing: 2px;
    padding: 8px 22px;
    border-radius: 10px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
    box-shadow: 0 0 14px rgba(240,160,20,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
    background: linear-gradient(135deg, #7b3010, #c8760a, #f0a020);
    border: 1px solid #f0d080; color: #fff8e0;
    font-family: Georgia, serif; font-size: 0.75em;
    padding: 5px 14px; border-radius: 7px; cursor: pointer; letter-spacing: 1px;
    transition: all 0.2s;
  }
  #btn-new:hover { transform: scale(1.06); filter: brightness(1.15); }
  @keyframes royalShine {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
  }
  #btn-new:active { transform: scale(0.97); }

  #main-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
    max-width: 100%;
    justify-content: center;
    position: relative;
    z-index: 2;
    min-height: 100px;
  }

  @media (max-width: 700px) {
    #hof-sidebar { display: none; }
    h1 { font-size: 1em; letter-spacing: 2px; }
    .hud { gap: 5px; }
    .hud-box { min-width: 52px; padding: 3px 7px; }
    #btn-new, #btn-music { font-size: 0.65em; padding: 4px 9px; }
    .size-btn { font-size: 0.65em; padding: 3px 9px; }
  }
  @media (min-width: 701px) and (max-width: 1024px) {
    #hof-sidebar { min-width: 220px; max-width: 260px; font-size: 0.9em; }
    h1 { font-size: 1.1em; }
  }

  /* ── GOBLINS ── */
  #goblin-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
  }
  .goblin {
    position: absolute;
    opacity: 0.18;
    will-change: transform;
  }
  .goblin svg { display: block; }
  @keyframes goblinBob {
    0%,100% { transform: translateY(0px) rotate(-6deg); }
    50%      { transform: translateY(-18px) rotate(6deg); }
  }
  @keyframes smilePulse {
    0%,100% { transform: scaleY(1);   }
    40%,60% { transform: scaleY(1.5) translateY(-1px); }
  }
  @keyframes eyeBlink {
    0%,90%,100% { transform: scaleY(1); }
    95%          { transform: scaleY(0.1); }
  }

  #hof-sidebar {
    min-width: 280px;
    max-width: 340px;
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(240,160,32,0.45);
    border-radius: 10px;
    padding: 10px 8px;
    backdrop-filter: blur(3px);
    flex-shrink: 0;
    position: sticky;
    top: 10px;
  }

  #hof-sidebar-title {
    font-size: 0.8em;
    color: #f0d080;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 4px;
    text-shadow: 0 0 10px #f0a020;
  }
  .hof-tabs {
    display: flex; justify-content: center; gap: 3px; margin-bottom: 6px;
  }
  .hof-tab {
    background: rgba(0,0,0,0.3); border: 1px solid rgba(240,160,32,0.25);
    color: #9070b0; font-family: Georgia, serif; font-size: 0.6em;
    padding: 2px 7px; border-radius: 5px; cursor: pointer;
    transition: all 0.2s; letter-spacing: 0.5px;
  }
  .hof-tab:hover { border-color: #f0a020; color: #f0d080; }
  .hof-tab.active {
    border-color: #f0d080; background: rgba(240,160,32,0.15);
    color: #ffd700; text-shadow: 0 0 6px rgba(240,160,32,0.5);
  }

  #hof-sidebar-list {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72em;
  }
  #hof-sidebar-list th {
    color: #9070b0;
    border-bottom: 1px solid rgba(240,160,32,0.3);
    padding: 3px 4px;
    text-align: left;
    font-size: 0.85em;
    letter-spacing: 0.5px;
  }
  #hof-sidebar-list th:nth-child(3),
  #hof-sidebar-list td:nth-child(3) { text-align: right; }
  #hof-sidebar-list td { padding: 3px 4px; color: #d0b060; }
  #hof-sidebar-list td:last-child { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
  #hof-sidebar-list tr:nth-child(even) td { background: rgba(255,255,255,0.04); }
  #hof-sidebar-list tr.me td { color: #ffd700; font-weight: bold; }

  #game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 0;
  }

  #game-board {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-top: 6px;
    margin-left: auto;
    margin-right: auto;
  }
  #game-board.scattered {
    display: block;
  }

  .card-slot {
    perspective: 600px;
    /* Cast shadow on table beneath each card */
    filter: drop-shadow(4px 8px 6px rgba(0,0,0,0.55)) drop-shadow(1px 2px 2px rgba(0,0,0,0.4));
  }

  .card {
    width: 100%; height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.45s cubic-bezier(0.4,0.2,0.2,1);
    cursor: pointer;
  }

  .card-face {
    position: absolute; inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 6px; overflow: hidden;
    box-shadow: none;
    transition: box-shadow 0.2s;
  }

  .card:not(.flipped):not(.matched):hover .card-back {
    box-shadow: 0 0 10px rgba(240,160,32,0.7), 0 0 3px rgba(240,160,32,0.4);
    transform: translateY(-3px);
  }
  .card:not(.flipped):not(.matched) { cursor: pointer; }

  .card.flipped, .card.matched { transform: rotateY(180deg); }

  .card.matched .card-front {
    box-shadow: 0 0 18px 6px rgba(60,255,100,0.9), 0 0 40px 10px rgba(0,200,60,0.5);
    animation: matchPop 0.35s ease-out;
  }
  .card.matched { cursor: default; }

  @keyframes matchPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.08); }
    100% { transform: scale(1); }
  }

  .card-back {
    background: linear-gradient(145deg, #3d0e68 0%, #6b1e9a 45%, #3d0e68 100%);
    border: 1px solid #b07020;
    display: flex; align-items: center; justify-content: center;
  }
  .card-back-inner {
    width: 78%; height: 78%;
    border: 1px solid rgba(240,160,32,0.3);
    border-radius: 4px;
    background:
      radial-gradient(circle at center, rgba(240,160,32,0.1) 0%, transparent 65%),
      repeating-linear-gradient(45deg,
        rgba(240,160,32,0.06), rgba(240,160,32,0.06) 3px,
        transparent 3px, transparent 9px);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1em; color: rgba(240,160,32,0.5);
  }

  .card-front {
    transform: rotateY(180deg);
    border: 1px solid #b07020;
    background: #000;
  }
  .card-front img {
    width: 100%; height: 100%;
    object-fit: cover; display: block; pointer-events: none;
  }

  .size-picker {
    display: flex; gap: 6px; margin-bottom: 2px; justify-content: center; flex-wrap: wrap;
  }
  .size-btn {
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(240,160,32,0.45);
    color: #c0a040; font-family: Georgia, serif; font-size: 0.75em;
    padding: 4px 14px; border-radius: 7px; cursor: pointer;
    transition: all 0.2s; letter-spacing: 1px;
  }
  .size-btn:hover { border-color: #f0a020; color: #f0d080; background: rgba(240,160,32,0.1); }
  .size-btn.active {
    background: linear-gradient(135deg, #7b3010, #c8760a);
    border-color: #f0d080; color: #fff8e0;
    box-shadow: 0 3px 12px rgba(240,160,32,0.4);
  }

  .zoom-row {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 2px; justify-content: center;
  }
  .zoom-label { font-size: 0.7em; color: #9070b0; letter-spacing: 1px; white-space: nowrap; }
  #zoom-slider {
    -webkit-appearance: none; appearance: none;
    width: 160px; height: 4px;
    background: linear-gradient(to right, #c8760a, #f0a020);
    border-radius: 2px; outline: none; cursor: pointer;
  }
  #zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px; border-radius: 50%;
    background: #f0d080; border: 2px solid #c8760a; cursor: pointer;
  }
  #zoom-slider::-moz-range-thumb {
    width: 16px; height: 16px; border-radius: 50%;
    background: #f0d080; border: 2px solid #c8760a; cursor: pointer;
  }
  #message {
    margin-top: 8px; font-size: 0.95em; text-align: center;
    min-height: 22px; color: #f0d080; letter-spacing: 1px; padding: 0 10px;
  }

  /* ── Score / Hall of Fame Modal ─────────────────────────────────────── */
  #overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.75); z-index: 1000;
    align-items: center; justify-content: center;
  }
  #overlay.show { display: flex; }

  #modal {
    background: #1a0a2e;
    background-image: linear-gradient(145deg, #2a0e44, #1a0a2e);
    border: 2px solid #c08030;
    border-radius: 14px;
    padding: 22px 28px;
    width: min(480px, 95vw);
    box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 30px rgba(200,120,10,0.2);
    font-family: Georgia, serif; color: #f0d080;
    max-height: 90vh; overflow-y: auto;
  }
  #modal h2 {
    text-align: center; font-size: 1.5em; margin-bottom: 14px;
    text-shadow: 0 0 18px #f0a020; letter-spacing: 3px;
  }

  .score-grid {
    display: grid; grid-template-columns: 1fr auto;
    gap: 5px 16px; margin-bottom: 16px;
    font-size: 0.88em;
  }
  .score-grid .label { color: #a080c0; }
  .score-grid .val   { text-align: right; color: #f0d080; font-weight: bold; }
  .score-total {
    text-align: center; font-size: 1.8em; font-weight: bold;
    color: #ffd700; text-shadow: 0 0 16px #f0a020;
    margin: 8px 0 16px;
  }

  #sc-remark {
    white-space: pre-line;
    font-size: 0.82em;
    color: #d0c080;
    font-style: italic;
    text-align: center;
    margin: 8px 10px 4px;
    line-height: 1.5;
    min-height: 1.5em;
  }
  #name-row { display: flex; gap: 8px; margin-bottom: 14px; }
  #name-input {
    flex: 1; background: rgba(255,255,255,0.07);
    border: 1px solid rgba(240,160,32,0.5); border-radius: 7px;
    color: #f0d080; font-family: Georgia, serif; font-size: 0.9em;
    padding: 7px 12px; outline: none;
  }
  #name-input::placeholder { color: #7060a0; }
  #btn-submit {
    background: linear-gradient(135deg, #7b3010, #f0a020);
    border: 1px solid #f0d080; color: #fff8e0;
    font-family: Georgia, serif; font-size: 0.85em;
    padding: 7px 16px; border-radius: 7px; cursor: pointer;
    transition: all 0.2s; white-space: nowrap;
  }
  #btn-submit:hover { transform: scale(1.05); }
  #btn-submit:disabled { opacity: 0.5; cursor: default; transform: none; }

  #hof-title {
    text-align: center; font-size: 1em; color: #c08030;
    letter-spacing: 2px; margin-bottom: 8px; border-top: 1px solid rgba(192,128,48,0.3);
    padding-top: 12px;
  }
  #hof-list { width: 100%; border-collapse: collapse; font-size: 0.82em; }
  #hof-list th {
    color: #9070b0; font-weight: normal; letter-spacing: 1px;
    padding: 3px 6px; border-bottom: 1px solid rgba(192,128,48,0.25);
    text-align: left;
  }
  #hof-list th:last-child, #hof-list td:last-child { text-align: right; }
  #hof-list td { padding: 4px 6px; color: #d0b060; }
  #hof-list tr:nth-child(even) td { background: rgba(255,255,255,0.03); }
  #hof-list tr.me td { color: #ffd700; font-weight: bold; }
  .rank-medal { font-size: 1em; }

  #btn-close-modal {
    display: block; margin: 14px auto 0;
    background: transparent; border: 1px solid rgba(240,160,32,0.4);
    color: #a080c0; font-family: Georgia, serif; font-size: 0.8em;
    padding: 5px 18px; border-radius: 7px; cursor: pointer;
    transition: all 0.2s;
  }
  #btn-close-modal:hover { border-color: #f0a020; color: #f0d080; }
  @keyframes winPulse {
    0%,100% { text-shadow: 0 0 15px #f0d080, 0 0 30px #f0a020; }
    50%      { text-shadow: 0 0 30px #fff, 0 0 60px #f0d080, 0 0 90px #f0a020; }
  }
  .win-msg { animation: winPulse 1.2s infinite; }

  .compliment {
    position: fixed;
    left: 50%; top: 40%;
    transform: translate(-50%,-50%) scale(0.2);
    font-family: Georgia, serif;
    font-size: clamp(2.5em, 8vw, 5em);
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 30px currentColor, 0 4px 8px rgba(0,0,0,0.6);
    pointer-events: none;
    z-index: 999;
    white-space: nowrap;
    animation: complimentAnim 1.4s ease-out forwards;
  }
  @keyframes complimentAnim {
    0%   { transform: translate(-50%,-50%) scale(0.2); opacity:0; }
    20%  { transform: translate(-50%,-50%) scale(1.15); opacity:1; }
    50%  { transform: translate(-50%,-60%) scale(1);   opacity:1; }
    100% { transform: translate(-50%,-80%) scale(0.8); opacity:0; }
  }

  #btn-scatter {
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(240,160,32,0.45);
    color: #c0a040; font-family: Georgia, serif; font-size: 0.75em;
    padding: 4px 14px; border-radius: 7px; cursor: pointer;
    transition: all 0.2s; letter-spacing: 1px;
  }
  #btn-scatter:hover { border-color: #f0a020; color: #f0d080; background: rgba(240,160,32,0.1); }
  #btn-scatter.active { border-color: #f0d080; background: rgba(240,160,32,0.18); color: #ffd700; }

  #game-board.scattered {
    display: block;
    position: relative;
    min-height: 560px;
    width: 100% !important;
    max-width: 100%;
    overflow: hidden;
  }
  #game-board.scattered .card-slot {
    position: absolute;
    cursor: pointer;
  }
  #game-board.scattered .card-slot:hover {
    z-index: 50 !important;
  }

  #btn-wordmode {
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(240,160,32,0.45);
    color: #c0a040; font-family: Georgia, serif; font-size: 0.75em;
    padding: 4px 14px; border-radius: 7px; cursor: pointer;
    transition: all 0.2s; letter-spacing: 1px;
  }
  #btn-wordmode:hover { border-color: #f0a020; color: #f0d080; background: rgba(240,160,32,0.1); }
  #btn-wordmode.active { border-color: #f0d080; background: rgba(240,160,32,0.18); color: #ffd700; }

  .card-front.word-card {
    background: linear-gradient(145deg, #1a0a2e, #2a0e44);
    display: flex; align-items: center; justify-content: center;
    padding: 6px;
  }
  .card-front.word-card .word-label {
    color: #f0d080;
    font-family: Georgia, serif;
    font-weight: bold;
    font-size: 0.72em;
    text-align: center;
    text-shadow: 0 0 12px rgba(240,160,32,0.6);
    pointer-events: none;
    white-space: nowrap;
    line-height: 1.2;
  }

  /* ── GAME OVER OVERLAY ── */
  #gameover-overlay {
    display: none;
    position: fixed; inset: 0;
    z-index: 1100;
    align-items: center; justify-content: center;
    flex-direction: column;
    background: rgba(0,0,0,0.72);
    animation: goFadeIn 0.4s ease-out;
  }
  #gameover-overlay.show { display: flex !important; }
  @keyframes goFadeIn {
    from { opacity:0; } to { opacity:1; }
  }
  #gameover-text {
    font-family: Georgia, serif;
    font-size: clamp(3em, 10vw, 8em);
    font-weight: bold;
    color: #ff3333;
    text-align: center;
    text-shadow:
      0 0 40px #ff0000,
      0 0 80px #ff4400,
      0 4px 12px rgba(0,0,0,0.9);
    animation: goSlam 0.5s cubic-bezier(0.2,1.6,0.4,1) forwards;
    letter-spacing: 4px;
    line-height: 1.1;
  }
  @keyframes goSlam {
    0%   { transform: scale(3) rotate(-6deg); opacity:0; }
    60%  { transform: scale(0.92) rotate(1deg); opacity:1; }
    100% { transform: scale(1) rotate(0deg); opacity:1; }
  }
  #gameover-sub {
    margin-top: 20px;
    font-family: Georgia, serif;
    font-size: clamp(1em, 3vw, 1.8em);
    color: #f0c080;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    text-align: center;
    animation: goFadeIn 0.6s 0.3s ease-out both;
  }
  #gameover-btn {
    margin-top: 32px;
    padding: 12px 36px;
    background: linear-gradient(135deg, #7b3010, #c8760a, #f0a020);
    border: 2px solid #f0d080; color: #fff8e0;
    font-family: Georgia, serif; font-size: 1.1em;
    border-radius: 10px; cursor: pointer; letter-spacing: 2px;
    animation: goFadeIn 0.6s 0.5s ease-out both;
    transition: transform 0.15s;
  }
  #gameover-btn:hover { transform: scale(1.07); }

  .score-popup {
    position: fixed;
    font-family: Georgia, serif;
    font-weight: bold;
    font-size: clamp(1.2em, 3vw, 2em);
    color: #ffd700;
    text-shadow: 0 0 16px rgba(255,200,0,0.8), 0 2px 6px rgba(0,0,0,0.7);
    pointer-events: none;
    z-index: 998;
    white-space: nowrap;
    animation: scorePopAnim 1.2s ease-out forwards;
  }
  @keyframes scorePopAnim {
    0%   { transform: translateY(0) scale(0.5); opacity:0; }
    20%  { transform: translateY(-20px) scale(1.2); opacity:1; }
    60%  { transform: translateY(-60px) scale(1); opacity:1; }
    100% { transform: translateY(-110px) scale(0.8); opacity:0; }
  }

  /* ── STRIKE WARNING ── */
  #strike-warning {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.3);
    z-index: 1050;
    background: rgba(20,4,4,0.55);
    border: 1px solid rgba(240,120,0,0.35);
    border-radius: 14px;
    padding: 18px 36px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: none;
  }
  #strike-warning.warn-show {
    animation: warnPop 1.6s ease-out forwards;
  }
  @keyframes warnPop {
    0%   { transform: translate(-50%,-50%) scale(0.3); opacity:0; }
    15%  { transform: translate(-50%,-50%) scale(1.1);  opacity:1; }
    30%  { transform: translate(-50%,-50%) scale(1.0);  opacity:1; }
    70%  { transform: translate(-50%,-50%) scale(1.0);  opacity:1; }
    100% { transform: translate(-50%,-50%) scale(0.9);  opacity:0; }
  }
  #strike-warning .warn-title {
    font-family: Georgia, serif;
    font-size: clamp(1em, 3vw, 1.5em);
    font-weight: bold;
    color: #f0a040;
    text-shadow: 0 0 10px rgba(240,120,0,0.5);
    letter-spacing: 2px;
  }
  #strike-warning .warn-sub {
    font-family: Georgia, serif;
    font-size: clamp(0.85em, 2vw, 1.1em);
    color: #f0c080;
    margin-top: 6px;
  }

  /* ── GAME FRAME ── always visible, always correct ── */
  #game-frame {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    padding: 6px 8px;
  }

  /* ── HOF mobile overlay (phone only) ── */
  #hof-mobile-overlay {
    display: none; /* shown via JS on phones before game starts */
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.82);
    z-index: 600;
    align-items: center; justify-content: center;
  }
  #hof-mobile-overlay.show { display: flex; }
  #hof-mobile-panel {
    background: rgba(10,4,22,0.97);
    border: 1px solid rgba(240,160,32,0.6);
    border-radius: 14px;
    padding: 18px 20px;
    width: min(92vw, 400px);
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c08030 rgba(0,0,0,0.3);
  }
  #hof-mobile-panel::-webkit-scrollbar { width: 5px; }
  #hof-mobile-panel::-webkit-scrollbar-thumb { background: linear-gradient(180deg,#f0a020,#8b4a00); border-radius: 3px; }
  #hof-mobile-panel h3 {
    font-family: Georgia, serif; font-size: 1em;
    color: #f0d080; text-align: center;
    letter-spacing: 3px; margin-bottom: 12px;
  }
  #hof-mobile-table { width: 100%; border-collapse: collapse; font-size: 0.8em; }
  #hof-mobile-table th { color: #b07820; padding: 4px 6px; text-align: left; border-bottom: 1px solid rgba(192,128,48,0.3); }
  #hof-mobile-table td { color: #d0b060; padding: 4px 6px; }
  #hof-mobile-table tr:nth-child(even) td { background: rgba(255,255,255,0.04); }
  #btn-hof-close {
    display: block; margin: 14px auto 0;
    background: linear-gradient(135deg,#7b3010,#c8760a);
    border: 1px solid #f0d080; color: #fff8e0;
    font-family: Georgia,serif; font-size: 0.9em;
    padding: 8px 28px; border-radius: 8px; cursor: pointer;
  }
  /* Show HOF button on mobile when game is running */
  #btn-show-hof {
    display: none;
  }
  @media (max-width: 700px) {
    #btn-show-hof {
      display: inline-block;
      background: rgba(0,0,0,0.45);
      border: 1px solid rgba(240,160,32,0.5);
      color: #c0a040; font-family: Georgia,serif; font-size: 0.65em;
      padding: 4px 12px; border-radius: 7px; cursor: pointer;
    }
  }

  /* ── HOF remark tooltip ── */
  .hof-row { position: relative; cursor: default; }
  .hof-row td { transition: background 0.15s; }
  .hof-row:hover td { background: rgba(240,160,32,0.12) !important; }
  .hof-row:hover td:nth-child(2) {
    outline: 1px solid rgba(240,160,32,0.7);
    border-radius: 4px;
    color: #ffd700;
  }
  .hof-row .hof-tooltip {
    display: block;
    position: absolute;
    left: 60%;
    bottom: calc(100% + 6px);
    transform: translateX(0);
    background: rgba(10,4,22,0.97);
    border: 1px solid rgba(240,160,32,0.6);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.82em;
    color: #e0c070;
    white-space: normal;
    width: 200px;
    z-index: 800;
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.8);
    text-align: center;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.4s ease;
    transition-delay: 0s;
  }
  .hof-row .hof-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 30%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(240,160,32,0.6);
  }
  .hof-row:hover .hof-tooltip {
    opacity: 1;
    transition-delay: 1s;
  }

  /* ── Floating champion name ── */
  .champion-label {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    font-family: Georgia, serif;
    font-weight: bold;
    color: #c080ff;
    text-shadow: 0 0 10px rgba(180,80,255,0.5);
    opacity: 0.22;
    white-space: nowrap;
  }
  @keyframes championBob {
    0%,100% { transform: translateY(0px) rotate(-3deg); }
    50%      { transform: translateY(-18px) rotate(3deg); }
  }

  /* ── TWO PLAYER ── */
  #twop-bar {
    display: none;
    gap: 12px;
    justify-content: center;
    align-items: stretch;
    margin-bottom: 4px;
    width: 100%;
  }
  #twop-bar.show { display: flex; }
  .player-panel {
    flex: 1;
    max-width: 220px;
    border-radius: 10px;
    padding: 6px 14px;
    text-align: center;
    border: 2px solid rgba(255,255,255,0.1);
    transition: all 0.3s;
    font-family: Georgia, serif;
  }
  .player-panel.active-player {
    border-color: #f0d080;
    box-shadow: 0 0 16px rgba(240,160,0,0.5);
    transform: scale(1.04);
  }
  .player-panel.p1 { background: rgba(30,10,80,0.7); }
  .player-panel.p2 { background: rgba(80,10,10,0.7); }
  .player-name {
    font-size: 0.75em; font-weight: bold; letter-spacing: 2px;
    color: #f0d080; margin-bottom: 2px;
  }
  .player-score-val {
    font-size: 1.4em; font-weight: bold; color: #fff;
  }
  .player-pairs-val {
    font-size: 0.65em; color: #c0a0e0;
  }
  #twop-toggle {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(240,160,32,0.5);
    color: #c0a040; font-family: Georgia,serif; font-size: 0.72em;
    padding: 4px 12px; border-radius: 7px; cursor: pointer;
    transition: all 0.2s; letter-spacing: 1px;
  }
  #twop-toggle:hover { border-color: #f0a020; color: #f0d080; }
  #twop-toggle.active { border-color: #f0d080; background: rgba(240,160,32,0.18); color: #ffd700; }
  #turn-banner {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%) scale(0.3);
    font-family: Georgia,serif;
    font-size: clamp(2em,6vw,3.5em);
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 30px currentColor;
    pointer-events: none;
    z-index: 600;
    white-space: nowrap;
    animation: none;
  }
  @keyframes turnAnim {
    0%   { transform:translate(-50%,-50%) scale(0.3); opacity:0; }
    20%  { transform:translate(-50%,-50%) scale(1.1); opacity:1; }
    70%  { transform:translate(-50%,-50%) scale(1); opacity:1; }
    100% { transform:translate(-50%,-50%) scale(0.9); opacity:0; }
  }

  /* ── ONLINE MULTIPLAYER ── */
  #online-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 2000;
    align-items: center; justify-content: center;
    flex-direction: column;
    gap: 14px;
    font-family: Georgia, serif;
  }
  #online-overlay.show { display: flex; }
  #online-panel {
    background: rgba(10,4,28,0.98);
    border: 2px solid rgba(240,160,32,0.7);
    border-radius: 16px;
    padding: 28px 36px;
    width: min(92vw, 440px);
    text-align: center;
    box-shadow: 0 0 60px rgba(200,100,0,0.2);
  }
  #online-panel h2 {
    color: #f0d080; font-size: 1.3em; letter-spacing: 3px; margin-bottom: 18px;
  }
  .online-btn {
    display: block; width: 100%; padding: 11px;
    margin: 8px 0;
    background: linear-gradient(135deg,#3a1000,#906020);
    border: 1px solid #f0d080; border-radius: 9px;
    color: #fff8e0; font-family: Georgia,serif; font-size: 1em;
    cursor: pointer; letter-spacing: 1px; transition: filter 0.2s;
  }
  .online-btn:hover { filter: brightness(1.2); }
  .online-input {
    width: 100%; padding: 9px 12px; margin: 6px 0;
    background: rgba(0,0,0,0.5); border: 1px solid rgba(240,160,32,0.45);
    border-radius: 8px; color: #f0d080; font-family: Georgia,serif; font-size: 1em;
    outline: none; text-align: center; letter-spacing: 2px;
  }
  #online-status {
    color: #c0a060; font-size: 0.9em; min-height: 1.4em; margin: 6px 0;
  }
  #room-code-display {
    font-size: 2.5em; font-weight: bold; color: #ffd700; letter-spacing: 8px;
    margin: 10px 0; text-shadow: 0 0 20px rgba(255,200,0,0.5);
  }

  /* ── IN-GAME ONLINE HUD ── */
  #online-hud {
    display: none;
    position: fixed; top: 0; left: 0; right: 0;
    background: rgba(10,4,28,0.92);
    border-bottom: 1px solid rgba(240,160,32,0.4);
    padding: 6px 14px;
    z-index: 1500;
    gap: 10px; align-items: center; justify-content: space-between;
    font-family: Georgia,serif;
  }
  #online-hud.show { display: flex; }
  .ohud-player {
    flex: 1; text-align: center; padding: 4px 8px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1); transition: all 0.3s;
  }
  .ohud-player.my-turn {
    border-color: #f0d080;
    box-shadow: 0 0 12px rgba(240,160,0,0.5);
  }
  .ohud-name { font-size: 0.7em; color: #c0a060; letter-spacing: 1px; }
  .ohud-score { font-size: 1.1em; font-weight: bold; color: #fff; }
  .ohud-turn-tag {
    font-size: 0.6em; color: #ffd700; display: none;
  }
  .ohud-player.my-turn .ohud-turn-tag { display: block; }
  #ohud-middle { text-align: center; color: #a090c0; font-size: 0.75em; }
  #btn-leave-game {
    background: rgba(120,20,20,0.7); border: 1px solid #ff6060;
    color: #ffa0a0; padding: 4px 10px; border-radius: 6px;
    font-size: 0.7em; cursor: pointer; font-family: Georgia,serif;
  }

  /* ── ONLINE CHAT ── */
  #online-chat {
    display: none;
    position: fixed; bottom: 0; right: 0;
    width: min(300px, 90vw);
    background: rgba(10,4,28,0.93);
    border: 1px solid rgba(240,160,32,0.4);
    border-radius: 12px 12px 0 0;
    z-index: 1500;
    flex-direction: column;
    overflow: hidden;
  }
  #online-chat.show { display: flex; }
  #chat-header {
    padding: 6px 12px; background: rgba(240,160,32,0.12);
    border-bottom: 1px solid rgba(240,160,32,0.3);
    font-family: Georgia,serif; font-size: 0.8em; color: #f0d080;
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer;
  }
  #chat-messages {
    height: 160px; overflow-y: auto; padding: 8px;
    scrollbar-width: thin; scrollbar-color: #c08030 rgba(0,0,0,0.3);
  }
  #chat-messages::-webkit-scrollbar { width: 4px; }
  #chat-messages::-webkit-scrollbar-thumb { background: #c08030; border-radius: 2px; }
  .chat-msg { font-size: 0.78em; margin-bottom: 5px; line-height: 1.4; }
  .chat-msg .chat-who { font-weight: bold; }
  .chat-msg.me .chat-who { color: #80d0ff; }
  .chat-msg.them .chat-who { color: #ff9080; }
  .chat-msg.sys { color: #8060a0; font-style: italic; }
  #chat-input-row { display: flex; padding: 6px; gap: 5px; border-top: 1px solid rgba(240,160,32,0.2); }
  #chat-input {
    flex: 1; padding: 5px 8px;
    background: rgba(0,0,0,0.4); border: 1px solid rgba(240,160,32,0.3);
    border-radius: 6px; color: #f0d080; font-size: 0.78em; outline: none;
    font-family: Georgia,serif;
  }
  #chat-send {
    padding: 5px 10px; background: rgba(240,160,32,0.2);
    border: 1px solid rgba(240,160,32,0.5); border-radius: 6px;
    color: #f0d080; font-size: 0.78em; cursor: pointer;
  }
  #chat-badge {
    display: none; background: #ff4444; color: #fff;
    border-radius: 50%; width: 16px; height: 16px;
    font-size: 0.65em; text-align: center; line-height: 16px;
  }

  /* ── ADMIN PANEL ── */
  #admin-btn {
    display: none !important;
    position: fixed; bottom: 14px; left: 14px;
    background: rgba(10,4,22,0.7);
    border: 1px solid rgba(240,160,32,0.3);
    color: #806020; font-family: Georgia,serif; font-size: 0.7em;
    padding: 4px 10px; border-radius: 6px; cursor: pointer;
    z-index: 800; letter-spacing: 1px;
    opacity: 0.35;
    transition: opacity 0.3s;
  }
  #admin-btn:hover { opacity: 1; border-color: #ffd700; color: #ffd700; }
  #admin-panel {
    display: none; position: fixed; bottom: 50px; left: 14px;
    background: rgba(10,4,28,0.97);
    border: 1px solid rgba(240,160,32,0.6);
    border-radius: 12px; padding: 16px 20px;
    z-index: 2500; min-width: 260px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.8);
    font-family: Georgia, serif;
  }
  #admin-panel h3 {
    color: #ffd700; font-size: 0.9em; letter-spacing: 3px;
    margin-bottom: 12px; text-align: center;
    border-bottom: 1px solid rgba(240,160,32,0.3);
    padding-bottom: 8px;
  }
  .admin-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin: 10px 0; color: #d0b060; font-size: 0.82em;
  }
  .admin-toggle {
    position: relative; width: 42px; height: 22px; cursor: pointer;
  }
  .admin-toggle input { opacity: 0; width: 0; height: 0; }
  .admin-slider {
    position: absolute; inset: 0; background: #333;
    border-radius: 22px; transition: 0.3s;
  }
  .admin-slider:before {
    content: ''; position: absolute;
    width: 16px; height: 16px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: 0.3s;
  }
  .admin-toggle input:checked + .admin-slider { background: #c8a000; }
  .admin-toggle input:checked + .admin-slider:before { transform: translateX(20px); }
