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

:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --green: #22c55e;
  --green-bg: #166534;
  --red: #ef4444;
  --red-bg: #991b1b;
  --yellow: #eab308;
  --yellow-bg: #854d0e;
  --gray: #64748b;
  --tile-unclaimed: #1e293b;
  --tile-mine: #166534;
  --tile-other: #44403c;
  --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

.screen {
  min-height: 100vh;
}

/* Login */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  background: var(--surface);
  padding: 2.5rem;
  border-radius: 12px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-box h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

input[type="text"],
input[type="password"] {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s;
}

input:focus {
  border-color: var(--primary);
}

button[type="submit"],
.btn-admin {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

button[type="submit"] {
  background: var(--primary);
  color: white;
}

button[type="submit"]:hover {
  background: var(--primary-hover);
}

button[type="submit"]:active,
.btn-admin:active {
  transform: scale(0.97);
}

.error {
  color: var(--red);
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-left h1 {
  font-size: 1.25rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#player-name {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.connected {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.status-dot.disconnected {
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}

.status-dot.connecting {
  background: var(--yellow);
  box-shadow: 0 0 6px var(--yellow);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Badge */
.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge.waiting { background: var(--gray); color: white; }
.badge.playing { background: var(--green); color: white; }
.badge.paused { background: var(--yellow); color: black; }
.badge.finished { background: var(--red); color: white; }

/* Layout */
main {
  padding: 1rem;
  max-width: var(--layout-max, 1200px);
  margin: 0 auto;
}

.game-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1rem;
  align-items: start;
}

/* Board */
.board-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.board {
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: var(--board-max, 700px);
  aspect-ratio: 1;
}

.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.25rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  background: var(--tile-unclaimed);
  border: 1px solid var(--border);
  word-break: break-word;
  line-height: 1.2;
  user-select: none;
  position: relative;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}

.tile:hover:not(.claimed):not(.disabled) {
  background: var(--surface-hover);
  transform: scale(1.03);
}

.tile.claimed-mine {
  background: var(--tile-mine);
  border-color: var(--green);
  cursor: default;
}

.tile.claimed-other {
  background: var(--tile-other);
  border-color: transparent;
  cursor: default;
  opacity: 0.7;
}

.tile.claimed-failed {
  background: var(--red-bg);
  border-color: var(--red);
  cursor: default;
  opacity: 0.5;
}

.tile .failed-text {
  text-decoration: line-through;
}

.tile.disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.tile .claimer {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 0.55rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* Claim animation */
@keyframes claim-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.tile.just-claimed {
  animation: claim-pop 0.3s ease;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--border);
}

.panel h2 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Admin Controls */
.control-group {
  margin-bottom: 0.75rem;
}

.control-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.control-group select {
  width: 100%;
  padding: 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
}

.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.button-grid .btn-admin:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.btn-admin {
  font-size: 0.8rem;
  padding: 0.5rem;
}

.btn-green { background: var(--green); color: white; }
.btn-green:hover { background: #16a34a; }
.btn-yellow { background: var(--yellow); color: black; }
.btn-yellow:hover { background: #ca8a04; }
.btn-red { background: var(--red); color: white; }
.btn-red:hover { background: #dc2626; }
.btn-blue { background: var(--primary); color: white; }
.btn-blue:hover { background: var(--primary-hover); }
.btn-gray { background: var(--gray); color: white; }
.btn-gray:hover { background: #475569; }

.btn-admin:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  filter: grayscale(0.5);
  transform: none;
}

.btn-admin:disabled:hover { filter: grayscale(0.5); }
.btn-admin:disabled:active { transform: none; }

select:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Scoreboard */
.scoreboard {
  list-style: none;
  counter-reset: rank;
}

.scoreboard .scoreboard-entry {
  counter-increment: rank;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.scoreboard .scoreboard-entry:last-child {
  border-bottom: none;
}

.scoreboard-row {
  display: flex;
  align-items: center;
}

.scoreboard-row::before {
  content: counter(rank) ".";
  color: var(--text-muted);
  width: 1.5rem;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.scoreboard-row.expandable {
  cursor: pointer;
  border-radius: 4px;
  padding: 0.15rem 0.25rem;
  margin: -0.15rem -0.25rem;
}

.scoreboard-row.expandable:hover {
  background: var(--surface-hover);
}

.scoreboard .name {
  flex: 1;
}

.scoreboard .name.is-you {
  color: var(--green);
  font-weight: 600;
}

.scoreboard .score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

/* Claim list under expanded scoreboard entry */
.claim-list {
  list-style: none;
  margin: 0.35rem 0 0 1.5rem;
  padding: 0;
}

.claim-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.2rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.claim-item.claim-failed .claim-word {
  text-decoration: line-through;
  opacity: 0.5;
}

.claim-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  margin-left: 0.5rem;
  transition: background 0.15s, color 0.15s;
}

.claim-toggle-btn.btn-fail:hover {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red);
}

.claim-toggle-btn.btn-restore:hover {
  background: var(--green-bg);
  color: var(--green);
  border-color: var(--green);
}

/* Player list */
.player-list {
  list-style: none;
}

.player-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.85rem;
}

.player-list .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.player-list .dot.online { background: var(--green); }
.player-list .dot.offline { background: var(--gray); }

.player-list .player-name-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-list .admin-tag {
  font-size: 0.65rem;
  background: var(--yellow-bg);
  color: var(--yellow);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  flex-shrink: 0;
}

.kick-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.7rem;
  width: 1.4rem;
  height: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}

.player-list li:hover .kick-btn {
  opacity: 1;
}

.kick-btn:hover {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red);
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  z-index: 1000;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  animation: toast-in 0.3s ease, toast-out 0.3s ease 2.7s forwards;
  max-width: 320px;
}

.toast.toast-error {
  background: var(--red-bg);
  border: 1px solid var(--red);
}

.toast.toast-info {
  background: var(--surface);
  border: 1px solid var(--border);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(1rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Chat */
.chat-panel {
  width: 100%;
  max-width: var(--board-max, 700px);
  margin-top: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  position: relative;
}

.chat-messages {
  height: 200px;
  overflow-y: auto;
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.chat-msg {
  display: flex;
  animation: chat-fade-in 0.18s ease;
}

.chat-msg-other { justify-content: flex-start; }
.chat-msg-mine  { justify-content: flex-end; }

@keyframes chat-fade-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-inner {
  display: flex;
  flex-direction: column;
  max-width: 72%;
  gap: 2px;
}

.chat-msg-mine .chat-inner { align-items: flex-end; }

.chat-author {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--primary);
  padding: 0 4px;
}

.chat-bubble {
  padding: 0.38rem 0.65rem;
  border-radius: 16px;
  font-size: 0.8rem;
  line-height: 1.35;
  word-break: break-word;
  background: rgba(255,255,255,0.07);
  color: var(--text);
}

.chat-msg-other .chat-bubble { border-radius: 4px 16px 16px 16px; }
.chat-msg-mine  .chat-bubble {
  background: var(--primary);
  color: #fff;
  border-radius: 16px 4px 16px 16px;
}

.chat-time {
  font-size: 0.58rem;
  color: var(--gray);
  padding: 0 4px;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 0.15s;
  user-select: none;
}

.chat-msg:hover .chat-time { opacity: 1; }

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

.chat-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  min-width: 0;
}

.chat-input::placeholder {
  color: var(--gray);
}

.emoji-toggle-btn {
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  padding: 0 0.6rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.15s;
}

.emoji-toggle-btn:hover {
  background: var(--surface-hover);
}

.chat-send-btn {
  padding: 0.5rem 0.85rem;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0 0 var(--radius) 0;
  transition: background 0.15s;
}

.chat-send-btn:hover {
  background: var(--primary-hover);
}

/* Emoji Picker */
.emoji-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  width: 280px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.emoji-group-header {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.35rem 0 0.2rem;
}

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

.emoji-btn {
  background: none;
  border: none;
  font-size: 1.15rem;
  padding: 0.2rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.1s, transform 0.1s;
  line-height: 1;
}

.emoji-btn:hover {
  background: var(--surface-hover);
  transform: scale(1.2);
}

/* Laugh FAB & Floating Reactions */
.laugh-fab {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  border: 2px solid var(--border);
  font-size: 1.6rem;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.laugh-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.laugh-fab:active {
  transform: scale(0.9);
}

.laugh-container {
  position: fixed;
  bottom: 80px;
  left: 0;
  width: 140px;
  height: 60vh;
  pointer-events: none;
  z-index: 99;
  overflow: hidden;
}

.laugh-emoji {
  position: absolute;
  bottom: 0;
  animation: laugh-float linear forwards;
  pointer-events: none;
  will-change: transform, opacity;
}

@keyframes laugh-float {
  0% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 1;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translateY(-60vh) translateX(var(--drift, 0px)) scale(0.6);
    opacity: 0;
  }
}

/* Dictionary trigger button */
.dict-trigger-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.dict-trigger-btn:hover {
  color: var(--text);
  border-color: var(--primary);
  background: rgba(59,130,246,0.08);
}

/* Dictionary modal overlay */
.dict-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: dict-overlay-in 0.2s ease;
}

@keyframes dict-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.dict-panel {
  width: 100%;
  max-width: 860px;
  max-height: 82vh;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: dict-panel-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -12px 60px rgba(0,0,0,0.6);
}

@keyframes dict-panel-in {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.dict-header {
  padding: 1.1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.dict-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.dict-title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dict-label {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--primary);
  text-transform: uppercase;
}

.dict-stats {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 0.03em;
}

.dict-stats span { color: var(--text); font-weight: 600; }

.dict-close-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.dict-close-btn:hover { background: var(--surface-hover); color: var(--text); }

.dict-search-wrap {
  position: relative;
  margin-bottom: 0.65rem;
}

.dict-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.dict-search {
  width: 100%;
  padding: 0.45rem 0.75rem 0.45rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.15s;
}

.dict-search:focus { border-color: var(--primary); }
.dict-search::placeholder { color: var(--gray); }

.dict-legend {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.dl-item {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
}

.dl-board   { background: rgba(59,130,246,0.15);  color: var(--primary); border: 1px solid rgba(59,130,246,0.35); }
.dl-claimed { background: rgba(34,197,94,0.15);   color: var(--green);   border: 1px solid rgba(34,197,94,0.3); }
.dl-failed  { background: rgba(239,68,68,0.12);   color: var(--red);     border: 1px solid rgba(239,68,68,0.3); }
.dl-fav     { background: rgba(234,179,8,0.12);   color: var(--yellow);  border: 1px solid rgba(234,179,8,0.3); }

/* Word grid */
.dict-grid {
  overflow-y: auto;
  padding: 1rem 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-content: flex-start;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.dict-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: transform 0.1s;
  user-select: none;
}

/* On board: blue accent */
.dict-chip.dict-on-board {
  border-color: rgba(59,130,246,0.6);
  background: rgba(59,130,246,0.1);
  color: var(--text);
}

/* Claimed: green */
.dict-chip.dict-claimed {
  border-color: rgba(34,197,94,0.5);
  background: rgba(34,197,94,0.1);
  color: var(--green);
}

/* Failed: red strikethrough */
.dict-chip.dict-failed {
  border-color: rgba(239,68,68,0.4);
  background: rgba(239,68,68,0.07);
  color: var(--red);
  text-decoration: line-through;
  opacity: 0.75;
}

.dict-word { line-height: 1; }

.dict-claimer {
  font-size: 0.62rem;
  opacity: 0.75;
  font-style: italic;
}

.dict-star {
  color: var(--yellow);
  font-size: 0.65rem;
  line-height: 1;
}

.dict-check {
  font-size: 0.7rem;
  color: var(--green);
}

.dict-empty {
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 2rem;
  text-align: center;
  width: 100%;
  font-style: italic;
}

/* Typing indicator */
.typing-indicator {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 2px 8px 4px;
  min-height: 1.2em;
  display: flex;
  align-items: center;
  gap: 6px;
  font-style: italic;
}

.typing-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.typing-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: -1;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar .panel {
    flex: 1;
    min-width: 200px;
  }

  #admin-controls {
    width: 100%;
  }

  .board {
    max-width: 100%;
  }

  .tile {
    font-size: 0.65rem;
  }

  header {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  main {
    padding: 0.5rem;
  }

  .board {
    gap: 3px;
  }

  .tile {
    font-size: 0.55rem;
    padding: 0.15rem;
    border-radius: 4px;
  }

  .tile .claimer {
    display: none;
  }

  .sidebar .panel {
    min-width: 150px;
  }
}
