body {
  background: linear-gradient(180deg, #f0f8f2 0%, #e4f3e8 100%);
  overflow: hidden;
}

#app {
  height: 100dvh;
  overflow: hidden;
  padding: 10px;
}

/* ===== SETUP ===== */
.c-setup {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 14px;
  max-width: 420px;
  margin: 0 auto;
}

.c-logo {
  text-align: center;
}

.c-logo h1 {
  font-size: 1.6rem;
  color: #14853b;
  margin: 0;
}

.c-logo p {
  color: #38614d;
  margin: 4px 0 0;
  font-size: 0.85rem;
}

.c-section {
  background: white;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 4px 16px rgba(12,61,28,0.08);
  border: 1px solid rgba(24,133,59,0.08);
  width: 100%;
}

.c-section h2 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #173124;
}

.c-grade-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.c-grade-btn {
  padding: 10px;
  border-radius: 12px;
  background: #f7faf8;
  border: 2px solid rgba(24,133,59,0.12);
  color: #173124;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  line-height: 1.3;
}

.c-grade-btn.active {
  border-color: #14853b;
  background: linear-gradient(180deg, #e8f8ec, #d4f2dc);
  color: #0d6b2e;
}

.c-grade-btn small {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #38614d;
  margin-top: 2px;
}

.c-teams-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.c-team-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #f7faf8;
  border: 2px solid rgba(24,133,59,0.12);
  font-weight: 800;
  font-size: 1rem;
  color: #173124;
}

.c-team-btn.active {
  border-color: #14853b;
  background: linear-gradient(180deg, #e8f8ec, #d4f2dc);
  color: #0d6b2e;
}

.c-start-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #2fd667, #139442);
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 6px 20px rgba(19,148,66,0.25);
}

/* ===== TUTORIAL CONTROL ===== */
.c-tutorial {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 14px;
}

.c-tutorial h2 {
  font-size: 1.15rem;
  color: #173124;
  margin: 0;
}

.c-tut-nav {
  display: flex;
  gap: 10px;
}

.c-tut-nav button {
  padding: 10px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  background: #f0f5f1;
  border: 2px solid rgba(24,133,59,0.12);
  color: #173124;
}

.c-go-btn {
  background: linear-gradient(180deg, #2fd667, #139442) !important;
  color: white !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px rgba(19,148,66,0.25);
}

.c-reset-btn {
  background: #fef0ef !important;
  color: #d44033 !important;
  border-color: rgba(212,64,51,0.15) !important;
  font-size: 0.75rem !important;
}

/* ===== PLAY CONTROL — full viewport 2-col layout ===== */
.c-play {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  height: 100%;
}

.c-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(12,61,28,0.06);
  font-size: 0.88rem;
}

.c-header strong { color: #14853b; }

/* Left column: board or event */
.c-left-col {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Right column: scores + turn nav */
.c-right-col {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===== BOARD (compact, fills left col) ===== */
.c-board-section {
  background: white;
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(12,61,28,0.06);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.c-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 4px;
  flex: 1;
  min-height: 0;
}

.c-tile {
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.8rem;
  background: linear-gradient(180deg, #ffe88a, #ffb52d);
  color: #7a5700;
  box-shadow: 0 2px 4px rgba(255,181,45,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.c-tile-regular.resolved { background: linear-gradient(180deg, #ffd96e, #ffb52d); opacity: 0.25; }
.c-tile-trap.resolved    { background: linear-gradient(180deg, #ff9474, #ef5b4a); opacity: 0.25; }
.c-tile-speed.resolved   { background: linear-gradient(180deg, #63b8ff, #2167f3); opacity: 0.25; }
.c-tile-clover.resolved  { background: linear-gradient(180deg, #49d173, #158d47); opacity: 0.25; }

.c-tile.resolved { cursor: default; color: transparent; }

/* ===== EVENT PANEL (replaces board in left col) ===== */
.c-event {
  background: white;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 4px 14px rgba(12,61,28,0.1);
  border: 2px solid rgba(24,133,59,0.15);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.c-event-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.c-event-type {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  color: white;
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.c-type-regular { background: linear-gradient(180deg, #ffcf33, #ff9d00); }
.c-type-trap    { background: linear-gradient(180deg, #ff826c, #e14638); }
.c-type-speed   { background: linear-gradient(180deg, #56b2ff, #1b6fe2); }
.c-type-clover  { background: linear-gradient(180deg, #3dc96b, #14853b); }

.c-event-team {
  font-weight: 700;
  color: #14853b;
  font-size: 0.88rem;
}

.c-question {
  font-size: 0.92rem;
  font-weight: 800;
  color: #173124;
  margin: 0;
  padding: 8px 10px;
  background: #f7faf8;
  border-radius: 10px;
  border: 1px solid rgba(24,133,59,0.08);
}

.c-answer {
  font-size: 0.82rem;
  color: #14853b;
  margin: 0;
  padding: 6px 10px;
  background: #eef8f0;
  border-radius: 8px;
  font-weight: 600;
}

.c-timer-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.c-timer-value {
  font-size: 1.2rem;
  font-weight: 900;
  color: #14853b;
  min-width: 40px;
  text-align: center;
}

.c-timer-value.warning { color: #d44033; }

.c-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.c-btn {
  flex: 1;
  min-width: 70px;
  padding: 10px 10px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.85rem;
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.c-correct { background: linear-gradient(180deg, #2fd667, #139442); }
.c-wrong   { background: linear-gradient(180deg, #ff7869, #d44033); }
.c-speed   { background: linear-gradient(180deg, #56b2ff, #1b6fe2); }
.c-clover  { background: linear-gradient(180deg, #ffe88a, #ffb52d); color: #7a5700; }
.c-steal   { background: linear-gradient(180deg, #3dc96b, #14853b); }

.c-tools {
  display: flex;
  gap: 6px;
}

.c-mini {
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.78rem;
  background: #f0f5f1;
  color: #173124;
  border: 1px solid rgba(24,133,59,0.1);
}

/* ===== SCORES (right col, fills space) ===== */
.c-scores-panel {
  background: white;
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(12,61,28,0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.c-scores-panel h3 {
  margin: 0 0 4px;
  font-size: 0.82rem;
  color: #173124;
}

.c-score-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 8px;
  background: #f7faf8;
  border: 1px solid rgba(24,133,59,0.06);
  font-size: 0.8rem;
}

.c-score-row.active {
  background: #e8f8ec;
  border-color: rgba(24,133,59,0.2);
}

.c-score-row span:first-child {
  font-weight: 700;
  min-width: 22px;
}

.c-score-row strong {
  min-width: 26px;
  text-align: right;
  color: #14853b;
  margin-right: auto;
}

.c-score-row .c-mini {
  padding: 2px 6px;
  font-size: 0.7rem;
}

.c-score-row .c-mini.plus {
  background: #e8f8ec;
  color: #14853b;
  border-color: rgba(24,133,59,0.15);
}

.c-score-row .c-mini.minus {
  background: #fef0ef;
  color: #d44033;
  border-color: rgba(212,64,51,0.12);
}

/* ===== TURN NAV (bottom of right col) ===== */
.c-turn-nav {
  display: flex;
  gap: 6px;
}

.c-turn-nav .c-mini {
  flex: 1;
  text-align: center;
  padding: 8px;
}

/* ===== FOOTER (spans full width) ===== */
.c-footer {
  grid-column: 1 / -1;
}

/* ===== END ===== */
.c-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 14px;
  text-align: center;
}

.c-end h1 {
  font-size: 1.5rem;
  color: #14853b;
  margin: 0;
}

.c-final-scores {
  background: white;
  border-radius: 14px;
  padding: 12px;
  width: min(360px, 100%);
  box-shadow: 0 2px 10px rgba(12,61,28,0.06);
  font-size: 0.9rem;
}

.c-final-scores div {
  padding: 5px 0;
  border-bottom: 1px solid rgba(24,133,59,0.06);
}

.c-final-scores div:last-child { border-bottom: none; }
