:root { font-family: system-ui, Arial, sans-serif; }
body { margin: 0; background: #0b0f19; color: #e8eefc; }
a { color: #7aa7ff; text-decoration: none; }
.container { max-width: 900px; margin: 0 auto; padding: 24px; }

.controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.controls input, .controls button, .controls select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #22304a;
  background: #0f1626;
  color: #e8eefc;
}
.controls button { cursor: pointer; }
.controls button:hover { opacity: 0.9; }
.status { color: #b8c4dd; }

.board {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 110px);
  gap: 10px;
}

.cell {
  width: 110px;
  height: 110px;
  background: #121a2b;
  border: 1px solid #22304a;
  border-radius: 14px;
  font-size: 48px;
  color: #e8eefc;
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
}

.cell:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* --- UI polish --- */
.online-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.controls input, .controls button, .controls select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #22304a;
  background: #0f1626;
  color: #e8eefc;
}
.controls button { cursor: pointer; }
.controls button:hover { opacity: 0.9; }

.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  align-items: start;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

.side { display: grid; gap: 14px; }

.panel {
  background: #121a2b;
  border: 1px solid #22304a;
  border-radius: 14px;
  padding: 14px;
}

.panel-title {
  margin: 0 0 10px;
  font-size: 14px;
  color: #b8c4dd;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: #8896b4;
}

/* --- player list --- */
.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid transparent;
}

.player-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #22304a;
  color: #b8c4dd;
}

.you-badge {
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid #22304a;
  color: #e8eefc;
}

.icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid #22304a;
  background: #0f1626;
  font-weight: 700;
}

.name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-row.active {
  border-color: #7aa7ff;
  box-shadow: 0 0 0 2px rgba(122, 167, 255, 0.18) inset;
}

.player-row.waiting {
  opacity: 0.75;
}

/* --- scoreboard table --- */
.score-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid #22304a;
  background: #0f1626;
  margin-bottom: 8px;
}

.score-line {
  font-size: 12px;
  color: #b8c4dd;
}

/* --- animated tile reveal --- */
.cell.reveal {
  animation: pop 180ms ease-out;
}

@keyframes pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.cell.win {
  box-shadow: 0 0 0 2px rgba(122, 167, 255, 0.35) inset, 0 0 22px rgba(122, 167, 255, 0.18);
  transform: translateZ(0);
}

.cell.win { animation: winGlow 240ms ease-out; }
@keyframes winGlow {
  from { box-shadow: none; }
  to { }
}

.footer a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 4px;
}

.footer a:hover {
  text-decoration: underline;
}