:root {
  --bg-cream: #FDF4DC;
  --card-white: #FFFDF7;
  --card-soft: #F7EEDB;
  --ink: #1F1A17;
  --ink-soft: #5E534B;
  --pink: #FF4F81;
  --turquoise: #28B5B5;
  --yellow: #FFE066;
  --green-ok: #22C55E;
  --border: 3px solid #1F1A17;
  --shadow: 4px 4px 0 #1F1A17;
  --shadow-lg: 6px 6px 0 #1F1A17;
  --radius-comic: 20px 8px 22px 8px;
  --radius-pill: 14px 6px 14px 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-cream);
  color: var(--ink);
  font-family: 'Outfit', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

#snow-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* GARLAND */
.garland-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 16px;
  background: var(--ink);
  position: relative;
  z-index: 10;
}

.bulb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: twinkle 1.6s infinite alternate;
}
.bulb.pink { background: var(--pink); box-shadow: 0 0 10px var(--pink); }
.bulb.yellow { background: var(--yellow); box-shadow: 0 0 10px var(--yellow); animation-delay: 0.5s; }
.bulb.mint { background: var(--turquoise); box-shadow: 0 0 10px var(--turquoise); animation-delay: 1s; }

@keyframes twinkle {
  from { opacity: 0.55; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1.12); }
}

/* HEADER */
.site-header {
  position: relative;
  z-index: 10;
  max-width: 1120px;
  margin: 18px auto 10px;
  padding: 0 16px;
}

.header-inner {
  background: var(--card-white);
  border: var(--border);
  border-radius: var(--radius-comic);
  box-shadow: var(--shadow-lg);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mascot-frame {
  width: 78px;
  height: 78px;
  flex-shrink: 0;
  background: var(--yellow);
  border: var(--border);
  border-radius: 22px 10px 22px 10px;
  box-shadow: 3px 3px 0 var(--ink);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.mascot-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.school-pill {
  display: inline-block;
  background: var(--pink);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border: 2px solid var(--ink);
  border-radius: 99px;
  margin-bottom: 4px;
}

.brand-titles h1 {
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.1;
}

.subtitle {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 3px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.progress-badge {
  background: var(--card-soft);
  border: 2.5px solid var(--ink);
  border-radius: 99px;
  padding: 7px 14px;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 2px 2px 0 var(--ink);
}

.ctrl-btn {
  font-family: inherit;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 8px 13px;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.ctrl-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.ctrl-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.ctrl-btn.mint { background: var(--turquoise); color: #fff; }
.ctrl-btn.yellow { background: var(--yellow); color: var(--ink); }
.ctrl-btn.ghost { background: var(--card-white); color: var(--ink); }
.ctrl-btn.ghost.unlocked { background: #DCFCE7; }

/* GRID */
.calendar-wrapper {
  position: relative;
  z-index: 10;
  max-width: 1120px;
  margin: 18px auto 34px;
  padding: 0 16px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 16px;
}

.day-door {
  background: var(--card-white);
  border: var(--border);
  border-radius: var(--radius-comic);
  box-shadow: var(--shadow);
  padding: 16px 14px;
  min-height: 158px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  text-align: left;
}

.day-door:hover:not(.locked) {
  transform: translate(-2px, -3px);
  box-shadow: var(--shadow-lg);
}

.day-door.accent-pink { background: #FFF0F5; }
.day-door.accent-mint { background: #E9FAFA; }
.day-door.accent-yellow { background: #FFFBE6; }

.day-door.completed {
  background: #E8FDF0;
  border-color: var(--ink);
}

.day-door.locked {
  opacity: 0.78;
  background: #EFE7D6;
  cursor: not-allowed;
}

.door-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.door-num {
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1;
}

.door-status {
  font-size: 1.25rem;
}

.door-icon {
  font-size: 2.1rem;
  margin: 8px 0 4px;
}

.door-label {
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
}

.door-sub {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-top: 3px;
}

/* FOOTER */
.site-footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 18px 16px 32px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.site-footer a {
  color: var(--pink);
  font-weight: 800;
  text-decoration: none;
}

.footer-tip {
  margin-top: 6px;
  font-size: 0.8rem;
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 26, 23, 0.72);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: var(--card-white);
  border: var(--border);
  border-radius: var(--radius-comic);
  box-shadow: 8px 8px 0 var(--ink);
  width: 100%;
  max-width: 760px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popModal 0.2s ease;
}

@keyframes popModal {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  background: var(--turquoise);
  border-bottom: var(--border);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header.pink-theme { background: var(--pink); color: #fff; }
.modal-header.yellow-theme { background: var(--yellow); }

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-day-tag {
  background: var(--yellow);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  padding: 3px 10px;
  font-weight: 900;
  font-size: 0.85rem;
  box-shadow: 2px 2px 0 var(--ink);
}

.modal-title-group h2 {
  font-size: 1.2rem;
  font-weight: 900;
}

.modal-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 2.5px solid var(--ink);
  background: var(--card-white);
  color: var(--ink);
  font-weight: 900;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  flex-shrink: 0;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* SHARED UI ELEMENTS INSIDE GAMES */
.info-box {
  background: var(--card-soft);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 12px 15px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.rules-box {
  background: #FFFBE6;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 12px 15px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.rules-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 0.8rem;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 3px 8px;
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid var(--ink);
}

.btn-primary, .btn-secondary, .btn-pink, .btn-yellow {
  font-family: inherit;
  font-weight: 800;
  font-size: 0.96rem;
  padding: 11px 18px;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.08s ease;
  text-decoration: none;
}

.btn-primary:hover, .btn-secondary:hover, .btn-pink:hover, .btn-yellow:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.btn-primary { background: var(--turquoise); color: #fff; }
.btn-pink { background: var(--pink); color: #fff; }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-secondary { background: var(--card-white); color: var(--ink); }

.win-banner {
  background: var(--yellow);
  border: var(--border);
  border-radius: var(--radius-comic);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.win-tag {
  display: inline-block;
  align-self: flex-start;
  background: var(--pink);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 99px;
  padding: 3px 12px;
  font-weight: 900;
  font-size: 0.82rem;
}

/* WORDLE */
.wordle-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  margin: 4px 0;
}

.wordle-row {
  display: flex;
  gap: 7px;
}

.wordle-cell {
  width: 48px;
  height: 48px;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.35rem;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 var(--ink);
}

.wordle-cell.correct { background: #22C55E; color: #fff; }
.wordle-cell.present { background: var(--yellow); color: var(--ink); }
.wordle-cell.absent { background: #D6CFC2; color: #5E534B; }

.wordle-kb {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.kb-row {
  display: flex;
  gap: 4px;
  justify-content: center;
  width: 100%;
}

.kb-key {
  font-family: inherit;
  font-weight: 800;
  font-size: 0.85rem;
  min-width: 30px;
  height: 40px;
  padding: 0 7px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--card-white);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 1.5px 1.5px 0 var(--ink);
}

.kb-key.wide { min-width: 54px; background: var(--card-soft); }
.kb-key.correct { background: #22C55E; color: #fff; }
.kb-key.present { background: var(--yellow); }
.kb-key.absent { background: #D6CFC2; color: #6E6259; }

/* SORTING */
.sort-card-box {
  background: var(--card-white);
  border: var(--border);
  border-radius: var(--radius-comic);
  box-shadow: var(--shadow);
  padding: 18px;
  text-align: center;
}

.sort-card-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--pink);
  margin-bottom: 8px;
}

.sort-card-text {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.5;
}

.sort-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.vocab-breakdown-item {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 12px;
  margin-top: 8px;
  text-align: left;
}

.vocab-list {
  margin-top: 6px;
  padding-left: 18px;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

/* IDIOM STAGE (USER DRAWING) */
.idiom-art-wrap {
  background: #FFFBE6;
  border: var(--border);
  border-radius: var(--radius-comic);
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow);
}

.idiom-art-wrap img {
  max-width: 100%;
  max-height: 270px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  object-fit: contain;
  background: #fff;
}

.text-input-comic {
  width: 100%;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 11px 14px;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--ink);
}

.choice-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-btn {
  text-align: left;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 15px;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-pill);
  background: #fff;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
}

.choice-btn:hover { background: #FFFBE6; }
.choice-btn.right { background: #DCFCE7; border-color: #15803D; }
.choice-btn.wrong { background: #FFE4E6; border-color: #BE123C; }

/* CROSSWORD 5x5 */
.cw-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
}

.cw-grid {
  display: grid;
  grid-template-columns: repeat(5, 48px);
  grid-template-rows: repeat(5, 48px);
  gap: 4px;
  background: var(--ink);
  padding: 6px;
  border-radius: 16px;
  border: var(--border);
  box-shadow: var(--shadow);
}

.cw-cell {
  position: relative;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.25rem;
  cursor: pointer;
  user-select: none;
}

.cw-cell.block {
  background: var(--ink);
  cursor: default;
}

.cw-cell.in-word {
  background: #FFF3BF;
}

.cw-cell.active-cell {
  background: var(--yellow);
  outline: 3px solid var(--pink);
  z-index: 2;
}

.cw-cell.solved-cell {
  background: #DCFCE7;
  color: #14532D;
}

.cw-num {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 0.65rem;
  font-weight: 900;
  color: var(--ink-soft);
}

.cw-clues {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clue-card {
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 3px 3px 0 var(--ink);
}

.clue-card h4 {
  font-size: 0.85rem;
  font-weight: 900;
  margin-bottom: 6px;
  color: var(--pink);
}

.clue-item {
  font-size: 0.86rem;
  padding: 5px 7px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.35;
}

.clue-item:hover { background: var(--card-soft); }
.clue-item.active-clue { background: var(--yellow); font-weight: 800; }

/* FALLON DRAWING CHALLENGE */
.draw-canvas-wrap {
  background: #fff;
  border: var(--border);
  border-radius: var(--radius-comic);
  box-shadow: var(--shadow);
  overflow: hidden;
  touch-action: none;
}

#fallon-canvas {
  width: 100%;
  height: 240px;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.sketches-review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sketch-card {
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 3px 3px 0 var(--ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sketch-card img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  background: #FFFDF7;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
}

/* SCRIPT GRAB (ZERO GRAVITY ARENA WITH SNOWFLAKES) */
.sg-arena {
  position: relative;
  width: 100%;
  height: 270px;
  background: #161311;
  border: var(--border);
  border-radius: var(--radius-comic);
  box-shadow: var(--shadow);
  overflow: hidden;
  touch-action: none;
}

.sg-snow-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sg-chip {
  position: absolute;
  background: var(--card-white);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-weight: 800;
  font-size: 0.96rem;
  cursor: grab;
  box-shadow: 3px 3px 0 #000;
  white-space: nowrap;
  touch-action: none;
  z-index: 4;
}

.sg-chip.c1 { background: #FFF8D6; }
.sg-chip.c2 { background: #E3F9F9; }
.sg-chip.c3 { background: #FFE6EE; }

.sg-chip.dragging {
  position: fixed;
  z-index: 9999;
  background: var(--yellow) !important;
  transform: scale(1.07) rotate(-2deg);
  pointer-events: none;
}

.sg-slot {
  min-height: 68px;
  background: var(--card-soft);
  border: 3px dashed var(--ink);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sg-slot.drag-over {
  background: #FFF3BF;
  border-style: solid;
  border-color: var(--pink);
}

.sg-slot.solved {
  background: #DCFCE7;
  border-style: solid;
  border-color: #15803D;
}

.sg-slot-chip {
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 6px 12px;
  font-weight: 800;
  font-size: 0.94rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: grab;
  box-shadow: 2px 2px 0 var(--ink);
}

/* SNOWBALL CANNON (MANUAL FIRE) */
.cannon-arena-wrap {
  position: relative;
  border: var(--border);
  border-radius: var(--radius-comic);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #161311;
}

#cannon-canvas {
  display: block;
  width: 100%;
  height: 340px;
  touch-action: none;
  cursor: crosshair;
}

.cannon-mobile-bar {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

/* PREDICTION CARD */
.prediction-preview {
  max-width: 360px;
  width: 100%;
  margin: 0 auto;
  border: var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  display: block;
}

/* TOAST */
.toast-msg {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 11px 18px;
  border-radius: 99px;
  border: 2px solid var(--yellow);
  z-index: 999;
  transition: transform 0.25s ease;
  pointer-events: none;
  text-align: center;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 680px) {
  .cw-layout { grid-template-columns: 1fr; justify-items: center; }
  .sketches-review-grid { grid-template-columns: 1fr; }
  .sort-btns { grid-template-columns: 1fr; }
  .brand-titles h1 { font-size: 1.4rem; }
  .wordle-cell { width: 42px; height: 42px; font-size: 1.2rem; }
  .kb-key { min-width: 25px; height: 38px; font-size: 0.78rem; padding: 0 5px; }
}
