/* ============================================
   ELI CLAUD — STYLE.CSS
   ============================================ */

/* VARIABLES */
:root {
  --coral:   #FF6B6B;
  --sky:     #4FC3F7;
  --mint:    #4DD4A0;
  --golden:  #FFD54F;
  --purple:  #B39DDB;
  --white:   #FFFFFF;
  --off-white: #F8F9FF;
  --text:    #1A1A2E;
  --text-light: #555577;
  --nav-bg:  #1A1A2E;
  --nav-text: #FFFFFF;
  --card-bg: #FFFFFF;
  --card-shadow: 0 6px 24px rgba(0,0,0,0.10);
  --radius:  14px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  --off-white:  #0D0D1E;
  --text:       #EEEEFF;
  --text-light: #AAAACC;
  --nav-bg:     #060612;
  --nav-text:   #FFFFFF;
  --card-bg:    #1A1A30;
  --card-shadow: 0 6px 24px rgba(0,0,0,0.50);
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  background: var(--off-white);
  color: var(--text);
  overflow-x: hidden;
  cursor: none; /* custom sparkle cursor */
}
body.games-page {
  cursor: auto !important;
}
@media (hover: none) { body { cursor: auto; } }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
strong { font-weight: 800; }

/* SPARKLE CURSOR */
#sparkle-container { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999; }
.sparkle {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: sparkle-fade 0.55s ease-out forwards;
  z-index: 9999;
}
@keyframes sparkle-fade {
  0%   { transform: translate(-50%,-50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(0); opacity: 0; }
}

/* TOAST */
#toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: var(--card-bg);
  padding: .75rem 1.5rem;
  border-radius: 2rem;
  font-weight: 700;
  font-size: 1rem;
  z-index: 9990;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
  white-space: nowrap;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* CONFETTI */
#confetti-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9980; overflow: hidden; }
.confetti-bit {
  position: absolute;
  width: 10px;
  height: 10px;
  opacity: 0;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* M.O.N.N.Y. RAIN */
#monny-rain { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9970; overflow: hidden; }
.monny-coin {
  position: absolute;
  top: -60px;
  font-size: 1.4rem;
  animation: coin-fall linear forwards;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.2));
}
@keyframes coin-fall {
  0%   { top: -60px; opacity: 1; }
  100% { top: 110vh; opacity: .4; }
}

/* BOUNCING E */
#bouncing-e {
  position: fixed;
  font-family: 'Fredoka One', sans-serif;
  font-size: 5rem;
  color: var(--golden);
  text-shadow: 4px 4px 0 rgba(0,0,0,.15);
  pointer-events: none;
  z-index: 100;
  display: none;
  user-select: none;
  line-height: 1;
  padding: .2em .35em;
  background: var(--text);
  border-radius: var(--radius-sm);
}

/* NAV */
#navbar {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--nav-bg);
  color: var(--nav-text);
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.nav-logo {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.3rem;
  color: var(--golden);
  white-space: nowrap;
  margin-right: auto;
}
.nav-links {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
}
.nav-links a {
  padding: .35rem .75rem;
  border-radius: 2rem;
  font-weight: 700;
  font-size: .85rem;
  color: rgba(255,255,255,.8);
  transition: background .2s, color .2s;
}
.nav-links a:hover { background: rgba(255,255,255,.15); color: #fff; }
#night-toggle, #whimsy-btn {
  background: none;
  border: 2px solid rgba(255,255,255,.3);
  color: white;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  transition: border-color .2s, transform .2s;
  flex-shrink: 0;
}
#night-toggle:hover { border-color: var(--golden); transform: rotate(20deg); }
#whimsy-btn:hover   { border-color: var(--coral);  transform: scale(1.2) rotate(-15deg); }
#whimsy-btn.whimsy-active { animation: whimsy-spin .4s ease-out; }
@keyframes whimsy-spin { 0%{transform:rotate(0)} 100%{transform:rotate(360deg) scale(1.3)} }

/* ── WHIMSY EFFECT ANIMATIONS ── */
@keyframes page-shake {
  0%,100% { transform: translateX(0) rotate(0); }
  15%     { transform: translateX(-10px) rotate(-1deg); }
  30%     { transform: translateX(10px) rotate(1deg); }
  45%     { transform: translateX(-7px) rotate(-.5deg); }
  60%     { transform: translateX(7px) rotate(.5deg); }
  80%     { transform: translateX(-4px); }
}
.page-shake { animation: page-shake .55s ease-in-out 2; }

@keyframes page-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes balloon-rise {
  0%   { transform: translateY(0) rotate(-5deg); opacity: 1; }
  50%  { transform: translateY(-55vh) rotate(8deg); }
  85%  { opacity: 1; }
  100% { transform: translateY(-115vh) rotate(-5deg); opacity: 0; }
}
.whimsy-balloon {
  position: fixed;
  bottom: -80px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  pointer-events: none;
  z-index: 9990;
  animation: balloon-rise 3s ease-in forwards;
}

@keyframes emoji-fall {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translateY(110vh) rotate(540deg) scale(.5); opacity: 0; }
}
.whimsy-emoji {
  position: fixed;
  top: -70px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  pointer-events: none;
  z-index: 9990;
  animation: emoji-fall var(--dur,2s) ease-in forwards;
}

@keyframes rainbow-flash {
  0%   { background: hsla(0,100%,55%,.3); }
  16%  { background: hsla(55,100%,55%,.3); }
  33%  { background: hsla(120,100%,45%,.3); }
  50%  { background: hsla(185,100%,50%,.3); }
  66%  { background: hsla(250,100%,60%,.3); }
  83%  { background: hsla(300,100%,55%,.3); }
  100% { background: hsla(360,100%,55%,0); }
}
.whimsy-rainbow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9940;
  animation: rainbow-flash 1.4s ease-out forwards;
}

/* color-spin used as inline style animation for persistent hue-rotate */
@keyframes color-spin {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* HERO */
#hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7rem 1.5rem 2rem;
  background: linear-gradient(135deg, #1A1A2E 0%, #2D2066 50%, #1A1A2E 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1.5' fill='rgba(255,255,255,0.15)'/%3E%3C/svg%3E") repeat;
  pointer-events: none;
}
.hero-title {
  font-family: 'Fredoka One', sans-serif;
  font-size: clamp(3.5rem, 12vw, 8rem);
  color: #FFFFFF;
  line-height: 1;
  text-shadow: 4px 4px 0 rgba(0,0,0,.3), 0 0 60px rgba(179,157,219,.5);
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}
#eli-click {
  color: var(--golden);
  cursor: pointer;
  display: inline-block;
  transition: transform .1s;
}
#eli-click:active { transform: scale(.95); }
.hero-tagline {
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: rgba(255,255,255,.7);
  font-style: italic;
  font-weight: 600;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}
.hero-stats {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}
.stat-card {
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius);
  padding: 1.25rem 1.75rem;
  color: white;
  text-align: center;
  transition: transform .2s, background .2s;
  cursor: pointer;
}
.stat-card:hover { transform: translateY(-4px); background: rgba(255,255,255,.15); }
.stat-label { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .7; margin-bottom: .25rem; }
.stat-value { font-family: 'Fredoka One', sans-serif; font-size: clamp(1.1rem, 3vw, 1.5rem); color: var(--golden); word-break: break-all; max-width: 280px; }
.stat-sublabel { font-size: .75rem; opacity: .6; margin-top: .25rem; }
.monny-value { font-size: clamp(.85rem, 2vw, 1rem) !important; }

/* SEARCH */
.search-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  text-align: center;
}
.search-tip {
  color: rgba(255,255,255,.6);
  font-size: .85rem;
  margin-bottom: .75rem;
  font-weight: 600;
}
.search-row {
  display: flex;
  gap: .5rem;
  background: rgba(255,255,255,.12);
  border: 2px solid rgba(255,255,255,.2);
  border-radius: 2rem;
  padding: .4rem .4rem .4rem 1.25rem;
  transition: border-color .2s, background .2s;
}
.search-row:focus-within { border-color: var(--golden); background: rgba(255,255,255,.18); }
#search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: white;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
}
#search-input::placeholder { color: rgba(255,255,255,.4); }
#search-btn {
  background: var(--golden);
  border: none;
  border-radius: 1.5rem;
  padding: .4rem .9rem;
  font-size: 1rem;
  transition: transform .15s, opacity .15s;
}
#search-btn:hover { transform: scale(1.1); }
#search-result {
  margin-top: .75rem;
  min-height: 1.5rem;
  color: rgba(255,255,255,.85);
  font-weight: 600;
  font-size: .95rem;
}

/* SECTIONS */
.section {
  padding: 4rem 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}
.section-title {
  font-family: 'Fredoka One', sans-serif;
  font-size: clamp(2rem, 6vw, 3rem);
  text-align: center;
  margin-bottom: .5rem;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
  transition: transform .15s;
}
.section-title:hover { transform: translateX(-50%) rotate(-1deg) scale(1.03); }
.section-subtitle {
  text-align: center;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

/* Section tints — full bleed using body backgrounds behind max-width sections */
body > section.section-coral { background: #FFF0F0; }
body > section.section-sky   { background: #EFF9FF; }
body > section.section-mint  { background: #EDFFF7; }
body > section.section-golden{ background: #FFFBEE; }
body > section.section-purple{ background: #F5F0FF; }

[data-theme="dark"] body > section.section-coral  { background: #1F1010; }
[data-theme="dark"] body > section.section-sky    { background: #0E1820; }
[data-theme="dark"] body > section.section-mint   { background: #0E1F18; }
[data-theme="dark"] body > section.section-golden { background: #1E1B0E; }
[data-theme="dark"] body > section.section-purple { background: #140E20; }

/* Force section backgrounds to full width */
section.section-coral,
section.section-sky,
section.section-mint,
section.section-golden,
section.section-purple {
  max-width: 100%;
  padding-left: max(1.5rem, calc(50% - 460px));
  padding-right: max(1.5rem, calc(50% - 460px));
}
section.section-coral > *,
section.section-sky > *,
section.section-mint > *,
section.section-golden > *,
section.section-purple > * {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}
section.section-coral > .section-title,
section.section-sky > .section-title,
section.section-mint > .section-title,
section.section-golden > .section-title,
section.section-purple > .section-title {
  display: block;
  left: 0;
  transform: none;
  text-align: center;
}
section.section-coral > .section-title:hover,
section.section-sky > .section-title:hover,
section.section-mint > .section-title:hover,
section.section-golden > .section-title:hover,
section.section-purple > .section-title:hover {
  transform: rotate(-1deg) scale(1.03);
}

/* ABOUT */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.about-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  transition: transform .2s;
}
.about-card:hover { transform: translateY(-4px); }
.about-quote p {
  font-family: 'Caveat', cursive;
  font-size: 1.3rem;
  color: var(--coral);
  line-height: 1.4;
}
.monny-def h3 {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.6rem;
  color: var(--golden);
  margin-bottom: .25rem;
}
.monny-expand { font-size: .9rem; color: var(--text-light); margin-bottom: .75rem; }
.monny-big { font-size: .8rem; color: var(--text-light); word-break: break-all; line-height: 1.5; }
.credits h3 { font-family: 'Fredoka One', sans-serif; font-size: 1.2rem; margin-bottom: .75rem; color: var(--coral); }
.credits-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .3rem .75rem;
  font-size: .9rem;
}
.credits-grid span:nth-child(odd) { color: var(--text-light); }
.signature-text {
  font-family: 'Caveat', cursive;
  font-size: 2rem;
  color: var(--text);
  margin-bottom: .75rem;
}
.eli-sponsor { font-size: .85rem; color: var(--text-light); }

/* VIDEO EMBED */
.video-embed {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: 0 auto 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  aspect-ratio: 16/9;
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.video-embed-wide { max-width: 100%; }

/* RUBIK'S STEPS */
.rubiks-steps { display: flex; flex-direction: column; gap: 1rem; margin-top: .5rem; }
.rubiks-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  box-shadow: var(--card-shadow);
}
.rubiks-step-num {
  flex-shrink: 0;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rubiks-step-body strong { display: block; font-size: 1.05rem; margin-bottom: .3rem; }
.rubiks-step-body p { margin: 0; line-height: 1.6; font-size: .95rem; }

/* TABS */
.tabs-container { display: flex; flex-direction: column; gap: .75rem; }
.tab-item { border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--card-shadow); }
.tab-trigger {
  width: 100%;
  background: var(--card-bg);
  border: none;
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: background .2s;
  position: relative;
}
.tab-trigger::after {
  content: '▼';
  margin-left: auto;
  font-size: .75rem;
  opacity: .5;
  transition: transform .25s;
}
.tab-trigger.open::after { transform: rotate(180deg); }
.tab-trigger:hover { background: rgba(0,0,0,.04); }
[data-theme="dark"] .tab-trigger:hover { background: rgba(255,255,255,.06); }
.tab-hint { font-weight: 400; opacity: .6; font-size: .85rem; }
.tab-content {
  background: var(--card-bg);
  border-top: 2px solid var(--off-white);
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .35s ease;
}
.tab-content.open {
  max-height: 800px;
  padding: 1.25rem;
}
.tab-content ol, .tab-content ul { padding-left: 1.5rem; }
.tab-content li { margin-bottom: .4rem; line-height: 1.5; }
.tab-content p { line-height: 1.6; margin-bottom: .5rem; }
.eli-tip {
  margin-top: 1rem;
  background: #FFFBEE;
  border-left: 4px solid var(--golden);
  padding: .6rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-weight: 700;
  font-size: .9rem;
}
[data-theme="dark"] .eli-tip { background: #2A250A; }

/* CHESS TIPS */
.chess-tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.tip-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 1rem;
  box-shadow: var(--card-shadow);
  font-size: .9rem;
  line-height: 1.5;
  transition: transform .2s;
}
.tip-card:hover { transform: translateY(-3px); }

/* CHESS GAME */
.chess-game-area {
  text-align: center;
  margin-top: 2rem;
}
.chess-game-area h3 {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.5rem;
  margin-bottom: .5rem;
}
.game-hint { color: var(--text-light); font-size: .9rem; margin-bottom: 1rem; }
.chess-board-wrap { display: inline-block; }
#chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: min(600px, 92vw);
  aspect-ratio: 1;
  border: 3px solid var(--text);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.chess-coords-files {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: min(600px, 92vw);
  margin-top: .25rem;
}
.chess-coords-files span {
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-light);
}
.chess-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  cursor: pointer;
  position: relative;
  transition: background .15s;
}
.chess-cell.light { background: #F0D9B5; }
.chess-cell.dark  { background: #B58863; }
.chess-cell.selected  { background: #F6F669 !important; }
.chess-cell.valid-move::after {
  content: '';
  position: absolute;
  width: 32%;
  height: 32%;
  border-radius: 50%;
  background: rgba(0,0,0,.25);
  pointer-events: none;
}
.chess-cell.valid-move.has-piece::after {
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: none;
  border: 4px solid rgba(0,0,0,.3);
}
.chess-cell.last-move { background: rgba(255,215,0,.45) !important; }
.chess-cell.in-check  { background: rgba(255,50,50,.55) !important; }
.chess-piece {
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  line-height: 1;
  user-select: none;
  pointer-events: none;
  transition: transform .1s;
}
.white-piece { color: #fff; text-shadow: 0 0 3px #000, 0 0 6px #000, 1px 1px 0 #333; }
.black-piece { color: #1a1a1a; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.chess-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.chess-status {
  font-weight: 700;
  font-size: 1rem;
  padding: .5rem 1rem;
  background: var(--card-bg);
  border-radius: 2rem;
  box-shadow: var(--card-shadow);
}
.btn-secondary {
  background: var(--text);
  color: var(--card-bg);
  border: none;
  border-radius: 2rem;
  padding: .5rem 1.25rem;
  font-weight: 700;
  font-size: .9rem;
  transition: opacity .2s, transform .2s;
}
.btn-secondary:hover { opacity: .85; transform: scale(1.05); }
.captured-display {
  margin-top: .75rem;
  font-size: .85rem;
  min-height: 1.5rem;
  color: var(--text-light);
}

/* STEPS (Rubik's) */
.steps-list { display: flex; flex-direction: column; gap: .75rem; }

/* TIME MACHINE */
.time-machine-explanation {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--card-shadow);
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}
.time-machine-explanation h3 {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.4rem;
  color: var(--purple);
  margin-bottom: 1rem;
  letter-spacing: .05em;
}
.time-machine-explanation p {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: .75rem;
}
.time-machine-fine-print {
  font-size: .8rem !important;
  color: var(--text-light);
  margin-top: 1rem !important;
}
.stopwatch-area { text-align: center; }
.stopwatch-display {
  font-family: 'Fredoka One', sans-serif;
  font-size: clamp(3rem, 12vw, 6rem);
  color: var(--purple);
  letter-spacing: .05em;
  margin-bottom: .5rem;
  transition: color .3s, text-shadow .3s;
}
.stopwatch-display.running {
  color: var(--coral);
  text-shadow: 0 0 30px rgba(255,107,107,.4);
  animation: pulse-glow 1.5s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { text-shadow: 0 0 20px rgba(255,107,107,.3); }
  50%       { text-shadow: 0 0 50px rgba(255,107,107,.6); }
}
.time-status {
  font-size: 1rem;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 1.5rem;
  min-height: 1.5rem;
}
.stopwatch-controls { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.btn-sw {
  border: none;
  border-radius: 2rem;
  padding: .75rem 1.5rem;
  font-weight: 800;
  font-size: .95rem;
  transition: transform .15s, opacity .15s;
}
.btn-sw:hover { transform: scale(1.07); }
.btn-sw:active { transform: scale(.95); }
.btn-sw-green { background: var(--mint);   color: #064; }
.btn-sw-red   { background: var(--coral);  color: #fff; }
.btn-sw-gray  { background: #ddd;          color: #333; }
.btn-sw-blue  { background: var(--sky);    color: #036; }
.time-coords {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: center;
  max-height: 200px;
  overflow-y: auto;
}
.time-coord-entry {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: .5rem 1rem;
  font-size: .85rem;
  font-weight: 700;
  box-shadow: var(--card-shadow);
  color: var(--purple);
}

/* GAMES */
.game-panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--card-shadow);
}
.game-panel h3 {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.5rem;
  margin-bottom: .5rem;
}
.game-desc { color: var(--text-light); font-size: .95rem; margin-bottom: .75rem; }
#catch-it-canvas { display: block; width: 100%; height: auto; }
.game-instructions {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: .82rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  background: var(--off-white);
  border-radius: var(--radius-sm);
  padding: .6rem 1rem;
}
.game-ui-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  font-size: .95rem;
  font-weight: 600;
}
.btn-game {
  background: var(--coral);
  color: white;
  border: none;
  border-radius: 2rem;
  padding: .5rem 1.25rem;
  font-weight: 800;
  font-size: .9rem;
  transition: transform .15s, opacity .15s;
}
.btn-game:hover { transform: scale(1.07); }
.mobile-capture { background: var(--golden); color: #333; }
canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--card-shadow);
}

/* LASSO */
.lasso-mode-btns { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.lasso-mode-btn {
  background: var(--off-white);
  border: 2px solid transparent;
  border-radius: 2rem;
  padding: .4rem 1rem;
  font-weight: 700;
  font-size: .9rem;
  color: var(--text-light);
  transition: all .2s;
}
.lasso-mode-btn.active { border-color: var(--coral); color: var(--coral); background: var(--card-bg); }
.lasso-question {
  font-family: 'Fredoka One', sans-serif;
  font-size: clamp(1.2rem, 4vw, 1.75rem);
  color: var(--coral);
  min-height: 2.5rem;
  margin-bottom: .75rem;
  text-align: center;
}

/* COMMENTS */
.like-area {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.like-button {
  font-size: 2.5rem;
  background: none;
  border: none;
  transition: transform .15s;
  line-height: 1;
}
.like-button:hover { transform: scale(1.25); }
.like-button:active { transform: scale(.9); }
.like-count { font-weight: 800; font-size: 1.1rem; }
.comment-form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-width: 520px;
  margin: 0 auto 2rem;
}
.comment-form input,
.comment-form textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: .75rem 1rem;
  border: 2px solid rgba(0,0,0,.1);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  transition: border-color .2s;
  resize: vertical;
}
.comment-form input:focus,
.comment-form textarea:focus { outline: none; border-color: var(--sky); }
.btn-submit {
  background: var(--sky);
  color: white;
  border: none;
  border-radius: 2rem;
  padding: .75rem 1.5rem;
  font-weight: 800;
  font-size: 1rem;
  transition: transform .15s, opacity .15s;
}
.btn-submit:hover { transform: scale(1.04); opacity: .9; }
.comments-list {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.comment-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  box-shadow: var(--card-shadow);
  position: relative;
}
.comment-name { font-weight: 800; font-size: .9rem; color: var(--coral); margin-bottom: .25rem; }
.comment-text { font-size: .95rem; line-height: 1.5; }
.comment-time { font-size: .75rem; color: var(--text-light); margin-top: .4rem; }
.no-comments { text-align: center; color: var(--text-light); font-size: .95rem; padding: 1rem 0; }

/* FOOTER */
footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--nav-bg);
  color: rgba(255,255,255,.6);
  font-size: .85rem;
  line-height: 1.8;
}
.monny-footer { color: rgba(255,255,255,.35); font-size: .8rem; }

/* KBD */
kbd {
  display: inline-block;
  background: var(--card-bg);
  border: 2px solid rgba(0,0,0,.15);
  border-radius: 4px;
  padding: .1em .35em;
  font-size: .85em;
  font-family: monospace;
  box-shadow: 0 2px 0 rgba(0,0,0,.15);
}

/* LEGENDARY FLASH */
.legendary-flash {
  position: fixed;
  inset: 0;
  background: rgba(255, 215, 0, .5);
  pointer-events: none;
  z-index: 9960;
  animation: flash-out .8s ease-out forwards;
}
@keyframes flash-out {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* NAV LOGO AS LINK + ACTIVE STATE */
.nav-logo {
  text-decoration: none;
  color: inherit;
}
.nav-links .nav-active {
  background: rgba(255,255,255,.2);
  color: #fff;
  font-weight: 800;
  outline: 2px solid rgba(255,255,255,.6);
  outline-offset: -2px;
}

/* HUB CARDS */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}
.hub-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem 1.25rem;
  box-shadow: var(--card-shadow);
  transition: transform .2s, box-shadow .2s;
  gap: .5rem;
}
.hub-card:hover { transform: translateY(-6px); box-shadow: 0 8px 28px rgba(0,0,0,.14); }
.hub-emoji { font-size: 3rem; line-height: 1; }
.hub-label { font-family: 'Fredoka One', sans-serif; font-size: 1.4rem; }
.hub-desc  { font-size: .88rem; color: var(--text-light); line-height: 1.4; }
.hub-games   { border-top: 4px solid var(--mint); }
.hub-learning{ border-top: 4px solid var(--sky); }
.hub-time    { border-top: 4px solid var(--purple); }
.hub-library { border-top: 4px solid var(--golden); }

/* PAGE SUBTABS */
.page-tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
}
.page-tab {
  background: var(--card-bg);
  border: 2px solid transparent;
  border-radius: 2rem;
  padding: .6rem 1.4rem;
  font-weight: 700;
  font-size: .92rem;
  color: var(--text-light);
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.page-tab:hover {
  border-color: var(--coral);
  color: var(--coral);
  transform: translateY(-1px);
}
.page-tab.active {
  background: var(--coral);
  border-color: var(--coral);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(255,107,107,.4);
  transform: translateY(-2px);
}
.page-tab-panel { display: none; }
.page-tab-panel.active { display: block; }

/* CHESS DIFFICULTY */
.chess-difficulty-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  justify-content: center;
  margin-bottom: 1rem;
  font-weight: 700;
  font-size: .95rem;
}
.chess-difficulty-select {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: .9rem;
  padding: .4rem .75rem;
  border: 2px solid var(--mint);
  border-radius: 2rem;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
}

/* LEARNING PANELS */
.learning-panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--card-shadow);
}
.learning-panel-title {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.5rem;
  margin-bottom: .5rem;
}

/* SMALL GAME BUTTONS */
.btn-game-sm {
  padding: .35rem .9rem;
  font-size: .82rem;
}
.btn-game-launch {
  background: var(--purple);
}

/* ENGINEERING ENCOUNTER */
.eng-score-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  font-size: .95rem;
  font-weight: 600;
}
.eng-workspace {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.eng-palette {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  min-width: 110px;
}
.palette-label {
  font-weight: 800;
  font-size: .85rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .25rem;
}
.eng-part {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: var(--off-white);
  border: 2px solid rgba(0,0,0,.08);
  border-radius: var(--radius-sm);
  padding: .4rem .6rem;
  font-size: 1.15rem;
  cursor: grab;
  user-select: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.eng-part span { font-size: .75rem; font-weight: 700; color: var(--text); }
.eng-part { cursor: pointer; }
.eng-part:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,.12); border-color: var(--purple); }
.eng-part:active { transform: scale(.97); }
.eng-part-active { background: var(--purple) !important; border-color: var(--purple) !important; color: #fff; box-shadow: 0 4px 14px rgba(179,157,219,.5); }
.eng-part-active span { color: #fff !important; }
.eng-build-area {
  position: relative;
  flex: 1;
  min-width: 240px;
}
#eng-canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 2px dashed rgba(0,0,0,.15);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #e8f4ff 0%, #f0f8e8 100%);
}
#eng-canvas.drag-over { border-color: var(--purple); background: linear-gradient(180deg, #f0eeff 0%, #eef8ff 100%); }
.eng-build-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(0,0,0,.3);
  font-size: 1rem;
  font-weight: 700;
  pointer-events: none;
  text-align: center;
  transition: opacity .3s;
}
.eng-result {
  min-height: 2.5rem;
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.3rem;
  text-align: center;
  padding: .5rem;
}

/* TIME MACHINE TEASER */
.time-machine-teaser {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--card-shadow);
}
.tm-teaser-glow {
  font-size: 4rem;
  animation: tm-float 2.5s ease-in-out infinite;
  margin-bottom: 1rem;
}
@keyframes tm-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}
.time-machine-teaser h3 {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.4rem;
  color: var(--purple);
  margin-bottom: .75rem;
}
.time-machine-teaser p { font-size: 1rem; line-height: 1.6; margin-bottom: .5rem; color: var(--text-light); }
.time-machine-fine-print { font-size: .8rem !important; margin-top: .75rem !important; }
.btn-tm-launch {
  display: inline-block;
  margin-top: 1.25rem;
  background: var(--purple);
  color: white;
  text-decoration: none;
  border-radius: 2rem;
  padding: .85rem 2.25rem;
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.2rem;
  letter-spacing: .03em;
  transition: transform .15s, opacity .15s;
  box-shadow: 0 4px 16px rgba(179,157,219,.4);
}
.btn-tm-launch:hover { transform: scale(1.06); opacity: .92; }

/* LIBRARY LOUNGE */
.library-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.btn-shelf {
  background: var(--golden);
  color: #333;
  border: none;
  border-radius: 2rem;
  padding: .5rem 1.25rem;
  font-weight: 800;
  font-size: .9rem;
  transition: transform .15s, opacity .15s;
}
.btn-shelf:hover { transform: scale(1.05); }
.btn-shelf:disabled { opacity: .35; cursor: default; transform: none; }
.shelf-label {
  font-weight: 800;
  font-size: 1rem;
  min-width: 90px;
  text-align: center;
  color: var(--text-light);
}
.lib-loading, .lib-error {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 2rem;
  color: var(--text-light);
}
.lib-error { color: var(--coral); }
.bookshelf-wrap {
  position: relative;
  padding-bottom: 18px;
  margin-bottom: 1.5rem;
}
.bookshelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 1rem;
  padding: 1rem 1rem 0;
  min-height: 200px;
}
.shelf-plank {
  height: 18px;
  background: linear-gradient(180deg, #a0662a 0%, #7a4a14 40%, #6b3e0e 100%);
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0,0,0,.25);
}
.book-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform .2s;
  text-align: center;
}
.book-card:hover { transform: translateY(-6px) scale(1.03); }
.book-cover {
  width: 90px;
  height: 130px;
  border-radius: 4px 8px 8px 4px;
  object-fit: cover;
  box-shadow: 3px 3px 10px rgba(0,0,0,.3), -1px 0 4px rgba(0,0,0,.15);
  background: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  overflow: hidden;
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-cover-fallback {
  width: 90px;
  height: 130px;
  border-radius: 4px 8px 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 3px 3px 10px rgba(0,0,0,.3), -1px 0 4px rgba(0,0,0,.15);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.2;
  padding: .5rem;
  word-break: break-word;
  text-align: center;
  overflow: hidden;
  color: white;
}
.book-title {
  font-size: .7rem;
  font-weight: 700;
  margin-top: .4rem;
  max-width: 95px;
  color: var(--text);
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* BOOK READER MODAL */
.lib-reader {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.lib-reader-inner {
  background: var(--card-bg);
  border-radius: var(--radius);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,.35);
  overflow: hidden;
}
.lib-reader-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 2px solid var(--off-white);
  gap: 1rem;
}
.lib-reader-title {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.3rem;
  margin: 0 0 .25rem;
}
.lib-reader-author {
  font-size: .85rem;
  color: var(--text-light);
  margin: 0;
}
.lib-reader-controls {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-shrink: 0;
}
.btn-font {
  background: var(--off-white);
  border: 2px solid rgba(0,0,0,.1);
  border-radius: var(--radius-sm);
  padding: .3rem .6rem;
  font-weight: 800;
  font-size: .85rem;
  transition: transform .15s;
}
.btn-font:hover { transform: scale(1.1); }
.btn-reader-close {
  background: var(--coral);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s;
}
.btn-reader-close:hover { transform: scale(1.15); }
.lib-reader-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  font-size: 1rem;
  line-height: 1.8;
  white-space: pre-wrap;
  font-family: Georgia, serif;
}
.lib-reader-loading {
  text-align: center;
  color: var(--text-light);
  font-size: 1rem;
  padding: 2rem;
}

/* NOTES */
.notes-loading { text-align: center; color: var(--text-light); padding: 2rem; font-size: 1rem; }
.notes-list { display: flex; flex-direction: column; gap: 1rem; margin-top: .5rem; }
.note-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  border-left: 4px solid var(--mint);
}
.note-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0,0,0,.14); }
.note-card-title {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.3rem;
  margin-bottom: .35rem;
  color: var(--text);
}
.note-card-date { font-size: .8rem; color: var(--text-light); margin-bottom: .6rem; }
.note-card-preview {
  font-size: .95rem;
  color: var(--text-light);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notes-empty { text-align: center; font-size: 1.1rem; color: var(--text-light); padding: 3rem 1rem; }
.notes-empty p { margin-bottom: .5rem; }

.note-detail-inner { max-width: 720px; }
.note-detail-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 800;
  color: var(--purple);
  margin-bottom: 1.75rem;
  cursor: pointer;
  font-size: 1rem;
  background: none;
  border: none;
  padding: 0;
}
.note-detail-back:hover { text-decoration: underline; }
#note-detail-title {
  font-family: 'Fredoka One', sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin-bottom: .5rem;
  line-height: 1.2;
}
#note-detail-date { font-size: .9rem; color: var(--text-light); margin-bottom: 2rem; }
#note-detail-content {
  font-size: 1.05rem;
  line-height: 1.85;
  white-space: pre-wrap;
  max-width: 680px;
  color: var(--text);
}

.btn-write-note {
  display: block;
  margin-left: auto;
  margin-right: auto;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 2rem;
  padding: .7rem 1.75rem;
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.1rem;
  letter-spacing: .02em;
  box-shadow: 0 4px 16px rgba(179,157,219,.45);
  transition: transform .15s, opacity .15s;
  margin-bottom: 2rem;
}
.btn-write-note:hover { transform: scale(1.05); opacity: .92; }

/* PIN OVERLAY */
#pin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 8100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(5px);
}
#pin-overlay.active { display: flex; }
.pin-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  width: 100%;
  max-width: 380px;
  padding: 2rem;
  box-shadow: 0 12px 48px rgba(0,0,0,.4);
}
.pin-prompt-wrap { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.pin-prompt-wrap > p { font-weight: 700; font-size: 1.1rem; }
#pin-input {
  font-size: 1.5rem;
  letter-spacing: .5em;
  text-align: center;
  width: 140px;
  border: 2px solid rgba(128,128,128,.2);
  border-radius: var(--radius-sm);
  padding: .5rem .25rem;
  outline: none;
  background: var(--off-white);
  color: var(--text);
}
#pin-input:focus { border-color: var(--purple); }
.editor-actions { display: flex; gap: .75rem; justify-content: center; }
.btn-editor-save {
  background: var(--mint);
  color: #fff;
  border: none;
  border-radius: 2rem;
  padding: .6rem 1.5rem;
  font-weight: 800;
  font-size: .95rem;
  transition: transform .15s, opacity .15s;
}
.btn-editor-save:hover { transform: scale(1.05); opacity: .9; }
.btn-editor-cancel {
  background: none;
  border: 2px solid rgba(128,128,128,.25);
  border-radius: 2rem;
  padding: .6rem 1.25rem;
  font-weight: 700;
  font-size: .95rem;
  color: var(--text-light);
}
.btn-editor-cancel:hover { border-color: var(--coral); color: var(--coral); }

/* ZENPEN FULL-PAGE EDITOR */
#notes-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: none;
  flex-direction: column;
  background: #fff;
  overflow-y: auto;
}
[data-theme="dark"] #notes-editor-overlay { background: #111122; }
#notes-editor-overlay.active { display: flex; }

.zenpen-toolbar {
  position: fixed;
  top: 1.25rem;
  right: 1.75rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  z-index: 10;
}
.zenpen-btn-save {
  background: var(--mint);
  color: #fff;
  border: none;
  border-radius: 2rem;
  padding: .5rem 1.25rem;
  font-weight: 800;
  font-size: .9rem;
  transition: transform .15s, opacity .15s;
  box-shadow: 0 2px 8px rgba(77,212,160,.35);
}
.zenpen-btn-save:hover { transform: scale(1.05); opacity: .9; }
.zenpen-btn-save:disabled { opacity: .45; transform: none; cursor: not-allowed; }
.zenpen-btn-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #aaa;
  line-height: 1;
  padding: .25rem .4rem;
  transition: color .15s;
}
.zenpen-btn-close:hover { color: var(--coral); }

.zenpen-inner {
  flex: 1;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 5rem 2rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.zenpen-title {
  font-family: 'Fredoka One', sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  border: none;
  background: transparent;
  color: #1a1a2e;
  width: 100%;
  outline: none;
  line-height: 1.15;
}
[data-theme="dark"] .zenpen-title { color: #eeeeff; }
.zenpen-title::placeholder { color: #ccc; }
.zenpen-body {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.2rem;
  line-height: 1.9;
  border: none;
  background: transparent;
  color: #333;
  width: 100%;
  resize: none;
  outline: none;
  flex: 1;
  min-height: 60vh;
}
[data-theme="dark"] .zenpen-body { color: #ccccee; }
.zenpen-body::placeholder { color: #bbb; }

.hub-notes { border-top: 4px solid var(--coral); }

/* RESPONSIVE */
@media (max-width: 600px) {
  .nav-links { display: none; }
  .hero-stats { flex-direction: column; align-items: center; }
  .chess-game-area h3 { font-size: 1.2rem; }
  .stopwatch-controls { gap: .5rem; }
  .btn-sw { padding: .6rem 1rem; font-size: .85rem; }
  .game-panel { padding: 1.25rem; }
  .about-grid { grid-template-columns: 1fr; }
  .chess-tips-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .chess-tips-grid { grid-template-columns: 1fr; }
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--off-white); }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 4px; }

/* ─── LEMONADE TYCOON ─── */
.lem-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1.25rem;
  justify-content: space-between;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.25rem;
  box-shadow: var(--card-shadow);
  align-items: center;
}
.lem-stat-compact-item {
  font-size: 0.95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.lem-stat-compact-item strong {
  font-family: 'Fredoka One', sans-serif;
  font-weight: normal;
  color: var(--text-light);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.15rem;
}
.lem-stat-compact-item span {
  font-family: 'Fredoka One', sans-serif;
  color: var(--text);
}
.lem-stat-compact-item .monny-text-value {
  color: #c49a00;
  text-shadow: 0 0 8px rgba(255,213,79,0.15);
}
[data-theme="dark"] .lem-stat-compact-item .monny-text-value {
  color: var(--golden);
}
.lem-stat-compact-sub {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-left: 0.15rem;
}

.lem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.lem-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}
.lem-card h4 {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.lem-section-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 1.2rem;
}

/* Shop and Recipe Styles */
.lem-inventory-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.lem-inventory-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--off-white);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0,0,0,0.05);
  text-align: center;
}
.lem-inv-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.lem-inv-icon {
  font-size: 1.5rem;
}
.lem-inv-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.lem-inv-label {
  font-size: 0.7rem;
  color: var(--text-light);
  text-transform: uppercase;
  font-weight: 700;
}
.lem-inv-count {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.1rem;
  color: var(--text);
}
.btn-buy-small {
  background: var(--purple);
  color: white;
  border: none;
  border-radius: 2rem;
  padding: 0.35rem 0.75rem;
  font-weight: 700;
  font-size: 0.8rem;
  width: 100%;
  transition: background 0.15s, transform 0.1s;
}
.btn-buy-small:hover:not(:disabled) {
  background: #9575cd;
  transform: scale(1.03);
}
.btn-buy-small:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}
.lem-recipe-container {
  display: flex;
  gap: 1.5rem;
  align-items: stretch;
  margin-top: 0.5rem;
}
@media (max-width: 600px) {
  .lem-recipe-container {
    flex-direction: column-reverse;
    align-items: center;
  }
}
.lem-recipe-controls {
  flex: 1;
  width: 100%;
}
.lem-recipe-visual {
  flex-shrink: 0;
  width: 140px;
  min-height: 200px;
  position: relative;
  border-radius: var(--radius-sm);
  background: var(--off-white);
  border: 3px solid var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 4px 12px rgba(0,0,0,0.1);
  padding: 0.5rem;
}
#lem-recipe-preview-canvas {
  width: 120px;
  height: 180px;
  display: block;
}
.lem-slider-group {
  margin-bottom: 1rem;
}
.lem-slider-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.lem-slider-group input[type="range"] {
  width: 100%;
  accent-color: var(--purple);
  cursor: pointer;
}
.lem-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.lem-input-group label {
  font-size: 0.9rem;
  font-weight: 700;
}
.lem-select {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--off-white);
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  font-weight: 600;
  outline: none;
}
.lem-price-input-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.2rem;
  color: var(--golden);
}
.lem-price-input-row input {
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--off-white);
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  outline: none;
}

/* Simulator Canvas */
.lem-sim-area {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.5rem;
  text-align: center;
  overflow: hidden;
}
.lem-canvas-container {
  position: relative;
  overflow: hidden;
  aspect-ratio: 700/300;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}
#lem-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.lem-canvas-overlay {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--purple);
  border: 2px solid rgba(255, 255, 255, 0.15);
  color: white;
  padding: 0.6rem 1.8rem;
  border-radius: 2rem;
  font-family: 'Fredoka One', sans-serif;
  font-size: 0.95rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
  z-index: 10;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.lem-canvas-overlay:hover {
  background: #9575cd;
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.lem-canvas-overlay:active {
  transform: translateX(-50%) scale(0.97);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.lem-canvas-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}
.lem-canvas-act-btn {
  background: rgba(26, 26, 46, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.lem-canvas-act-btn:hover {
  background: var(--purple);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}
.lem-canvas-act-btn:active {
  transform: scale(0.95);
}

/* Reviews Feed */
.lem-feed-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--off-white);
  border-radius: var(--radius-sm);
  min-height: 220px;
}
.lem-feed-placeholder {
  color: var(--text-light);
  font-style: italic;
  text-align: center;
  margin: auto;
  font-size: 0.9rem;
}
.lem-feed-item {
  padding: 0.5rem 0.75rem;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  font-size: 0.85rem;
  line-height: 1.4;
  border-left: 3px solid var(--mint);
  animation: feed-slide-in 0.25s ease-out;
}
@keyframes feed-slide-in {
  from { transform: translateY(-5px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Upgrades */
.lem-upgrades-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.lem-upgrade-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem;
  background: var(--off-white);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color 0.2s;
}
.lem-upgrade-item.purchased {
  border-color: var(--mint);
  background: rgba(77, 212, 160, 0.06);
}
.lem-upg-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-width: 65%;
  text-align: left;
}
.lem-upg-info strong {
  font-size: 0.9rem;
  color: var(--text);
}
.lem-upg-info span {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Modal Report */
.lem-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
  animation: modal-fade-in 0.25s ease-out;
}
@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.lem-modal-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  width: 90%;
  max-width: 460px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  text-align: center;
  position: relative;
  animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s, transform 0.1s;
}
.modal-close:hover {
  color: var(--coral);
  transform: scale(1.1);
}
.btn-inflate-small {
  margin-top: 0.5rem;
  background: var(--golden);
  color: var(--text);
  border: none;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 2rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.15s, background-color 0.15s;
}
.btn-inflate-small:hover {
  background: #fbc02d;
  transform: scale(1.05);
}
@keyframes modal-pop {
  from { transform: scale(0.9) translateY(10px); }
  to { transform: scale(1) translateY(0); }
}
.lem-modal-content h4 {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--text);
}
.lem-report-details {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}
.rep-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--off-white);
  font-size: 0.95rem;
}
.rep-row strong {
  font-family: 'Fredoka One', sans-serif;
  color: var(--text);
}
.rep-row strong.monny-text-value {
  color: var(--golden);
  text-shadow: 0 0 5px rgba(255, 213, 79, 0.15);
}
.rep-alert {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  text-align: left;
  line-height: 1.4;
  margin-top: 0.5rem;
}
.rep-alert-warn {
  background: rgba(255, 213, 79, 0.12);
  border-left: 4px solid var(--golden);
  color: #7b6200;
}
[data-theme="dark"] .rep-alert-warn { color: var(--golden); }
.rep-alert-danger {
  background: rgba(255, 107, 107, 0.1);
  border-left: 4px solid var(--coral);
  color: #b33939;
}
[data-theme="dark"] .rep-alert-danger { color: #ffa4a4; }
.rep-eli-quote {
  margin-top: 1rem;
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  color: var(--coral);
  background: var(--off-white);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  line-height: 1.3;
}
