:root {
  --font-family: 'Poppins', sans-serif;
  --transition-speed: 0.3s;
  --board-border-radius: 16px;
}

[data-theme="dark"] {
  --bg-primary: #0a0a1a;
  --bg-secondary: #12122a;
  --bg-card: #1a1a3e;
  --bg-card-hover: #222255;
  --bg-board: #16213e;
  --board-shadow: 0 8px 32px rgba(0,0,0,0.5);
  --text-primary: #e8e8ff;
  --text-secondary: #9999bb;
  --text-muted: #666688;
  --border-color: #2a2a5a;
  --input-bg: #12122a;
  --input-border: #3a3a6a;
  --input-focus: #6c63ff;
  --btn-primary-bg: linear-gradient(135deg, #6c63ff 0%, #5a52e0 100%);
  --btn-primary-hover: linear-gradient(135deg, #7c73ff 0%, #6a62f0 100%);
  --btn-primary-text: #ffffff;
  --btn-secondary-bg: linear-gradient(135deg, #2a2a5a 0%, #1a1a4a 100%);
  --btn-secondary-hover: linear-gradient(135deg, #3a3a6a 0%, #2a2a5a 100%);
  --btn-secondary-text: #ccccee;
  --player1-color: #ff4757;
  --player1-glow: rgba(255, 71, 87, 0.4);
  --player1-gradient: radial-gradient(circle at 35% 35%, #ff6b7a 0%, #ff4757 50%, #cc3945 100%);
  --player2-color: #ffc107;
  --player2-glow: rgba(255, 193, 7, 0.4);
  --player2-gradient: radial-gradient(circle at 35% 35%, #ffd54f 0%, #ffc107 50%, #cc9a06 100%);
  --cell-bg: #0d1b2a;
  --cell-empty: #1b2838;
  --cell-shadow: inset 0 4px 8px rgba(0,0,0,0.4);
  --overlay-bg: rgba(5, 5, 15, 0.85);
  --success-color: #2ed573;
  --danger-color: #ff4757;
  --warning-color: #ffa502;
  --particle-color: rgba(108, 99, 255, 0.15);
  --win-glow: 0 0 20px rgba(46, 213, 115, 0.6);
  --hover-indicator: rgba(108, 99, 255, 0.3);
}

[data-theme="light"] {
  --bg-primary: #f0f2ff;
  --bg-secondary: #e8eaff;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f5ff;
  --bg-board: #1e3a5f;
  --board-shadow: 0 8px 32px rgba(30,58,95,0.3);
  --text-primary: #1a1a2e;
  --text-secondary: #555577;
  --text-muted: #8888aa;
  --border-color: #d0d0e8;
  --input-bg: #f5f5ff;
  --input-border: #c0c0d8;
  --input-focus: #6c63ff;
  --btn-primary-bg: linear-gradient(135deg, #6c63ff 0%, #5a52e0 100%);
  --btn-primary-hover: linear-gradient(135deg, #7c73ff 0%, #6a62f0 100%);
  --btn-primary-text: #ffffff;
  --btn-secondary-bg: linear-gradient(135deg, #e8e8ff 0%, #d8d8f0 100%);
  --btn-secondary-hover: linear-gradient(135deg, #d8d8f0 0%, #c8c8e8 100%);
  --btn-secondary-text: #333355;
  --player1-color: #e74c3c;
  --player1-glow: rgba(231, 76, 60, 0.4);
  --player1-gradient: radial-gradient(circle at 35% 35%, #ff6b6b 0%, #e74c3c 50%, #c0392b 100%);
  --player2-color: #f1c40f;
  --player2-glow: rgba(241, 196, 15, 0.4);
  --player2-gradient: radial-gradient(circle at 35% 35%, #f9e154 0%, #f1c40f 50%, #d4ac0d 100%);
  --cell-bg: #0d2847;
  --cell-empty: #163d6b;
  --cell-shadow: inset 0 4px 8px rgba(0,0,0,0.3);
  --overlay-bg: rgba(240, 242, 255, 0.9);
  --success-color: #27ae60;
  --danger-color: #e74c3c;
  --warning-color: #f39c12;
  --particle-color: rgba(108, 99, 255, 0.08);
  --win-glow: 0 0 20px rgba(39, 174, 96, 0.6);
  --hover-indicator: rgba(108, 99, 255, 0.4);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition-speed), color var(--transition-speed);
}

#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.theme-icon {
  font-size: 1.4rem;
  position: absolute;
  transition: opacity 0.3s, transform 0.3s;
}

[data-theme="dark"] .theme-icon.sun { opacity: 1; transform: rotate(0deg); }
[data-theme="dark"] .theme-icon.moon { opacity: 0; transform: rotate(90deg); }
[data-theme="light"] .theme-icon.sun { opacity: 0; transform: rotate(-90deg); }
[data-theme="light"] .theme-icon.moon { opacity: 1; transform: rotate(0deg); }

/* Screens */
.screen {
  display: none;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Menu */
.menu-container {
  max-width: 460px;
  width: 100%;
  padding: 20px;
}

.logo-wrapper {
  text-align: center;
  margin-bottom: 32px;
}

.game-title {
  font-size: 2.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  line-height: 1.2;
}

.game-title.title-small {
  font-size: 2rem;
}

.highlight-name {
  color: #6c63ff;
  font-weight: 700;
}

.title-piece {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-block;
  animation: titleBounce 2s ease-in-out infinite;
}

.title-piece.small {
  width: 28px;
  height: 28px;
}

.title-piece.red {
  background: var(--player1-gradient);
  box-shadow: 0 0 20px var(--player1-glow);
  animation-delay: 0s;
}

.title-piece.yellow {
  background: var(--player2-gradient);
  box-shadow: 0 0 20px var(--player2-glow);
  animation-delay: 0.3s;
}

@keyframes titleBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 8px;
}

/* Cards & Inputs */
.menu-card,
.lobby-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

input[type="text"] {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 2px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  transition: all var(--transition-speed);
  outline: none;
}

input[type="text"]:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.15);
}

input[type="text"]::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-speed);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::after {
  width: 300px;
  height: 300px;
}

.btn-large {
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(108, 99, 255, 0.4);
}

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--btn-secondary-hover);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.btn-icon {
  font-size: 1.3em;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  gap: 16px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.divider span {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  white-space: nowrap;
}

.footer-info {
  text-align: center;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.back-link-row {
  margin-top: 16px;
  text-align: center;
}

/* Lobby */
.lobby-container {
  max-width: 500px;
  width: 100%;
  padding: 20px;
}

.lobby-card {
  text-align: center;
}

.lobby-card h2 {
  font-size: 1.8rem;
  margin-bottom: 24px;
}

.room-code-display {
  margin-bottom: 24px;
}

.room-code-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.room-code {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 8px;
  background: var(--btn-primary-bg);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  user-select: all;
}

.qr-section {
  margin: 24px 0;
}

.qr-section p {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.qr-container {
  display: inline-block;
  padding: 16px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.qr-container img {
  display: block;
  width: 200px;
  height: 200px;
}

.qr-loading {
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 0.9rem;
}

.share-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  max-width: 350px;
  margin-left: auto;
  margin-right: auto;
}

.share-url-row.hidden { display: none; }

.share-url-input {
  flex: 1;
  font-size: 0.75rem !important;
  padding: 8px 12px !important;
  text-align: center;
  color: var(--text-muted) !important;
}

.lobby-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 24px 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

.pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--success-color);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.lobby-players {
  margin: 16px 0;
}

/* Game Screen */
.game-container {
  max-width: 700px;
  width: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 16px;
  gap: 12px;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  transition: all var(--transition-speed);
  min-width: 140px;
}

.player-info.active {
  border-color: var(--input-focus);
  box-shadow: 0 0 20px rgba(108, 99, 255, 0.2);
}

.player1-info.active {
  border-color: var(--player1-color);
  box-shadow: 0 0 20px var(--player1-glow);
}

.player2-info.active {
  border-color: var(--player2-color);
  box-shadow: 0 0 20px var(--player2-glow);
}

.player-chip {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.p1-chip {
  background: var(--player1-gradient);
  box-shadow: 0 0 10px var(--player1-glow);
}

.p2-chip {
  background: var(--player2-gradient);
  box-shadow: 0 0 10px var(--player2-glow);
}

.player-name {
  font-weight: 700;
  font-size: 0.95rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.player-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.player2-info {
  text-align: right;
}

.turn-indicator {
  text-align: center;
  padding: 8px 20px;
  background: var(--bg-card);
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  white-space: nowrap;
  transition: all var(--transition-speed);
}

.turn-indicator.my-turn {
  border-color: var(--success-color);
  box-shadow: 0 0 15px rgba(46, 213, 115, 0.2);
}

/* Game Board */
.board-wrapper {
  position: relative;
}

.column-indicators {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 0 14px;
  margin-bottom: 4px;
}

.col-indicator {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.col-indicator .preview-piece {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s;
}

.col-indicator.hover .preview-piece {
  opacity: 0.5;
  transform: scale(1);
}

.board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 6px;
  padding: 14px;
  background: var(--bg-board);
  border-radius: var(--board-border-radius);
  box-shadow: var(--board-shadow);
  position: relative;
}

.cell {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--cell-empty);
  box-shadow: var(--cell-shadow);
  cursor: pointer;
  position: relative;
  transition: background 0.1s;
  overflow: hidden;
}

.board.my-turn .cell:hover {
  background: var(--bg-card-hover);
}

.board:not(.my-turn) .cell {
  cursor: default;
}

.cell .piece {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transform: translateY(-600px);
  opacity: 0;
}

.cell .piece.dropped {
  opacity: 1;
  animation: dropPiece 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.cell .piece.instant {
  opacity: 1;
  transform: translateY(0);
  animation: none;
}

.cell .piece.p1 {
  background: var(--player1-gradient);
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.2), 0 0 15px var(--player1-glow);
}

.cell .piece.p2 {
  background: var(--player2-gradient);
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.2), 0 0 15px var(--player2-glow);
}

.cell .piece.win {
  animation: winPulse 0.8s ease-in-out infinite;
}

@keyframes dropPiece {
  0% { transform: translateY(-600px); opacity: 1; }
  60% { transform: translateY(10px); }
  80% { transform: translateY(-5px); }
  100% { transform: translateY(0); }
}

@keyframes winPulse {
  0%, 100% {
    box-shadow: inset 0 -3px 6px rgba(0,0,0,0.2), var(--win-glow);
    transform: scale(1);
  }
  50% {
    box-shadow: inset 0 -3px 6px rgba(0,0,0,0.2), 0 0 40px rgba(46, 213, 115, 0.8);
    transform: scale(1.08);
  }
}

/* Emoji */
.emoji-bar {
  display: flex;
  gap: 6px;
  margin-top: 16px;
  padding: 8px 16px;
  background: var(--bg-card);
  border-radius: 30px;
  border: 1px solid var(--border-color);
}

.emoji-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-btn:hover {
  background: var(--bg-card-hover);
  transform: scale(1.3);
}

.emoji-btn:active {
  transform: scale(0.9);
}

.floating-emojis {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 500;
}

.floating-emoji {
  position: absolute;
  font-size: 2.5rem;
  animation: floatUp 2s ease-out forwards;
  pointer-events: none;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(0.5) rotate(0deg); }
  50% { opacity: 1; transform: translateY(-100px) scale(1.2) rotate(15deg); }
  100% { opacity: 0; transform: translateY(-250px) scale(0.8) rotate(-10deg); }
}

/* Chat */
.chat-section {
  margin-top: 12px;
  width: 100%;
  max-width: 500px;
}

.chat-panel {
  margin-top: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  animation: slideDown 0.3s ease;
}

.chat-panel.hidden {
  display: none;
}

@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 300px; }
}

.chat-messages {
  height: 150px;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }

.chat-msg {
  font-size: 0.85rem;
  animation: fadeIn 0.3s;
}

.chat-msg .chat-sender {
  font-weight: 700;
  color: var(--input-focus);
}

.chat-msg .chat-text {
  color: var(--text-secondary);
}

.chat-input-row {
  display: flex;
  padding: 8px;
  border-top: 1px solid var(--border-color);
  gap: 8px;
}

.chat-input-row input {
  flex: 1;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
}

/* Game Footer */
.game-footer {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 500px;
}

.room-code-small {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 2px;
}

/* Overlay & Game Over */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  animation: fadeIn 0.4s;
  backdrop-filter: blur(8px);
}

.overlay.hidden { display: none; }

.overlay-content {
  max-width: 420px;
  width: 90%;
}

.game-over-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 40px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.game-over-card h2 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.game-over-card p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 1.1rem;
}

.game-over-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rematch-status {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.rematch-status.hidden { display: none; }

/* Confetti */
.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotateZ(0deg); opacity: 1; }
  100% { transform: translateY(500px) rotateZ(720deg); opacity: 0; }
}

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  font-size: 0.9rem;
  font-weight: 600;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), toastOut 0.3s ease 2.7s forwards;
  pointer-events: auto;
  text-align: center;
}

.toast.success { border-left: 4px solid var(--success-color); }
.toast.error { border-left: 4px solid var(--danger-color); }
.toast.info { border-left: 4px solid var(--input-focus); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.8); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-20px); }
}

/* Responsive */
@media (max-width: 600px) {
  .game-title { font-size: 1.8rem; }
  .game-title.title-small { font-size: 1.5rem; }
  .title-piece { width: 28px; height: 28px; }
  .title-piece.small { width: 22px; height: 22px; }

  .cell { width: 44px; height: 44px; }
  .board { gap: 4px; padding: 10px; }
  .column-indicators { padding: 0 10px; gap: 4px; }
  .preview-piece { width: 34px; height: 34px; }

  .game-header { flex-direction: column; gap: 8px; }
  .player-info { min-width: auto; width: 100%; justify-content: center; }
  .turn-indicator { order: -1; }

  .room-code { font-size: 2.2rem; letter-spacing: 5px; }
  .emoji-bar { flex-wrap: wrap; justify-content: center; }
  .menu-card, .lobby-card { padding: 24px; }
  .col-indicator { height: 30px; }
}

@media (max-width: 380px) {
  .cell { width: 38px; height: 38px; }
  .board { gap: 3px; padding: 8px; }
}

.hidden { display: none !important; }

::selection { background: rgba(108, 99, 255, 0.3); }
