* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px 16px 48px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f172a;
  color: #f1f5f9;
  display: flex;
  justify-content: center;
}

main {
  width: 100%;
  max-width: 360px;
  text-align: center;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

#status {
  font-size: 1.1rem;
  min-height: 1.5em;
  margin-bottom: 16px;
  color: #94a3b8;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 auto 20px;
}

.cell {
  aspect-ratio: 1 / 1;
  font-size: 2.5rem;
  font-weight: 700;
  background: #1e293b;
  border: 2px solid #334155;
  border-radius: 12px;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cell:not(:disabled):active {
  background: #334155;
}

.cell:disabled {
  opacity: 0.9;
}

.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}

button {
  padding: 12px 16px;
  font-size: 1rem;
  border-radius: 10px;
  border: none;
  background: #2563eb;
  color: white;
  min-height: 44px;
}

button:active {
  background: #1d4ed8;
}

.hint {
  font-size: 0.85rem;
  color: #64748b;
}

.invite-panel {
  margin-bottom: 20px;
  padding: 12px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #1e293b;
  text-align: left;
}

.invite-panel p {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

#inviteLinkInput {
  width: 100%;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #f1f5f9;
  font-size: 0.85rem;
}

.lobby-status {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #1e293b;
  text-align: left;
}

.my-role {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 0.95rem;
}

.player-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.player-list li {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #94a3b8;
}

.player-list li.is-you {
  color: #f1f5f9;
}

.player-list li.is-turn {
  background: #334155;
  color: #f8fafc;
  font-weight: 700;
}
