/* ===== ROYAL CHESS GAME CSS ===== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Lato:wght@300;400;700&display=swap');

:root {
  --gold:      #d4af37;
  --gold-lt:   #f0d060;
  --gold-dk:   #a07820;
  --green-bg:  #1a3a2a;
  --green-dk:  #0f2418;
  --green-lt:  #2a5a3a;
  --wood-lt:   #c8a96e;
  --wood-dk:   #7a4a1c;
  --wood-mid:  #a0693a;
  --panel-bg:  rgba(15,36,24,0.92);
  --panel-border: rgba(212,175,55,0.35);
  --text-gold: #d4af37;
  --text-lt:   #f5e8c0;
  --text-dim:  #8a9a80;
  --shadow-gold: 0 0 30px rgba(212,175,55,0.25);
  --radius:    12px;
}

/* WRAPPER */
.royal-chess-wrapper, #royal-chess-wrapper {
  width: 100%;
  box-sizing: border-box;
  font-family: 'Lato', sans-serif;
}

/* GAME CONTAINER */
.chess-game-container {
  position: relative;
  background: radial-gradient(ellipse at 50% 0%, #2a5a3a 0%, #1a3a2a 40%, #0f1e16 100%);
  min-height: 100px;
  padding: 18px 16px 24px;
  border-radius: 18px;
  box-shadow:
    0 0 60px rgba(212,175,55,0.18),
    0 0 120px rgba(212,175,55,0.08),
    0 8px 40px rgba(0,0,0,0.6);
  border: 1px solid rgba(212,175,55,0.2);
  overflow: hidden;
}

/* GREEN BG GRAIN OVERLAY */
.chess-game-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  border-radius: 18px;
}

.chess-game-container > * { position: relative; z-index: 1; }

/* GOLDEN AURA GLOW CORNERS */
.chess-game-container::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(212,175,55,0.25) 0%, transparent 40%, transparent 60%, rgba(212,175,55,0.25) 100%);
  pointer-events: none;
  z-index: 0;
}

/* TOP BAR */
.chess-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(212,175,55,0.2);
}

.chess-logo {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(212,175,55,0.5);
  letter-spacing: 2px;
}
.chess-logo span { color: var(--text-lt); }

.chess-top-controls { display: flex; gap: 10px; }

/* BUTTONS */
.chess-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 8px 16px;
  border: 1px solid var(--gold-dk);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.chess-btn-guide {
  background: linear-gradient(135deg, #1e3a28, #2a5040);
  color: var(--gold-lt);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.chess-btn-guide:hover {
  background: linear-gradient(135deg, #2a5040, #1e3a28);
  box-shadow: 0 0 14px rgba(212,175,55,0.35);
  transform: translateY(-1px);
}

.chess-btn-flip {
  background: linear-gradient(135deg, #2a3020, #3a4030);
  color: var(--gold-lt);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.chess-btn-flip:hover {
  box-shadow: 0 0 14px rgba(212,175,55,0.3);
  transform: translateY(-1px);
}

.chess-btn-start {
  background: linear-gradient(135deg, #7a5a10, #d4af37, #a07820);
  color: #1a1000;
  border-color: var(--gold);
  box-shadow: 0 3px 12px rgba(212,175,55,0.4);
}
.chess-btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212,175,55,0.55);
}

.chess-btn-reset {
  background: linear-gradient(135deg, #3a1010, #6a2020);
  color: #ffaaaa;
  border-color: #aa4040;
}
.chess-btn-reset:hover {
  background: linear-gradient(135deg, #6a2020, #3a1010);
  box-shadow: 0 4px 14px rgba(200,50,50,0.35);
  transform: translateY(-1px);
}

/* SETTINGS ROW */
.chess-settings-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 12px 16px;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  border: 1px solid rgba(212,175,55,0.15);
}

.chess-setting-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chess-setting-group label {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.chess-toggle-group { display: flex; border-radius: 8px; overflow: hidden; border: 1px solid var(--gold-dk); }

.chess-toggle {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 7px 14px;
  border: none;
  background: rgba(0,0,0,0.4);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.chess-toggle.active {
  background: linear-gradient(135deg, #7a5a10, #d4af37);
  color: #1a1000;
}
.chess-toggle:hover:not(.active) {
  background: rgba(212,175,55,0.1);
  color: var(--gold);
}

.chess-select {
  font-family: 'Lato', sans-serif;
  font-size: 0.8rem;
  padding: 7px 12px;
  background: rgba(0,0,0,0.5);
  color: var(--text-lt);
  border: 1px solid var(--gold-dk);
  border-radius: 8px;
  cursor: pointer;
  outline: none;
}
.chess-select option { background: #1a2e1a; }

/* MAIN LAYOUT */
.chess-main-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

/* SIDE PANELS */
.chess-side-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 190px;
  max-width: 210px;
  flex-shrink: 0;
}

.chess-panel-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 12px;
  backdrop-filter: blur(4px);
}

/* PLAYER INFO */
.chess-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chess-player-avatar {
  font-size: 1.8rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(212,175,55,0.4));
}
.chess-player-black .chess-player-avatar { color: #111; text-shadow: 0 0 8px rgba(212,175,55,0.5); filter: drop-shadow(0 1px 3px rgba(255,255,255,0.3)); }
.chess-player-white .chess-player-avatar { color: #fff; text-shadow: 0 0 8px rgba(212,175,55,0.8); }

.chess-player-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chess-player-name {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-lt);
}

.chess-player-role {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.chess-timer {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(212,175,55,0.5);
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 8px;
  padding: 5px 10px;
  min-width: 52px;
  text-align: center;
}
.chess-timer.active-timer {
  color: #80ff80;
  text-shadow: 0 0 10px rgba(100,255,100,0.5);
  border-color: rgba(100,255,100,0.3);
}

/* CAPTURED PIECES */
.chess-captured-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-family: 'Cinzel', serif;
}

.chess-captured-pieces {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  min-height: 28px;
}

.chess-captured-piece {
  font-size: 1.05rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

/* STATUS */
.chess-status-card { text-align: center; }
.chess-status-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Cinzel', serif;
  margin-bottom: 6px;
}
.chess-status-text {
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  color: var(--gold-lt);
  font-weight: 600;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* HISTORY */
.chess-history-card { flex: 1; }
.chess-panel-title {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 10px;
  letter-spacing: 1px;
}
.chess-history-table-wrap {
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dk) rgba(0,0,0,0.3);
}
.chess-history-table-wrap::-webkit-scrollbar { width: 5px; }
.chess-history-table-wrap::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
.chess-history-table-wrap::-webkit-scrollbar-thumb { background: var(--gold-dk); border-radius: 3px; }

.chess-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}
.chess-history-table th {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(212,175,55,0.2);
}
.chess-history-table td {
  padding: 4px 6px;
  color: var(--text-lt);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.chess-history-table td:first-child { color: var(--text-dim); font-size: 0.68rem; }
.chess-history-table tr:hover td { background: rgba(212,175,55,0.07); }
.chess-history-table tr.current-row td { background: rgba(212,175,55,0.12); color: var(--gold-lt); }

/* ====== BOARD ====== */
.chess-board-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.chess-board-frame {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  /* GOLDEN FRAME */
  background: linear-gradient(135deg, #8a6010 0%, #d4af37 25%, #f0d060 50%, #d4af37 75%, #8a6010 100%);
  padding: 6px;
  border-radius: 10px;
  box-shadow:
    0 0 40px rgba(212,175,55,0.5),
    0 0 80px rgba(212,175,55,0.2),
    inset 0 1px 0 rgba(255,255,255,0.4),
    0 8px 32px rgba(0,0,0,0.7);
}

.chess-board-row-wrap {
  display: flex;
  align-items: center;
}

/* COORDS */
.chess-coords {
  display: flex;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(212,175,55,0.8);
  letter-spacing: 0.5px;
}
.chess-coords-top, .chess-coords-bottom {
  flex-direction: row;
  width: calc(8 * var(--sq, 72px));
  justify-content: space-around;
  padding: 3px 0;
}
.chess-coords-left, .chess-coords-right {
  flex-direction: column;
  height: calc(8 * var(--sq, 72px));
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
  min-width: 16px;
}

/* BOARD ITSELF */
.chess-board {
  display: grid;
  grid-template-columns: repeat(8, var(--sq, 72px));
  grid-template-rows: repeat(8, var(--sq, 72px));
  /* WOODEN TEXTURE via CSS */
  background-color: var(--wood-lt);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
  position: relative;
  user-select: none;
}

/* SQUARES */
.chess-sq {
  width: var(--sq, 72px);
  height: var(--sq, 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: filter 0.15s;
  overflow: hidden;
}

/* Light squares — lighter wood */
.chess-sq.light {
  background-color: #d4a96a;
  background-image:
    repeating-linear-gradient(
      92deg,
      rgba(180,120,60,0.12) 0px, rgba(180,120,60,0.12) 1px,
      transparent 1px, transparent 8px
    ),
    repeating-linear-gradient(
      2deg,
      rgba(180,120,60,0.05) 0px, rgba(180,120,60,0.05) 1px,
      transparent 1px, transparent 16px
    );
}

/* Dark squares — darker wood */
.chess-sq.dark {
  background-color: #8a4e1e;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(60,20,5,0.18) 0px, rgba(60,20,5,0.18) 1px,
      transparent 1px, transparent 7px
    ),
    repeating-linear-gradient(
      3deg,
      rgba(60,20,5,0.08) 0px, rgba(60,20,5,0.08) 1px,
      transparent 1px, transparent 14px
    );
}

.chess-sq:hover { filter: brightness(1.12); }

/* SELECTED SQUARE */
.chess-sq.selected {
  filter: brightness(1.3);
  box-shadow: inset 0 0 0 3px rgba(212,175,55,0.9);
}

/* LAST MOVE HIGHLIGHT */
.chess-sq.last-move-from { box-shadow: inset 0 0 0 3px rgba(100,200,100,0.6); }
.chess-sq.last-move-to   { box-shadow: inset 0 0 0 3px rgba(100,220,100,0.9); }

/* IN-CHECK */
.chess-sq.in-check { animation: checkPulse 0.6s ease-in-out infinite alternate; }
@keyframes checkPulse {
  from { box-shadow: inset 0 0 0 3px rgba(255,60,60,0.8); }
  to   { box-shadow: inset 0 0 0 3px rgba(255,60,60,0.4), inset 0 0 20px rgba(255,60,60,0.3); }
}

/* MOVE DOTS */
.chess-move-dot {
  position: absolute;
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: radial-gradient(circle, #f0d060 0%, #d4af37 60%, rgba(212,175,55,0.6) 100%);
  box-shadow: 0 0 8px rgba(212,175,55,0.8), 0 2px 4px rgba(0,0,0,0.4);
  pointer-events: none;
  animation: dotPop 0.2s ease-out;
  z-index: 3;
}
@keyframes dotPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* CAPTURE RINGS */
.chess-capture-ring {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 4px solid rgba(212,175,55,0.85);
  box-shadow:
    0 0 12px rgba(212,175,55,0.7),
    inset 0 0 8px rgba(212,175,55,0.2);
  pointer-events: none;
  animation: ringPop 0.2s ease-out;
  z-index: 3;
}
@keyframes ringPop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* PIECES */
.chess-piece {
  font-size: calc(var(--sq, 72px) * 0.72);
  line-height: 1;
  position: relative;
  z-index: 2;
  cursor: grab;
  transition: transform 0.12s, filter 0.12s;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.chess-piece.white-piece {
  color: #f5f5f0;
  text-shadow:
    0 0 3px rgba(0,0,0,0.9),
    0 1px 2px rgba(0,0,0,0.8),
    0 0 12px rgba(255,255,255,0.3);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.7));
}

.chess-piece.black-piece {
  color: #111111;
  text-shadow:
    0 0 3px rgba(255,255,255,0.2),
    0 1px 2px rgba(0,0,0,0.9);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8)) drop-shadow(0 0 6px rgba(180,140,40,0.3));
}

.chess-sq.selected .chess-piece,
.chess-sq:hover .chess-piece {
  transform: scale(1.08);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.8)) drop-shadow(0 0 12px rgba(212,175,55,0.5));
}

/* AI THINKING */
.chess-piece.thinking {
  animation: thinkBounce 0.6s ease-in-out infinite alternate;
}
@keyframes thinkBounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-4px); }
}

/* MOVE ANIMATION */
@keyframes pieceLand {
  0%   { transform: scale(1.3) translateY(-5px); }
  70%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}
.chess-piece.just-moved { animation: pieceLand 0.25s ease-out; }

/* GAME OVER BANNER */
.chess-gameover-banner {
  position: absolute;
  inset: 0;
  background: rgba(10,20,14,0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  z-index: 100;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.chess-gameover-inner {
  text-align: center;
  padding: 40px;
}
.chess-gameover-icon {
  font-size: 5rem;
  filter: drop-shadow(0 0 20px rgba(212,175,55,0.8));
  margin-bottom: 16px;
  animation: iconFloat 2s ease-in-out infinite alternate;
}
@keyframes iconFloat {
  from { transform: translateY(0) rotate(-5deg); }
  to   { transform: translateY(-10px) rotate(5deg); }
}
.chess-gameover-text {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(212,175,55,0.8);
  letter-spacing: 3px;
  margin-bottom: 8px;
}

/* ===== MODALS ===== */
.chess-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.25s ease;
}

.chess-modal-box {
  background: linear-gradient(160deg, #0f2418 0%, #1a3a28 60%, #0f1e16 100%);
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: 18px;
  padding: 32px;
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow:
    0 0 60px rgba(212,175,55,0.25),
    0 20px 60px rgba(0,0,0,0.8);
}

.chess-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(212,175,55,0.15);
  border: 1px solid rgba(212,175,55,0.35);
  color: var(--gold);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chess-modal-close:hover {
  background: rgba(212,175,55,0.3);
  transform: scale(1.1);
}

.chess-modal-title {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(212,175,55,0.5);
  margin: 0 0 24px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(212,175,55,0.25);
  letter-spacing: 2px;
}

.chess-modal-body { color: var(--text-lt); }

.guide-section {
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  border: 1px solid rgba(212,175,55,0.1);
}
.guide-section h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  color: var(--gold-lt);
  margin: 0 0 10px 0;
}
.guide-section p, .guide-section li {
  font-size: 0.85rem;
  line-height: 1.7;
  color: #c0d4b8;
  margin-bottom: 4px;
}
.guide-section ul {
  padding-left: 18px;
  margin: 0;
}
.guide-section li b {
  color: var(--gold-lt);
}

/* PROMOTION MODAL */
.chess-promo-box {
  max-width: 400px;
  text-align: center;
}

.promo-choices {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.promo-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.4);
  border: 2px solid var(--gold-dk);
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-lt);
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
}
.promo-choice-btn .promo-piece { font-size: 2.8rem; line-height: 1; }
.promo-choice-btn:hover {
  border-color: var(--gold);
  background: rgba(212,175,55,0.15);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(212,175,55,0.3);
}

/* AI THINKING INDICATOR */
.chess-thinking-bar {
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: thinkSweep 1s linear infinite;
  border-radius: 2px;
  margin-top: 8px;
  display: none;
}
.chess-thinking-bar.visible { display: block; }
@keyframes thinkSweep {
  from { background-position: -100% 0; }
  to   { background-position: 200% 0; }
}

/* ===== RESPONSIVE ===== */
/* Board responsive via CSS variable */
@media (max-width: 1200px) {
  .chess-board { --sq: 64px; }
  .chess-coords-top, .chess-coords-bottom { width: calc(8 * 64px); }
  .chess-coords-left, .chess-coords-right { height: calc(8 * 64px); }
  .chess-side-panel { min-width: 165px; max-width: 185px; }
}

@media (max-width: 1000px) {
  .chess-board { --sq: 56px; }
  .chess-coords-top, .chess-coords-bottom { width: calc(8 * 56px); }
  .chess-coords-left, .chess-coords-right { height: calc(8 * 56px); }
  .chess-main-layout { flex-direction: column; align-items: center; }
  .chess-side-panel { min-width: unset; max-width: 100%; width: 100%; flex-direction: row; flex-wrap: wrap; }
  .chess-panel-card { flex: 1; min-width: 140px; }
  .chess-side-right .chess-panel-card { min-width: 100%; }
  .chess-history-table-wrap { max-height: 180px; }
}

@media (max-width: 700px) {
  .chess-board { --sq: 44px; }
  .chess-coords-top, .chess-coords-bottom { width: calc(8 * 44px); }
  .chess-coords-left, .chess-coords-right { height: calc(8 * 44px); font-size: 0.5rem; }
  .chess-piece { font-size: calc(44px * 0.72); }
  .chess-board-frame { padding: 4px; }
  .chess-logo { font-size: 1.1rem; }
  .chess-settings-row { gap: 10px; }
  .chess-btn { padding: 6px 10px; font-size: 0.68rem; }
  .chess-game-container { padding: 12px 10px 16px; }
  .chess-timer { font-size: 0.85rem; padding: 4px 7px; }
  .chess-player-avatar { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .chess-board { --sq: 38px; }
  .chess-coords-top, .chess-coords-bottom { width: calc(8 * 38px); display: none; }
  .chess-coords-left, .chess-coords-right  { height: calc(8 * 38px); display: none; }
  .chess-piece { font-size: calc(38px * 0.72); }
  .chess-top-bar { flex-wrap: wrap; gap: 8px; }
  .chess-gameover-text { font-size: 1.4rem; }
  .chess-gameover-icon { font-size: 3.5rem; }
}
