/* The Cognitive Creamery - parlor styling, rebuilt with the 5-game roster. */
:root {
  --cc-cream: #fdf4e3;
  --cc-cream-2: #f7e7cd;
  --cc-choc: #4b2e1d;
  --cc-choc-2: #6a4630;
  --cc-ink: #3a2a1c;
  --cc-soft: #7a6146;
  --cc-pink: #e2607e;
  --cc-pink-soft: #f2a0bb;
  --cc-mint: #2fa98c;
  --cc-gold: #c98720;
  --cc-line: rgba(75, 46, 29, .18);
  --cc-shadow: 0 16px 40px -24px rgba(75, 46, 29, .55);
}

body {
  background:
    radial-gradient(circle at 10% 6%, rgba(226, 96, 126, .12), transparent 26rem),
    radial-gradient(circle at 90% 14%, rgba(47, 169, 140, .1), transparent 26rem),
    linear-gradient(180deg, var(--cc-cream), var(--cc-cream-2));
}

.spoon-suite {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 36px) clamp(14px, 4vw, 28px) 60px;
}

/* Hero: a chocolate storefront under a candy-striped awning. */
.suite-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: clamp(18px, 4vw, 34px);
  align-items: center;
  background: linear-gradient(170deg, var(--cc-choc-2), var(--cc-choc));
  border-radius: 22px;
  padding: clamp(30px, 5vw, 44px) clamp(18px, 4vw, 32px) clamp(20px, 4vw, 32px);
  color: #fff;
  box-shadow: var(--cc-shadow);
  overflow: hidden;
}

.suite-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 16px;
  background: repeating-linear-gradient(90deg, var(--cc-pink) 0 30px, #fff6ec 30px 60px);
}

.suite-kicker {
  margin: 0 0 8px;
  color: #ffd9a8;
  font: 800 .78rem/1 "Outfit", system-ui, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.suite-hero h1 {
  margin: 0;
  font: 900 clamp(2rem, 6.4vw, 3.8rem)/.98 "Outfit", system-ui, sans-serif;
  color: #fff;
}

.suite-hero p:not(.suite-kicker) {
  max-width: 620px;
  margin: 12px 0 0;
  color: rgba(255, 244, 226, .92);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
}

.hero-poster {
  width: 100%;
  max-width: 330px;
  justify-self: end;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 16px;
  border: 4px solid rgba(255, 246, 236, .85);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .3);
}

/* Buttons */
.suite-back,
.suite-mute,
.game-action,
.key-button {
  appearance: none;
  border: 1px solid var(--cc-line);
  background: #fffaf0;
  color: var(--cc-ink);
  border-radius: 999px;
  min-height: 42px;
  padding: 10px 16px;
  font: 800 .9rem/1 "Outfit", system-ui, sans-serif;
  cursor: pointer;
}

.game-action.primary,
.suite-back {
  background: var(--cc-choc);
  color: #ffe9cf;
  border-color: var(--cc-choc);
}

.suite-back:hover,
.suite-mute:hover,
.game-action:hover,
.key-button:hover {
  transform: translateY(-2px);
}

/* Menu: five flavor cards. */
.suite-menu { margin-top: 18px; }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.suite-menu[hidden],
.play-shell[hidden] {
  display: none !important;
}

.suite-card {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 18px;
  padding: 18px;
  color: #fff;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .03)),
    var(--card-color, #873f7f);
  box-shadow: var(--cc-shadow);
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.suite-card::after {
  content: "";
  position: absolute;
  right: -46px;
  bottom: -52px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
}

.suite-card .gemoji {
  position: relative;
  z-index: 1;
  font-size: 2.1rem;
  line-height: 1;
}

.suite-card h2 {
  position: relative;
  z-index: 1;
  margin: 12px 0 8px;
  font-size: 1.4rem;
  color: #fff;
}

.suite-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, .88);
  line-height: 1.45;
}

.suite-card:hover { transform: translateY(-3px); transition: transform .15s ease; }

/* Play shell */
.play-shell {
  background: rgba(255, 250, 240, .96);
  border: 2px solid var(--cc-line);
  border-radius: 20px;
  padding: clamp(14px, 3vw, 24px);
  box-shadow: var(--cc-shadow);
  margin-top: 18px;
}

.play-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.play-title p {
  margin: 0 0 2px;
  color: var(--cc-soft);
  font: 800 .72rem/1 "Outfit", system-ui, sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.play-title h2 {
  margin: 0;
  color: var(--cc-ink);
  font-size: clamp(1.3rem, 4vw, 1.9rem);
}

.game-host { min-height: 380px; }

.game-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.game-panel > * { min-width: 0; }

.prompt-box {
  background: #fff;
  border: 1px solid var(--cc-line);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}

.prompt-box .kicker {
  margin: 0 0 6px;
  color: var(--cc-pink);
  font: 800 .74rem/1 "Outfit", system-ui, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.prompt-box .prompt-main {
  margin: 0;
  font: 900 clamp(1.5rem, 6vw, 2.6rem)/1 "Outfit", system-ui, sans-serif;
  color: var(--cc-ink);
}

.prompt-box .prompt-help {
  margin: 8px auto 0;
  max-width: 600px;
  color: var(--cc-soft);
}

.game-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============ Sundae Sudoku ============ */
.scoop-row { margin-bottom: 2px; }

.sudoku-grid {
  width: min(100%, 360px);
  margin: 0 auto;
  display: grid;
  border: 3px solid var(--cc-choc);
  background: var(--cc-choc);
  gap: 2px;
}

.sudoku-grid[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sudoku-grid[data-n="6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); width: min(100%, 420px); }

.sudoku-cell {
  aspect-ratio: 1;
  border: 0;
  width: 100%;
  min-width: 0;
  text-align: center;
  background: #fff;
  color: var(--cc-ink);
  font: 900 clamp(1.1rem, 6vw, 2rem)/1 "Outfit", system-ui, sans-serif;
  border-radius: 0;
}

.sudoku-grid[data-n="6"] .sudoku-cell { font-size: clamp(.95rem, 4.6vw, 1.6rem); }

.sudoku-cell.given {
  background: #f7e7cd;
  color: var(--cc-choc);
}

.sudoku-cell.invalid { background: #ffe2dc; }
.sudoku-cell.box-l { border-left: 3px solid var(--cc-choc); }
.sudoku-cell.box-t { border-top: 3px solid var(--cc-choc); }
.sudoku-cell:focus { outline: 3px solid var(--cc-gold); outline-offset: -3px; }

/* ============ Word Garden ============ */
.wordle-board {
  display: grid;
  gap: 8px;
  width: min(100%, 340px);
  margin: 0 auto;
}

.wordle-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.wordle-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px solid var(--cc-line);
  border-radius: 10px;
  background: #fff;
  color: var(--cc-ink);
  font: 900 clamp(1.1rem, 5vw, 1.6rem)/1 "Outfit", system-ui, sans-serif;
  text-transform: uppercase;
}

.wordle-cell.correct { background: #2fa98c; border-color: #2fa98c; color: #fff; }
.wordle-cell.present { background: #e0a92f; border-color: #e0a92f; color: #fff; }
.wordle-cell.absent { background: #b9a68e; border-color: #b9a68e; color: #fff; }

.keyboard {
  display: grid;
  gap: 7px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.key-row {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.key-button {
  min-height: 46px;
  min-width: 0;
  flex: 1 1 0;
  max-width: 44px;
  padding: 6px 2px;
  border-radius: 9px;
  font-size: .82rem;
}

.key-button.wide { max-width: 68px; font-size: .68rem; }
.key-button.correct { background: #2fa98c; border-color: #2fa98c; color: #fff; }
.key-button.present { background: #e0a92f; border-color: #e0a92f; color: #fff; }
.key-button.absent { background: #b9a68e; border-color: #b9a68e; color: #fff; }

/* ============ Island Solitaire (Klondike, original rules) ============ */
.sol-top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.sol-group { display: flex; gap: 6px; }

.sol-slot {
  width: clamp(42px, 11.5vw, 66px);
  aspect-ratio: 2.5 / 3.5;
  border-radius: 9px;
  border: 2px solid rgba(75, 46, 29, .3);
  background: rgba(75, 46, 29, .07);
  display: grid;
  place-items: center;
  font: 900 clamp(.8rem, 2.8vw, 1rem)/1 "Outfit", system-ui, sans-serif;
  color: var(--cc-soft);
  cursor: pointer;
  padding: 0;
}

.sol-slot.has-card { background: #fff; }
.sol-slot.sel { outline: 3px solid var(--cc-gold); outline-offset: 1px; }
.sol-rank.red { color: #b7343a; }
.sol-rank.black { color: #2b2b33; }

.sol-tableau {
  display: flex;
  gap: 2%;
  justify-content: center;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.sol-col {
  width: 12.8%;
  min-width: 38px;
  position: relative;
}

.sol-col .sol-slot.sol-empty { width: 100%; }

.sol-card {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  aspect-ratio: 2.5 / 3.5;
  border-radius: 8px;
  border: 2px solid rgba(75, 46, 29, .3);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font: 900 clamp(.72rem, 2.6vw, .95rem)/1.05 "Outfit", system-ui, sans-serif;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 6px rgba(75, 46, 29, .22);
}

.sol-card.sol-anchor { position: relative; } /* in-flow: defines the column height */
.sol-card.face-down {
  background: repeating-linear-gradient(135deg, var(--cc-pink-soft) 0 6px, #f8d9e4 6px 12px);
  border-color: #d98aa5;
}
.sol-card.red { color: #b7343a; }
.sol-card.black { color: #2b2b33; }
.sol-card.sel { outline: 3px solid var(--cc-gold); outline-offset: 1px; z-index: 60 !important; }
.sol-card .sol-suit { font-size: 1.1em; }

/* ============ Sundae Stacker ============ */
.stk-wrap {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: flex-start;
}

.stk-board {
  position: relative;
  border: 3px solid var(--cc-choc);
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
  background: #fff6e6;
}

.stk-overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(253, 244, 227, .93);
  text-align: center;
  padding: 14px;
}

.stk-overlay.show { display: flex; }

.stk-full {
  margin: 0;
  font: 900 1.15rem/1.3 "Outfit", system-ui, sans-serif;
  color: var(--cc-ink);
  line-height: 1.3;
}

.stk-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.stk-side canvas {
  border: 2px solid var(--cc-line);
  border-radius: 10px;
  background: #fff6e6;
}

.stk-label {
  margin: 0;
  font: 800 .72rem/1 "Outfit", system-ui, sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cc-soft);
}

.stk-pads {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.stk-pad {
  appearance: none;
  border: 1px solid var(--cc-line);
  border-radius: 14px;
  background: #fffaf0;
  color: var(--cc-ink);
  min-width: 58px;
  min-height: 52px;
  font: 900 1.15rem/1 "Outfit", system-ui, sans-serif;
  cursor: pointer;
  touch-action: none;
  box-shadow: 0 4px 0 rgba(75, 46, 29, .12);
}

.stk-pad:active { transform: translateY(2px); box-shadow: none; }
.stk-pad.wide { min-width: 84px; font-size: .95rem; }

/* ============ Flavor Match ============ */
.mem-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 380px);
  margin: 0 auto;
}

.mem-card {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 2px solid #d98aa5;
  background: repeating-linear-gradient(135deg, var(--cc-pink-soft) 0 8px, #f8d9e4 8px 16px);
  font-size: clamp(1.5rem, 7vw, 2.1rem);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: transform .18s ease, background .18s ease;
  box-shadow: 0 4px 0 rgba(75, 46, 29, .12);
}

.mem-card.open {
  background: #fff;
  border-color: var(--cc-line);
  transform: rotateY(180deg) scaleX(-1); /* flip that leaves the emoji readable */
}

.mem-card.matched {
  border-color: var(--cc-mint);
  box-shadow: 0 0 0 2px rgba(47, 169, 140, .35);
  animation: memPop .4s ease;
}

@keyframes memPop {
  50% { transform: rotateY(180deg) scaleX(-1) scale(1.12); }
  100% { transform: rotateY(180deg) scaleX(-1) scale(1); }
}

/* Cherry rain */
.drop {
  position: fixed;
  top: -30px;
  font-size: 1.5rem;
  z-index: 9999;
  pointer-events: none;
  animation: dropFall 2.6s linear forwards;
}

@keyframes dropFall {
  to { transform: translateY(110vh) rotate(400deg); opacity: .9; }
}

/* Toast */
.suite-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  background: var(--cc-choc);
  color: #ffe9cf;
  border-radius: 999px;
  padding: 11px 16px;
  font: 800 .88rem/1.25 "Outfit", system-ui, sans-serif;
  transition: opacity .2s ease, transform .2s ease;
  max-width: 92vw;
  text-align: center;
  z-index: 200;
}

.suite-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Footer sits on cream - keep it ink. */
footer {
  max-width: 900px;
  margin: 26px auto 0;
  padding: 0 clamp(16px, 4vw, 32px) 36px;
  text-align: center;
  color: var(--cc-soft);
  font-size: .85rem;
  line-height: 1.5;
}

footer a { color: var(--cc-ink); }

@media (max-width: 720px) {
  .suite-hero {
    grid-template-columns: 1fr;
  }
  .hero-poster {
    justify-self: center;
    max-width: 100%;
  }
  .stk-wrap { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .drop { display: none !important; }
}
