:root {
  --paper: #f6f0e4;
  --ink: #1e2a24;
  --accent: #d8662c;
  --accent-soft: #f3c79f;
  --panel: #fffaf1;
  --line: #d8cdbd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(216, 102, 44, 0.18), transparent 35%),
    linear-gradient(180deg, #fbf7ef 0%, var(--paper) 100%);
}

a {
  color: inherit;
}

.landing,
.session-page {
  min-height: 100vh;
  padding: 32px;
}

.hero,
.live-session-root,
.session-header {
  max-width: 1100px;
  margin: 0 auto;
}

.hero {
  padding: 64px 0;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1,
.session-header h1 {
  margin: 0;
  line-height: 1.05;
}

.session-role {
  margin: 10px 0 0;
  font-size: 0.95rem;
  color: #5f675f;
}

.hero h1 {
  max-width: 12ch;
  font-size: clamp(2.8rem, 7vw, 5.8rem);
}

.lede {
  max-width: 44rem;
  font-size: 1.15rem;
  line-height: 1.7;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.actions form {
  margin: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.65);
}

.session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.session-header--student {
  margin-bottom: 10px;
}

.session-header--student h1 {
  font-size: 1.15rem;
}

.live-session-root {
  min-height: 70vh;
}

.session-share {
  margin: 0 auto 16px;
  max-width: 1100px;
}

.session-share__label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #5a5448;
}

.session-share__input {
  flex: 1 1 320px;
  min-width: 240px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: rgba(255, 255, 255, 0.88);
}

.whiteboard-app {
  display: grid;
  gap: 16px;
}

.teacher-tools {
  display: grid;
  gap: 10px;
}

.whiteboard-app--student {
  min-height: calc(100svh - 84px);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.whiteboard-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.teacher-student-controls {
  display: grid;
  gap: 10px;
}

.teacher-secondary-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.whiteboard-app--student .whiteboard-toolbar {
  position: sticky;
  top: 0;
  z-index: 6;
  padding: 8px 0 10px;
  background: linear-gradient(180deg, rgba(246, 240, 228, 0.98), rgba(246, 240, 228, 0.9) 74%, rgba(246, 240, 228, 0));
}

.tool-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.56);
}

.tool-panel__label {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6f695c;
}

.tool-panel__header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-toggle-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tool-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 5;
  display: grid;
  gap: 10px;
  min-width: 180px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 250, 241, 0.98);
  box-shadow: 0 12px 30px rgba(39, 36, 30, 0.12);
}

.tool-panel--stacked {
  display: grid;
  align-items: stretch;
}

.tool-panel--inline {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
}

.bingo-grid-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.bingo-grid-controls__field {
  display: grid;
  gap: 6px;
  color: #5a5448;
  font-size: 0.92rem;
  font-weight: 600;
}

.bingo-grid-controls__input,
.inline-text-editor__input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: rgba(255, 255, 255, 0.88);
}

.bingo-grid-controls__input {
  width: 88px;
}

.card-deck-editor {
  width: 100%;
  min-height: 180px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  font: inherit;
  line-height: 1.5;
  resize: vertical;
  background: rgba(255, 255, 255, 0.9);
}

.card-deck-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.whiteboard-toolbar__spacer {
  flex: 1 1 auto;
}

.mode-button {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.mode-button--small {
  padding: 8px 12px;
}

.mode-button--icon {
  min-width: 56px;
  padding: 12px 14px;
  font-size: 1.3rem;
  line-height: 1;
}

.mode-button--eraser {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.student-eraser-icon {
  display: block;
  width: 1.75rem;
  height: 1.35rem;
  overflow: visible;
}

.student-eraser-icon__shadow {
  fill: rgba(76, 49, 58, 0.14);
}

.student-eraser-icon__top {
  fill: #ffbdd1;
  stroke: rgba(138, 67, 90, 0.22);
  stroke-width: 1;
}

.student-eraser-icon__front {
  fill: #f58cab;
  stroke: rgba(138, 67, 90, 0.24);
  stroke-width: 1;
}

.student-eraser-icon__side {
  fill: #e45c86;
  stroke: rgba(138, 67, 90, 0.22);
  stroke-width: 1;
}

.student-eraser-icon__sleeve-top {
  fill: #7bb2ea;
  opacity: 0.95;
}

.student-eraser-icon__sleeve-front {
  fill: #5d96d8;
  opacity: 0.98;
}

.student-eraser-icon__highlight {
  stroke: rgba(255, 247, 250, 0.78);
  stroke-linecap: round;
  stroke-width: 1.2;
}

.student-eraser-icon__edge {
  stroke: rgba(112, 55, 73, 0.28);
  stroke-linecap: round;
  stroke-width: 1.2;
}

.mode-button.is-active .student-eraser-icon__top {
  fill: #ffd2e0;
}

.mode-button.is-active .student-eraser-icon__front {
  fill: #ffabc3;
}

.mode-button.is-active .student-eraser-icon__side {
  fill: #f187a7;
}

.mode-button.is-active .student-eraser-icon__sleeve-top {
  fill: #98c7f3;
}

.mode-button.is-active .student-eraser-icon__sleeve-front {
  fill: #79ade5;
}

.mode-button.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

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

.clear-button {
  color: #8f2f15;
}

.whiteboard-stage-wrap {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(65, 48, 34, 0.08);
}

.whiteboard-app--student .whiteboard-stage-wrap {
  min-height: 0;
  height: 100%;
  padding: 12px;
  overflow: hidden;
}

.bingo-grid-overlay {
  position: absolute;
  display: block;
  pointer-events: none;
  z-index: 1;
}

.card-deck-overlay {
  position: absolute;
  display: block;
  pointer-events: none;
  inset: 24px;
  z-index: 3;
}

.card-pile-overlay {
  position: absolute;
  display: block;
  pointer-events: none;
  inset: 24px;
  z-index: 3;
}

.bingo-grid {
  display: grid;
}

.card-deck-grid {
  display: grid;
}

.bingo-grid__cell {
  display: grid;
  place-items: center;
  padding: 12px;
  border: 2px solid #b79f7c;
  border-radius: 18px;
  background: rgba(255, 248, 235, 0.96);
  color: #3f3424;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 8px 18px rgba(76, 58, 39, 0.08);
}

.card-deck-card {
  position: absolute;
  display: grid;
  place-items: center;
  padding: 14px;
  border: 2px solid #b79f7c;
  border-radius: 22px;
  background: linear-gradient(180deg, #d8662c, #b74d1d);
  color: transparent;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(76, 58, 39, 0.12);
  touch-action: none;
  pointer-events: auto;
}

.card-deck-card--stack {
  pointer-events: none;
}

.card-deck-card.is-face-up {
  background: rgba(255, 248, 235, 0.98);
  color: #3f3424;
}

.card-deck-card__face {
  display: block;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
}

.card-pile-slot {
  position: absolute;
  width: fit-content;
}

.card-pile-draw-hitbox {
  position: absolute;
  inset: -6px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.card-pile-draw-hitbox:disabled {
  cursor: default;
}

.card-pile-label {
  margin-top: 176px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #6a5b49;
  text-align: center;
}

.bingo-grid__cell.is-marked {
  background: #e7f1c8;
  border-color: #7f9d4f;
  color: #2f4d17;
}

.whiteboard-stage {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
}

.inline-text-editor {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: 8px;
  min-width: 220px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 250, 241, 0.98);
  box-shadow: 0 12px 28px rgba(65, 48, 34, 0.12);
}

.inline-text-editor--grid-cell {
  min-width: 0;
  padding: 8px;
}

.inline-text-editor__input {
  width: 100%;
  font-size: 1rem;
}

.inline-text-editor__actions {
  display: flex;
  gap: 8px;
}

.letter-tray {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 249, 240, 0.96), rgba(245, 235, 221, 0.98));
  box-shadow: 0 14px 34px rgba(65, 48, 34, 0.08);
}

.letter-tray--docked {
  margin-top: 4px;
  gap: 8px;
  padding: 12px 14px;
}

.whiteboard-app--student .letter-tray--docked {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: 0;
  padding: 10px 12px;
}

.letter-tray__label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a4f31;
}

.letter-tray__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  gap: 8px;
}

.letter-tray__tile {
  min-height: 44px;
  border: 1px solid #b7aa97;
  border-radius: 12px;
  cursor: pointer;
  font-family: "Avenir Next", "Trebuchet MS", Verdana, sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.letter-tray__tile.is-blank {
  background: #efe8d6;
  color: transparent;
}

.letter-tray__tile.is-vowel {
  background: #f5c4c4;
}

.letter-tray__tile.is-consonant {
  background: #c9d7f6;
}

.pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: #efe5d4;
  font-size: 0.95rem;
}

@media (max-width: 720px) {
  .landing,
  .session-page {
    padding: 20px;
  }

  .session-page--student {
    padding: 12px;
  }

  .whiteboard-app--student {
    min-height: calc(100svh - 52px);
    gap: 10px;
  }

  .whiteboard-app--student .whiteboard-toolbar {
    gap: 8px;
    padding: 6px 0 8px;
  }

  .whiteboard-app--student .mode-button {
    padding: 10px 12px;
  }

  .whiteboard-app--student .mode-button--icon {
    min-width: 52px;
    font-size: 1.15rem;
  }

  .session-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
