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

body {
  font-family: Inter, system-ui, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100dvh;
}

.shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 10px 20px;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.topbar h1 { font-size: 1.4rem; font-weight: 700; color: #f1f5f9; }
.topbar p  { font-size: 0.82rem; color: #94a3b8; margin-top: 2px; }

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.toolbar label { font-size: 0.85rem; color: #94a3b8; }
select {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 0.85rem;
}

/* Reward bar */
.reward-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 12px;
}
.reward-note { font-size: 0.78rem; color: #64748b; flex: 1; }

/* Buttons */
button {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
button:hover:not(:disabled) { background: #2563eb; }
button:disabled { background: #334155; color: #64748b; cursor: not-allowed; opacity: 0.7; }

#rewardBtn { background: #d97706; }
#rewardBtn:hover:not(:disabled) { background: #b45309; }
#rewardBtn:disabled { background: #334155; color: #64748b; }

/* Status chips */
.status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 7px;
  padding: 5px 11px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 5px;
}
.chip span { color: #64748b; }
.chip strong { color: #f1f5f9; }

/* Board */
.board-wrap {
  display: flex;
  justify-content: center;
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
  padding: 6px;
}
#board {
  max-width: 100%;
  height: auto;
  cursor: pointer;
  display: block;
  border-radius: 6px;
}

/* Message */
.message {
  text-align: center;
  font-size: 0.9rem;
  color: #94a3b8;
  min-height: 1.4em;
  transition: color 0.3s;
}
.message.win  { color: #4ade80; font-weight: 700; }
.message.fail { color: #f87171; font-weight: 700; }

@media (max-width: 540px) {
  .topbar h1 { font-size: 1.15rem; }
  #board { width: 100%; }
}
