@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg-deep: #050a16;
  --bg-panel: #0d172c;
  --bg-card: #121f3a;
  --border-line: #22375d;
  --border-gold: linear-gradient(135deg, #ffe57f, #ffb300, #ff8f00);
  --cyan: #38d8ff;
  --cyan-glow: #00b4d8;
  --gold: #ffc72c;
  --gold-glow: #ffb703;
  --text-main: #f5f8ff;
  --text-muted: #94a7c8;

  /* Saturated Jewel Tones matching idea.png */
  --red: #ff2a4b;
  --red-light: #ff758c;
  --red-dark: #b8001f;
  --red-glow: rgba(255, 42, 75, 0.45);

  --green: #00d66c;
  --green-light: #47f59d;
  --green-dark: #007a3d;
  --green-glow: rgba(0, 214, 108, 0.45);

  --yellow: #ffb800;
  --yellow-light: #ffe066;
  --yellow-dark: #b37400;
  --yellow-glow: rgba(255, 184, 0, 0.45);

  --blue: #0088ff;
  --blue-light: #5cb5ff;
  --blue-dark: #004fb3;
  --blue-glow: rgba(0, 136, 255, 0.45);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden; /* Zero scroll app experience */
}

body {
  background:
    radial-gradient(ellipse 70% 40% at 50% -5%, #183363 0, transparent 65%),
    radial-gradient(ellipse 60% 45% at 85% 105%, #0d2847 0, transparent 60%),
    radial-gradient(ellipse 50% 35% at 15% 95%, #1b1638 0, transparent 55%),
    var(--bg-deep);
  color: var(--text-main);
  font-family: Outfit, system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  touch-action: manipulation;
}

a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* ----------------------------------------------------------- header / brand */

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 clamp(16px, 3.5vw, 44px);
  height: 50px;
  min-height: 50px;
  background: rgba(7, 13, 26, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(34, 55, 93, 0.7);
  position: relative;
  z-index: 20;
  flex-shrink: 0;
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 clamp(16px, 3.5vw, 44px);
  height: 36px;
  min-height: 36px;
  background: rgba(7, 13, 26, 0.85);
  border-top: 1px solid rgba(34, 55, 93, 0.7);
  color: #7287af;
  font-size: 11.5px;
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  margin-top: 0;
}

/* Hide footer during gameplay to give 100% viewport space to the board and controls */
body.in-game footer,
body:has(#game:not(.hidden)) footer {
  display: none !important;
}

.brand {
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(56, 216, 255, 0.35);
}
.brand-dice {
  font-size: 24px;
  filter: drop-shadow(0 0 10px rgba(56, 216, 255, 0.6));
  animation: diceWiggle 4s ease-in-out infinite;
}
.accent { color: var(--cyan); }
.top-nav-right { display: flex; align-items: center; gap: 14px; }
.sound-toggle {
  background: #111d33;
  border: 1px solid #283e68;
  border-radius: 10px;
  padding: 6px 11px;
  font-size: 14px;
  cursor: pointer;
  color: #fff;
  transition: all .2s;
}
.sound-toggle:hover { background: #1a2c4e; transform: scale(1.06); }
.tag, .eyebrow { font-size: 11px; letter-spacing: 2.4px; color: var(--cyan); font-weight: 800; }

main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(6px, 1.2vh, 16px) clamp(8px, 1.8vw, 18px);
  position: relative;
  z-index: 10;
  overflow: hidden;
}

.panel {
  position: relative;
  background: linear-gradient(160deg, rgba(17, 30, 56, 0.94), rgba(10, 18, 35, 0.98));
  border: 1px solid rgba(44, 70, 114, 0.65);
  border-radius: 24px;
  padding: clamp(16px, 2.5vw, 32px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

/* -------------------------------------------------------------------- hero */

.hero {
  max-width: 620px;
  margin: auto;
  text-align: center;
  padding: clamp(16px, 2.8vh, 36px) clamp(16px, 3vw, 40px);
  isolation: isolate;
  background: linear-gradient(165deg, rgba(18, 33, 64, 0.96), rgba(8, 14, 28, 0.98));
  max-height: 100%;
  overflow: hidden;
}

.hero-decorations {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.float-pawn {
  position: absolute;
  font-size: 34px;
  opacity: 0.85;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6));
  animation: floatSlow 5s ease-in-out infinite alternate;
}
.float-pawn-red { color: var(--red); top: 12%; left: 8%; transform: rotate(-15deg); }
.float-pawn-green { color: var(--green); top: 14%; right: 9%; transform: rotate(15deg); animation-delay: -1.5s; }
.float-pawn-yellow { color: var(--yellow); bottom: 15%; right: 7%; transform: rotate(-12deg); animation-delay: -3s; }
.float-pawn-blue { color: var(--blue); bottom: 18%; left: 7%; transform: rotate(12deg); animation-delay: -4.5s; }
.float-die {
  position: absolute;
  font-size: 38px;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,0.6));
  animation: floatSlow 6s ease-in-out infinite alternate;
}
.float-die-left { top: 38%; left: 3%; transform: rotate(20deg); animation-delay: -2s; }
.float-die-right { top: 36%; right: 3%; transform: rotate(-25deg); animation-delay: -4s; }

.hero .logo {
  font-size: clamp(66px, 15vw, 116px);
  font-weight: 900;
  letter-spacing: 6px;
  line-height: 0.95;
  margin: 14px 0 10px;
  background: linear-gradient(180deg, #fffbe6 0%, #ffd54f 35%, #ff9800 75%, #cc6a00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 0 #8c4c00) drop-shadow(0 18px 38px rgba(255, 160, 0, 0.45));
  position: relative;
  display: inline-block;
}
.crown-box { position: relative; display: inline-block; }
.crown-ico {
  position: absolute;
  top: -34%;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  font-size: 0.48em;
  filter: drop-shadow(0 4px 12px rgba(255, 215, 0, 0.8));
  animation: crownFloat 3s ease-in-out infinite alternate;
}

.ribbon-tag {
  display: inline-block;
  background: linear-gradient(135deg, #d32f2f, #990000);
  border: 1px solid #ff7961;
  color: #fff;
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 800;
  padding: 6px 20px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  margin-bottom: 18px;
}

.hero .lead {
  color: #b9caeb;
  max-width: 480px;
  margin: 0 auto 30px;
  font-size: 15px;
  line-height: 1.65;
  position: relative;
  z-index: 1;
}
.hero small { display: block; color: #7f93bb; margin-top: 18px; font-size: 12px; }

.orb { position: absolute; border-radius: 50%; filter: blur(75px); opacity: .45; z-index: -1; }
.orb-a { width: 300px; height: 300px; background: #0077ff; top: -110px; left: -100px; }
.orb-b { width: 280px; height: 280px; background: #00d68f; bottom: -120px; right: -90px; }
.orb-c { width: 240px; height: 240px; background: #e65100; top: 40%; left: 35%; opacity: .2; }

.field { max-width: 420px; margin: 0 auto; position: relative; z-index: 2; }
.hero label { display: block; text-align: left; margin: 0 0 8px 4px; color: #b4c6e8; font-size: 12px; font-weight: 600; letter-spacing: .5px; }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #081124;
  border: 1px solid #2e4775;
  border-radius: 14px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
  transition: all .2s;
}
.input-wrap:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(56, 216, 255, 0.25), inset 0 2px 6px rgba(0,0,0,0.4);
}
.input-ico { font-size: 16px; padding: 0 0 0 16px; opacity: 0.6; }
.input-wrap input {
  width: 100%;
  padding: 16px 16px 16px 10px;
  background: transparent;
  border: 0;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  outline: none;
}
.input-wrap input::placeholder { color: #586c94; font-weight: 400; }

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 14px;
  padding: 13px 20px;
  font-weight: 700;
  color: var(--text-main);
  background: #192a4a;
  transition: all .16s ease-out;
}
button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.1); }
button:active:not(:disabled) { transform: translateY(1px); filter: brightness(0.95); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.primary {
  background: linear-gradient(145deg, #00c985, #009960);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 201, 133, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-weight: 800;
  letter-spacing: .4px;
}
.enter-btn {
  width: 100%;
  margin-top: 14px;
  padding: 16px 24px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(145deg, #00d66c, #009944);
  box-shadow: 0 10px 28px rgba(0, 214, 108, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-arrow { font-size: 18px; transition: transform .2s; }
.enter-btn:hover .btn-arrow { transform: translateX(4px); }

.ghost { background: #13223f; border: 1px solid #2d4572; color: #c6d6f5; }
.ghost:hover:not(:disabled) { background: #1a2d52; border-color: #3b5a94; }
.tiny { font-size: 12px; padding: 7px 14px; border-radius: 10px; }
.wide { width: 100%; }

/* ------------------------------------------------------------------- lobby */

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { font-size: clamp(22px, 3vw, 32px); margin: 6px 0 0; letter-spacing: -.5px; }

.columns { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px; }
.lobby-card {
  background: #0b152a;
  border: 1px solid #20355c;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
}
.lobby-card h3 {
  margin: 0 0 18px;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rooms { display: grid; gap: 10px; max-height: 380px; overflow-y: auto; padding-right: 4px; }
.room-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #0e1b34;
  border: 1px solid #273e6b;
  border-radius: 14px;
  padding: 13px 16px;
  animation: fade .25s ease;
  transition: all .2s;
}
.room-card:hover { border-color: #3f609e; transform: translateY(-1px); }
.room-details { display: grid; gap: 3px; }
.room-code-tag {
  font-family: monospace;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2.2px;
  color: var(--cyan);
}
.room-players-badge {
  color: var(--text-muted);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.join-room-btn {
  background: linear-gradient(145deg, #00d66c, #009944);
  color: #fff;
  padding: 9px 20px;
  border-radius: 11px;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(0, 214, 108, 0.35);
}

/* 2 Player & 4 Player Selection Cards matching idea.png */
.modes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.mode-card {
  position: relative;
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.mode-2 {
  background: linear-gradient(150deg, #0f9b58, #0a6b3d);
  border-color: rgba(255, 255, 255, 0.15);
}
.mode-4 {
  background: linear-gradient(150deg, #8e24aa, #5e1373);
  border-color: rgba(255, 255, 255, 0.15);
}
.mode-badge {
  font-size: 9.5px;
  letter-spacing: 1.5px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.28);
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.mode-icons { font-size: 24px; margin-bottom: 4px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4)); }
.mode-title { font-size: 15px; font-weight: 800; color: #fff; }
.mode-sub { font-size: 11px; color: rgba(255, 255, 255, 0.75); margin-top: 2px; }
.mode-check {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 14px;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.5);
  transition: all .2s;
}
.mode-card.selected {
  border-color: #ffd700;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.4), 0 10px 28px rgba(0,0,0,0.5);
  transform: translateY(-2px);
}
.mode-card.selected .mode-check { opacity: 1; transform: scale(1); }

.create-btn {
  padding: 15px 20px;
  font-size: 15px;
  margin-bottom: 10px;
}
.bot-btn {
  background: linear-gradient(145deg, #162b4d, #0d1a30);
  border: 1px solid #2c497c;
  color: #c7d8f9;
  padding: 13px 18px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}
.bot-btn:hover:not(:disabled) {
  background: #1c3660;
  border-color: var(--cyan);
  color: #fff;
}
.muted { color: var(--text-muted); font-size: 13px; line-height: 1.55; }

/* ------------------------------------------------------------- game screen */

.game-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: hidden;
  gap: clamp(4px, 1vh, 10px);
}
.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: 0;
}
.game-head h2 {
  font-size: clamp(16px, 2.2vw, 24px);
  margin: 2px 0 0;
}
.code-badge {
  background: #0f203d;
  color: var(--cyan);
  padding: 3px 10px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 13px;
  border: 1px solid #233e6f;
}

/* Turn Announcement Banner matching idea.png */
.turn-banner {
  background: linear-gradient(135deg, #0e1e3b, #091224);
  border: 1px solid #284273;
  border-radius: 14px;
  padding: 6px 16px;
  margin: 0 auto;
  max-width: 520px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: clamp(12.5px, 1.8vh, 14.5px);
  font-weight: 800;
  letter-spacing: .5px;
  color: #e2edff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  transition: all .3s;
}
.turn-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.turn-banner.is-my-turn {
  background: linear-gradient(135deg, #b8860b, #e6a100);
  border-color: #ffe57f;
  color: #0b152a;
  box-shadow: 0 6px 24px rgba(230, 161, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  animation: turnPulse 1.8s ease-in-out infinite;
}
.turn-banner.is-my-turn .turn-dot {
  background: #ffffff;
  box-shadow: 0 0 12px #ffffff;
}

.table {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(240px, 25vw, 290px);
  gap: clamp(10px, 1.6vw, 20px);
  align-items: center;
  overflow: hidden;
}
.board-area {
  min-width: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Luxury 3D Board Bezel Frame */
.board-frame {
  position: relative;
  padding: clamp(8px, 1.4vmin, 14px);
  background: linear-gradient(145deg, #162644, #0a1322);
  border-radius: clamp(16px, 2.6vmin, 26px);
  box-shadow:
    0 25px 65px rgba(0, 0, 0, 0.8),
    0 8px 20px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(0, 136, 255, 0.12),
    inset 0 1px 2px rgba(255, 255, 255, 0.2),
    inset 0 -2px 6px rgba(0, 0, 0, 0.6);
  border: 1.5px solid rgba(223, 167, 50, 0.55);
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.board {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  background: #f7f9fd;
  border: 3px solid #dfa732; /* Golden brass inlay rim */
  border-radius: clamp(10px, 2.2vmin, 18px);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.25), 0 0 0 2px #0a1324;
  overflow: hidden;
  touch-action: manipulation;
}

/* Bases (The 4 Large Corners) */
.base {
  position: absolute;
  width: 40%;
  height: 40%;
  z-index: 1;
  padding: 5.5%;
  border-radius: 18px;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.35), inset 0 -3px 8px rgba(0, 0, 0, 0.3);
}
.base.c-red { background: linear-gradient(145deg, #ff3b59, #cc0829); border: 1px solid #ff758c; }
.base.c-green { background: linear-gradient(145deg, #00e073, #008f44); border: 1px solid #47f59d; }
.base.c-yellow { background: linear-gradient(145deg, #ffc820, #d98200); border: 1px solid #ffe066; }
.base.c-blue { background: linear-gradient(145deg, #1e96ff, #0056cc); border: 1px solid #5cb5ff; }

/* Sunken Base Arena (Yard) */
.base .yard {
  width: 100%;
  height: 100%;
  background: linear-gradient(150deg, #ffffff, #edf2f9);
  border-radius: 24%;
  box-shadow:
    inset 0 6px 14px rgba(0, 0, 0, 0.22),
    inset 0 0 0 2px rgba(255, 255, 255, 0.9),
    0 3px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

/* 4 Sunken Brass Token Sockets */
.base .socket {
  position: absolute;
  width: 13%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, #e2ebf7 0%, #ccd9ec 100%);
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.35),
    0 0 0 2px #d4a736,
    0 1px 2px rgba(255, 255, 255, 0.8);
}

/* 15x15 Track Cells */
.cell {
  position: absolute;
  width: 6.6667%;
  height: 6.6667%;
  z-index: 2;
  border: 1px solid #c9d6e8;
  background: #ffffff;
  border-radius: 3px;
  box-shadow: inset 0 1px 1px #ffffff, 0 1px 2px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Safe Cells with Golden Star ⭐ */
.cell.safe {
  background: #fffdf5;
}
.safe-star {
  color: #f5a623;
  font-size: clamp(10px, 1.8vw, 15px);
  filter: drop-shadow(0 1px 3px rgba(245, 166, 35, 0.6));
}

/* Start Cells with Directional Arrow */
.cell.start {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6), 0 2px 6px rgba(0, 0, 0, 0.15);
}
.start-arrow {
  font-size: clamp(11px, 2vw, 17px);
  font-weight: 900;
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
}
.cell.start.c-red { background: linear-gradient(135deg, var(--red-light), var(--red)); }
.cell.start.c-green { background: linear-gradient(135deg, var(--green-light), var(--green)); }
.cell.start.c-yellow { background: linear-gradient(135deg, var(--yellow-light), var(--yellow)); }
.cell.start.c-blue { background: linear-gradient(135deg, var(--blue-light), var(--blue)); }

/* Colored Home Path Cells with Inward Chevrons */
.cell.homecell {
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}
.cell.homecell.c-red { background: linear-gradient(135deg, var(--red-light), var(--red)); }
.cell.homecell.c-green { background: linear-gradient(135deg, var(--green-light), var(--green)); }
.cell.homecell.c-yellow { background: linear-gradient(135deg, var(--yellow-light), var(--yellow)); }
.cell.homecell.c-blue { background: linear-gradient(135deg, var(--blue-light), var(--blue)); }

.home-arrow {
  font-size: clamp(10px, 1.8vw, 15px);
  color: #ffffff;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Central Home: 4 Perfect Symmetrical Quadrant Triangles with Concentric Golden Crown Medallion */
.centre {
  position: absolute;
  left: 40%;
  top: 40%;
  width: 20%;
  height: 20%;
  z-index: 2;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}
.centre-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.22));
}

/* ----------------------------------------------------------- 3D Pawns / Tokens */

.token {
  position: absolute;
  width: 5.6%;
  height: 7.8%;
  transform: translate(-50%, -86%);
  padding: 0;
  background: transparent;
  border: 0;
  z-index: 6;
  cursor: default;
  transition:
    left .34s cubic-bezier(.34, 1.5, .64, 1),
    top .34s cubic-bezier(.34, 1.5, .64, 1),
    transform .18s;
  pointer-events: auto;
}
.token.idle { pointer-events: none; }

/* Dynamic Hop Animation for Step-by-Step Counting */
.token.hopping {
  z-index: 30 !important;
  transition: left 0.16s linear, top 0.16s linear !important;
  animation: pawnHopArc 0.16s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards !important;
}

@keyframes pawnHopArc {
  0% {
    transform: translate(-50%, -86%) scale(1);
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.4));
  }
  48% {
    transform: translate(-50%, -150%) scale(1.24);
    filter: drop-shadow(0 20px 14px rgba(0, 0, 0, 0.45));
  }
  100% {
    transform: translate(-50%, -86%) scale(1);
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.4));
  }
}

/* Knocked back to base animation */
.token.captured {
  z-index: 20 !important;
  transition: left 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
  animation: pawnCapturedRetreat 0.45s ease-in-out forwards !important;
}

@keyframes pawnCapturedRetreat {
  0% { transform: translate(-50%, -86%) rotate(0deg) scale(1); }
  35% { transform: translate(-50%, -120%) rotate(-20deg) scale(1.1); }
  75% { transform: translate(-50%, -90%) rotate(12deg) scale(0.9); }
  100% { transform: translate(-50%, -86%) rotate(0deg) scale(1); }
}

.pawn-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pawn-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.pawn-drop-shadow {
  fill: rgba(0, 0, 0, 0.38);
  filter: blur(1.2px);
}

/* Movable Turn Active State */
.token.movable {
  cursor: pointer;
  z-index: 10;
  animation: pawnLevitate 1s ease-in-out infinite alternate;
}
.token.movable .pawn-selection-ring {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 130%;
  height: 40%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.7) 0%, rgba(255, 215, 0, 0) 70%);
  animation: ringPulse 1.2s ease-in-out infinite;
  pointer-events: none;
}
.token.movable:hover {
  transform: translate(-50%, -96%) scale(1.18);
  filter: brightness(1.15);
}
.token.done {
  opacity: .92;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}
.token.dormant {
  opacity: 0.72;
  filter: saturate(0.85);
  pointer-events: none;
}

/* ------------------------------------------------------------- HUD & Sidebar */

.side {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2vh, 14px);
  overflow-y: auto;
  padding-right: 2px;
}

/* Player Cards matching idea.png corner styles */
.players {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1vh, 9px);
}
.player-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #0b152a;
  border: 1px solid #20355c;
  border-radius: 15px;
  padding: 10px 14px;
  transition: all .25s ease;
  position: relative;
  overflow: hidden;
}
.player-card.active {
  background: #112344;
  border-color: #ffd700;
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: scale(1.02);
}
.player-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.player-avatar-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: #172a4d;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.player-card.c-red .player-pawn-ico { color: var(--red); }
.player-card.c-green .player-pawn-ico { color: var(--green); }
.player-card.c-yellow .player-pawn-ico { color: var(--yellow); }
.player-card.c-blue .player-pawn-ico { color: var(--blue); }
.player-pawn-ico { font-size: 18px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }

.player-card.active .active-radar {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid #ffd700;
  animation: radarPing 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.player-meta { min-width: 0; }
.player-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.player-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge {
  font-size: 9px;
  letter-spacing: .7px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 800;
  text-transform: uppercase;
}
.you-badge { background: rgba(56, 216, 255, 0.2); color: var(--cyan); border: 1px solid rgba(56, 216, 255, 0.4); }
.cpu-badge { background: rgba(255, 255, 255, 0.1); color: #a4b7da; }

.player-stars {
  display: flex;
  gap: 3px;
  margin-top: 3px;
}
.home-star {
  font-size: 12px;
  color: #273e68;
  transition: all .2s;
}
.home-star.filled {
  color: #ffc107;
  filter: drop-shadow(0 0 6px rgba(255, 193, 7, 0.8));
}

/* Mini Die displayed right inside player card */
.mini-die {
  width: 32px;
  height: 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2.5px;
  padding: 4px;
  background: linear-gradient(145deg, #ffffff, #e1e9f5);
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 -2px 3px rgba(0,0,0,0.1);
}
.mini-pip { border-radius: 50%; background: transparent; }
.mini-pip.on { background: #121e33; }

/* ------------------------------------------------------------- Controls & 3D Dice */

.controls {
  background: #0b152a;
  border: 1px solid #20355c;
  border-radius: 20px;
  padding: clamp(10px, 1.5vh, 18px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.2vh, 12px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
}

.controls-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1vh, 10px);
}

.dice-podium {
  position: relative;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Luxurious Circular Sunken Tabletop Arena */
.dice-arena {
  position: relative;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 35%, #152445 0%, #0c152a 60%, #040812 100%);
  border: 2.5px solid rgba(223, 167, 50, 0.65);
  box-shadow:
    inset 0 8px 24px rgba(0, 0, 0, 0.85),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 12px 30px rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  user-select: none;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* Pulsing aura when it's your turn to roll */
.dice-arena.ready {
  cursor: pointer;
  border-color: #38d8ff;
  box-shadow:
    inset 0 8px 24px rgba(0, 0, 0, 0.85),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 24px rgba(56, 216, 255, 0.6),
    0 12px 30px rgba(0, 0, 0, 0.65);
  animation: arenaPulse 1.8s ease-in-out infinite alternate;
}

@keyframes arenaPulse {
  0% {
    box-shadow:
      inset 0 8px 24px rgba(0, 0, 0, 0.85),
      0 0 12px rgba(56, 216, 255, 0.4),
      0 10px 26px rgba(0, 0, 0, 0.6);
  }
  100% {
    box-shadow:
      inset 0 8px 24px rgba(0, 0, 0, 0.85),
      0 0 28px rgba(56, 216, 255, 0.85),
      0 12px 32px rgba(0, 0, 0, 0.7);
  }
}

.dice-canvas {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  display: block;
  cursor: inherit;
}

.roll-btn {
  padding: 15px 22px;
  font-size: 15px;
  background: linear-gradient(145deg, #0088ff, #0056cc);
  box-shadow: 0 8px 24px rgba(0, 136, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.roll-btn:not(:disabled) {
  background: linear-gradient(145deg, #00c985, #009960);
  box-shadow: 0 8px 24px rgba(0, 201, 133, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.auto-dice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 12px;
  background: rgba(16, 29, 54, 0.7);
  border: 1.5px solid rgba(80, 110, 160, 0.35);
  color: #8da4cb;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}
.auto-dice-btn:hover {
  background: rgba(25, 45, 80, 0.85);
  border-color: rgba(56, 216, 255, 0.5);
  color: #d8e5fc;
}
.auto-dice-btn.active {
  background: linear-gradient(145deg, rgba(0, 201, 133, 0.18), rgba(0, 136, 255, 0.18));
  border-color: #00e676;
  color: #00e676;
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.auto-dice-btn.active::after {
  content: "●";
  font-size: 9px;
  color: #00e676;
  animation: autoPulse 1.4s ease-in-out infinite alternate;
}
@keyframes autoPulse {
  0% { opacity: 0.4; }
  100% { opacity: 1; text-shadow: 0 0 8px #00e676; }
}

.status {
  margin: 0;
  text-align: center;
  font-size: 13.5px;
  color: #b7caec;
  line-height: 1.5;
}

/* Activity Log */
.log-box {
  background: #0b152a;
  border: 1px solid #20355c;
  border-radius: 18px;
  padding: 14px 16px;
}
.log-title {
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 800;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.log { display: grid; gap: 6px; max-height: 120px; overflow-y: auto; padding-right: 4px; }
.log p {
  margin: 0;
  font-size: 12px;
  color: #8397bd;
  border-left: 2px solid #273e68;
  padding-left: 9px;
  line-height: 1.4;
}
.log p:first-child { color: #e1ebff; border-color: var(--cyan); font-weight: 600; }

/* ------------------------------------------------------------------ overlay */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(ellipse at 50% 40%, rgba(11, 28, 51, 0.85), rgba(5, 8, 15, 0.95));
  backdrop-filter: blur(10px);
  animation: fade .25s ease;
}
.confetti-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.win-card {
  position: relative;
  z-index: 2;
  width: min(440px, 100%);
  text-align: center;
  padding: 40px 28px 32px;
  border-radius: 28px;
  background: linear-gradient(165deg, #182e54, #0b1528);
  border: 2px solid #ffd700;
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.9), 0 0 50px rgba(255, 215, 0, 0.25);
  animation: pop .35s cubic-bezier(.2, 1.5, .4, 1);
}
.win-decorations {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 10px;
}
.win-pawn-left { font-size: 32px; color: var(--red); transform: rotate(-15deg); filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6)); }
.win-pawn-right { font-size: 32px; color: var(--blue); transform: rotate(15deg); filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6)); }
.trophy {
  font-size: 64px;
  filter: drop-shadow(0 10px 24px rgba(255, 176, 46, 0.8));
  animation: trophyFloat 2.5s ease-in-out infinite alternate;
}

/* 3D Curved Celebration Ribbon */
.win-ribbon {
  display: inline-block;
  background: linear-gradient(135deg, #e53935, #b71c1c);
  border: 2px solid #ff8a80;
  padding: 8px 32px;
  border-radius: 26px;
  box-shadow: 0 8px 24px rgba(229, 57, 53, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  margin-bottom: 14px;
}
.win-ribbon h2 {
  font-size: clamp(28px, 6vw, 40px);
  margin: 0;
  font-weight: 900;
  color: #fff;
  letter-spacing: .5px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.win-card p { margin: 0 0 26px; color: #c6d6f5; font-size: 15px; font-weight: 500; }
.win-actions { display: flex; gap: 12px; }
.win-play-btn {
  flex: 1;
  background: linear-gradient(145deg, #0088ff, #0056cc);
  box-shadow: 0 8px 24px rgba(0, 136, 255, 0.45);
}
.win-lobby-btn {
  flex: 1;
  background: linear-gradient(145deg, #00d66c, #009944);
  color: #fff;
  border: 0;
  box-shadow: 0 8px 24px rgba(0, 214, 108, 0.45);
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: #162a4d;
  border: 1px solid #36558f;
  color: #f0f5ff;
  padding: 12px 22px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 600;
  z-index: 60;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  animation: fade .2s ease;
}

/* -------------------------------------------------------------- animations */

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes floatSlow {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-16px) rotate(8deg); }
}
@keyframes crownFloat {
  0% { transform: translateX(-50%) translateY(0) rotate(-4deg); }
  100% { transform: translateX(-50%) translateY(-6px) rotate(4deg); }
}
@keyframes trophyFloat {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-8px) scale(1.05); }
}
@keyframes pawnLevitate {
  0% { transform: translate(-50%, -86%); }
  100% { transform: translate(-50%, -98%); }
}
@keyframes ringPulse {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(0.9); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.15); }
}
@keyframes turnPulse {
  0%, 100% { box-shadow: 0 8px 26px rgba(230, 161, 0, 0.45); }
  50% { box-shadow: 0 8px 38px rgba(255, 215, 0, 0.85); }
}
@keyframes diePulse {
  0%, 100% { box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6), 0 0 0 0 rgba(56, 216, 255, 0.6); }
  50% { box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6), 0 0 0 12px rgba(56, 216, 255, 0); }
}
@keyframes roll3d {
  0% { transform: rotate(0deg) scale(1); }
  30% { transform: rotate(180deg) scale(1.2) translateY(-10px); }
  60% { transform: rotate(360deg) scale(1.1) translateY(4px); }
  100% { transform: rotate(720deg) scale(1); }
}
@keyframes radarPing {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.7); opacity: 0; }
}
@keyframes diceWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}

/* -------------------------------------------------------------- responsive & zero-scroll */

/* Laptops and Mid Desktops */
@media (max-width: 1080px) {
  .table {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 14px;
  }
  .dice-arena {
    width: 120px;
    height: 120px;
  }
  .dice-canvas {
    width: 120px;
    height: 120px;
  }
  .roll-btn {
    padding: 12px 16px;
    font-size: 14px;
  }
}

/* Tablet Portrait & Mobile Portrait (<= 768px) */
@media (max-width: 768px) {
  .top {
    height: 40px;
    min-height: 40px;
    padding: 0 12px;
  }
  .brand {
    font-size: 17px;
    letter-spacing: 1px;
    gap: 6px;
  }
  .brand-dice {
    font-size: 20px;
  }
  .sound-toggle {
    padding: 4px 8px;
    font-size: 13px;
    border-radius: 8px;
  }
  .tag {
    display: none;
  }

  main {
    padding: 4px 8px;
    gap: 4px;
  }
  .game-panel {
    gap: 4px;
  }
  .game-head {
    padding: 0 2px;
    margin-bottom: 0;
  }
  .game-head h2 {
    display: none;
  }
  .turn-banner {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 10px;
    max-width: 100%;
  }

  /* Table becomes vertical flex container fitting exact viewport */
  .table {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    justify-content: space-between;
    overflow: hidden;
  }

  /* Unwrap sidebar items so they can be positioned around the board */
  .side {
    display: contents;
  }

  /* 1. Players Strip at Top: 4-Column Horizontal Layout */
  .players {
    order: 1;
    display: flex !important;
    flex-direction: row !important;
    gap: 4px;
    justify-content: center;
    flex-shrink: 0;
    width: 100%;
  }
  .player-card {
    flex: 1 1 0;
    min-width: 0;
    padding: 4px 4px;
    border-radius: 10px;
    gap: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .player-card.active {
    transform: none;
    border-color: #ffd700;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.45);
  }
  .player-left {
    gap: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-width: 0;
  }
  .player-avatar-wrap {
    width: 19px;
    height: 19px;
  }
  .player-pawn-ico {
    font-size: 13px;
  }
  .player-meta {
    width: 100%;
    min-width: 0;
  }
  .player-name-row {
    justify-content: center;
    gap: 2px;
    width: 100%;
  }
  .player-name {
    font-size: 10px;
    max-width: 48px;
  }
  .badge {
    font-size: 6.5px;
    padding: 1px 3px;
    border-radius: 3px;
  }
  .player-stars {
    gap: 1px;
    margin-top: 1px;
    justify-content: center;
  }
  .home-star {
    font-size: 8px;
  }
  .player-right {
    display: none;
  }

  /* 2. Board Area in Center: Scaled to fit remaining height & width */
  .board-area {
    order: 2;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 2px 0;
  }
  .board-frame {
    padding: 6px;
    border-radius: 16px;
    height: 100%;
    max-height: 100%;
    width: auto;
    max-width: 100%;
    aspect-ratio: 1 / 1;
  }
  .board {
    border-radius: 12px;
    border-width: 2px;
  }

  /* 3. Controls at Bottom: Horizontal HUD Bar */
  .controls {
    order: 3;
    flex-shrink: 0;
    padding: 8px 12px;
    border-radius: 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
  }
  .dice-podium {
    padding: 0;
    flex-shrink: 0;
  }
  .dice-arena {
    width: 76px;
    height: 76px;
    border-width: 2px;
  }
  .dice-canvas {
    width: 76px;
    height: 76px;
  }
  .controls-actions {
    flex: 1;
    min-width: 0;
    gap: 4px;
    align-items: stretch;
  }
  .roll-btn {
    padding: 8px 12px;
    font-size: 13.5px;
    border-radius: 10px;
    width: 100%;
  }
  .auto-dice-btn {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 8px;
    width: 100%;
  }
  .status {
    font-size: 10.5px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    margin: 0;
  }
  .bot-btn {
    padding: 7px 10px;
    font-size: 11.5px;
    border-radius: 8px;
  }

  /* 4. Log Box: hidden on mobile portrait */
  .log-box {
    display: none;
  }

  /* Welcome Screen Mobile */
  .hero {
    padding: clamp(12px, 2vh, 22px) 14px;
    max-width: 100%;
    overflow: hidden;
  }
  .float-pawn, .float-die {
    display: none;
  }
  .hero .logo {
    font-size: clamp(40px, 9vh, 64px);
    letter-spacing: 3px;
  }
  .ribbon-tag {
    padding: 3px 12px;
    font-size: 9.5px;
    margin-bottom: 8px;
  }
  .hero .lead {
    font-size: 13px;
    margin-bottom: 14px;
  }
  .hero label {
    font-size: 11px;
    margin-bottom: 4px;
  }
  .input-wrap input {
    padding: 12px 14px 12px 8px;
    font-size: 14px;
  }
  .enter-btn {
    padding: 12px 18px;
    font-size: 14px;
    margin-top: 8px;
  }
  .hero small {
    font-size: 10.5px;
    margin-top: 8px;
  }

  /* Lobby Screen Mobile */
  #lobby {
    overflow-y: auto;
    max-height: 100%;
  }
  #lobby .columns {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: visible;
  }
  #lobby .lobby-card {
    padding: 14px;
    border-radius: 16px;
  }
  #lobby .lobby-card h3 {
    margin-bottom: 10px;
    font-size: 15px;
  }
  #lobby .rooms {
    max-height: 180px;
    gap: 8px;
  }
  .modes-grid {
    gap: 8px;
    margin-bottom: 10px;
  }
  .mode-card {
    padding: 10px 8px;
  }
  .mode-icons {
    font-size: 18px;
  }
  .mode-title {
    font-size: 13px;
  }
  .mode-sub {
    font-size: 10px;
  }
  .create-btn {
    padding: 11px 16px;
    font-size: 13.5px;
  }
}

/* Extra Compact Phones (<= 380px) */
@media (max-width: 380px) {
  .player-name {
    max-width: 42px;
    font-size: 9.5px;
  }
  .dice-arena {
    width: 68px;
    height: 68px;
  }
  .dice-canvas {
    width: 68px;
    height: 68px;
  }
  .roll-btn {
    font-size: 12.5px;
    padding: 7px 10px;
  }
}

/* Mobile & Tablet Landscape (short screen height) */
@media (max-height: 520px) and (orientation: landscape) {
  .top {
    height: 32px;
    min-height: 32px;
    padding: 0 10px;
  }
  .brand {
    font-size: 15px;
  }
  .brand-dice {
    font-size: 17px;
  }
  main {
    padding: 2px 8px;
  }
  .game-panel {
    gap: 2px;
  }
  .game-head {
    display: none;
  }
  .turn-banner {
    padding: 2px 10px;
    font-size: 11px;
    border-radius: 8px;
    margin-bottom: 2px;
  }
  .table {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 220px !important;
    gap: 8px !important;
    height: 100% !important;
  }
  .side {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    gap: 6px !important;
    overflow-y: auto !important;
  }
  .players {
    order: unset !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 4px !important;
  }
  .player-card {
    padding: 3px 6px !important;
    border-radius: 8px !important;
    flex-direction: row !important;
  }
  .player-left {
    flex-direction: row !important;
  }
  .player-avatar-wrap {
    width: 18px !important;
    height: 18px !important;
  }
  .player-pawn-ico {
    font-size: 12px !important;
  }
  .player-name {
    font-size: 10px !important;
    max-width: 48px !important;
  }
  .controls {
    order: unset !important;
    padding: 6px 8px !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    border-radius: 12px !important;
  }
  .dice-arena {
    width: 60px !important;
    height: 60px !important;
  }
  .dice-canvas {
    width: 60px !important;
    height: 60px !important;
  }
  .roll-btn {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }
  .auto-dice-btn {
    padding: 3px 6px !important;
    font-size: 10px !important;
  }
  .status {
    font-size: 9.5px !important;
  }
  .log-box {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
