/* ============ A1~A2 English clone - styles ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; color: #0f172a; background: #fff; overflow-x: hidden; }
img { -webkit-user-drag: none; user-select: none; }
button { font-family: inherit; background: none; border: 0; cursor: pointer; }
a { text-decoration: none; color: inherit; }

/* ---------- fonts ---------- */
.font-sans { font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.font-pixel { font-family: "Press Start 2P", monospace; }
.font-arvo { font-family: Arvo, serif; }
.font-silkscreen { font-family: Silkscreen, monospace; }
.font-google { font-family: Nunito, "Trebuchet MS", ui-sans-serif, system-ui, sans-serif; }
#seasonTitle { text-shadow: 0 1px 0 rgba(255,255,255,.6), 0 3px 10px rgba(0,0,0,.12); }
.pixelated { image-rendering: pixelated; }

/* ---------- display ---------- */
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.grow { flex-grow: 1; }
.shrink-0 { flex-shrink: 0; }
.gap-1 { gap: 4px; } .gap-1\.5 { gap: 6px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-3\.5 { gap: 14px; } .gap-4 { gap: 16px; } .gap-16 { gap: 64px; }
.min-w-0 { min-width: 0; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

/* ---------- layout ---------- */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { inset: 0; }
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }
.top-3 { top: 12px; }
.left-0 { left: 0; } .right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-1\/2 { left: 50%; }
.-translate-x-1\/2 { transform: translateX(-50%); }
.z-10 { z-index: 10; } .z-20 { z-index: 20; } .z-30 { z-index: 30; }
.min-h-screen { min-height: 100vh; }
.w-full { width: 100%; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-md { max-width: 28rem; }
.max-w-xl { max-width: 36rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-auto { margin-top: auto; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.pt-2 { padding-top: 8px; } .pt-4 { padding-top: 16px; } .pt-6 { padding-top: 24px; } .pt-8 { padding-top: 32px; } .pt-16 { padding-top: 64px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-3\.5 { padding-left: 14px; padding-right: 14px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-5 { padding-left: 20px; padding-right: 20px; }
.px-10 { padding-left: 40px; padding-right: 40px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-1\.5 { padding-top: 6px; padding-bottom: 6px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-3\.5 { padding-top: 14px; padding-bottom: 14px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-5 { padding-top: 20px; padding-bottom: 20px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.py-12 { padding-top: 48px; padding-bottom: 48px; }
.py-28 { padding-top: 112px; padding-bottom: 112px; }
.py-20 { padding-top: 80px; padding-bottom: 80px; }
.p-4 { padding: 16px; }
.pb-2 { padding-bottom: 8px; } .pb-4 { padding-bottom: 16px; } .pb-6 { padding-bottom: 24px; } .pb-8 { padding-bottom: 32px; }
.overflow-hidden { overflow: hidden; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* ---------- text ---------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-xs { font-size: 12px; line-height: 16px; }
.text-sm { font-size: 14px; line-height: 20px; }
.text-base { font-size: 16px; line-height: 24px; }
.text-lg { font-size: 18px; line-height: 28px; }
.text-xl { font-size: 20px; line-height: 28px; }
.text-2xl { font-size: 24px; line-height: 32px; }
.text-3xl { font-size: 30px; line-height: 36px; }
.text-4xl { font-size: 36px; line-height: 40px; }
.text-5xl { font-size: 48px; line-height: 1; }
.text-\[10px\] { font-size: 10px; line-height: 14px; }
.text-\[11px\] { font-size: 11px; line-height: 14px; }
.text-\[13px\] { font-size: 13px; line-height: 18px; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }
.uppercase { text-transform: uppercase; }
.italic { font-style: italic; }
.tracking-wide { letter-spacing: .025em; }
.tracking-wider { letter-spacing: .05em; }
.tracking-tight { letter-spacing: -.025em; }
.tracking-widest { letter-spacing: .1em; }
.leading-snug { line-height: 1.375; }
.leading-tight { line-height: 1.25; }
.break-words { overflow-wrap: break-word; word-break: break-word; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.select-none { -webkit-user-select: none; user-select: none; }
.underline { text-decoration: underline; }
.whitespace-nowrap { white-space: nowrap; }

/* ---------- slate ---------- */
.text-slate-300 { color: #cbd5e1; } .text-slate-400 { color: #94a3b8; } .text-slate-500 { color: #64748b; } .text-slate-600 { color: #475569; } .text-slate-700 { color: #334155; } .text-slate-800 { color: #1e293b; } .text-slate-900 { color: #0f172a; }
.bg-slate-100 { background-color: #f1f5f9; } .bg-slate-200\/60 { background-color: rgba(226,232,240,.6); } .bg-slate-300 { background-color: #cbd5e1; } .bg-slate-400 { background-color: #94a3b8; } .bg-slate-900\/80 { background-color: rgba(15,23,42,.8); }
.border-slate-300\/40 { border-color: rgba(203,213,225,.4); }

/* ---------- amber ---------- */
.text-amber-500 { color: #f59e0b; } .text-amber-600 { color: #d97706; } .text-amber-700 { color: #b45309; } .text-amber-800 { color: #92400e; } .text-amber-950 { color: #451a03; }
.bg-amber-50\/90 { background-color: rgba(255,251,235,.9); } .bg-amber-100\/70 { background-color: rgba(254,243,199,.7); } .bg-amber-100\/80 { background-color: rgba(254,243,199,.8); } .bg-amber-400\/20 { background-color: rgba(251,191,36,.2); } .bg-amber-400\/25 { background-color: rgba(251,191,36,.25); } .bg-amber-400 { background-color: #fbbf24; } .bg-amber-500 { background-color: #f59e0b; }
.border-amber-300\/60 { border-color: rgba(252,211,77,.6); } .border-amber-500\/30 { border-color: rgba(245,158,11,.3); } .border-amber-600\/60 { border-color: rgba(217,119,6,.6); }

/* ---------- rose / purple / pink ---------- */
.text-rose-950 { color: #4c0519; } .text-rose-800 { color: #9f1239; } .text-rose-700 { color: #be123c; }
.bg-rose-50\/90 { background-color: rgba(255,241,242,.9); } .bg-rose-100 { background-color: #ffe4e6; }
.border-rose-300 { border-color: #fda4af; } .border-rose-200 { border-color: #fecdd3; } .border-rose-400 { border-color: #fb7185; }
.text-purple-950 { color: #3b0764; } .text-purple-800 { color: #6b21a8; } .text-purple-700 { color: #7e22ce; }
.bg-purple-50\/90 { background-color: rgba(250,245,255,.9); } .bg-purple-100 { background-color: #f3e8ff; }
.border-purple-300 { border-color: #d8b4fe; } .border-purple-200 { border-color: #e9d5ff; } .border-purple-400 { border-color: #c084fc; }
.text-pink-950 { color: #500724; } .text-pink-800 { color: #9d174d; } .text-pink-700 { color: #be185d; }
.bg-pink-50\/90 { background-color: rgba(253,242,248,.9); } .bg-pink-100 { background-color: #fce7f3; }
.border-pink-300 { border-color: #f9a8d4; } .border-pink-200 { border-color: #fbcfe8; } .border-pink-400 { border-color: #f472b6; }

/* ---------- slate/zinc for page 4/5 ---------- */
.text-slate-600 { color: #475569; } .text-slate-800 { color: #1e293b; } .text-slate-900 { color: #0f172a; }
.bg-slate-50 { background-color: #f8fafc; } .bg-slate-200 { background-color: #e2e8f0; }
.border-slate-300 { border-color: #cbd5e1; } .border-slate-200 { border-color: #e2e8f0; } .border-slate-400 { border-color: #94a3b8; }
.text-zinc-100 { color: #f4f4f5; } .text-zinc-400 { color: #a1a1aa; } .text-zinc-300 { color: #d4d4d8; } .text-zinc-800 { color: #27272a; }
.bg-zinc-950 { background-color: #09090b; } .bg-zinc-900\/90 { background-color: rgba(24,24,27,.9); } .bg-zinc-800 { background-color: #27272a; }
.border-zinc-700 { border-color: #3f3f46; } .border-zinc-800 { border-color: #27272a; } .border-zinc-600 { border-color: #52525b; }

/* ---------- borders & radius & shadows ---------- */
.border { border-width: 1px; border-style: solid; }
.border-2 { border-width: 2px; border-style: solid; }
.border-black\/5 { border-color: rgba(0,0,0,.05); } .border-black\/10 { border-color: rgba(0,0,0,.1); } .border-black\/15 { border-color: rgba(0,0,0,.15); } .border-black\/30 { border-color: rgba(0,0,0,.3); }
.border-t { border-top-width: 1px; border-top-style: solid; }
.rounded-sm { border-radius: 2px; }
.rounded { border-radius: 4px; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }
.rounded-full { border-radius: 9999px; }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0,0,0,.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1); }
.shadow-inner { box-shadow: inset 0 2px 4px 0 rgba(0,0,0,.06); }
.backdrop-blur { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.backdrop-blur-md { -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.opacity-65 { opacity: .65; }
.opacity-30 { opacity: .3; }
.opacity-\[0\.035\] { opacity: .035; }
.bg-white { background-color: #fff; }
.bg-white\/70 { background-color: rgba(255,255,255,.7); }
.bg-white\/80 { background-color: rgba(255,255,255,.8); }
.bg-white\/85 { background-color: rgba(255,255,255,.85); }
.bg-white\/90 { background-color: rgba(255,255,255,.9); }
.bg-black { background-color: #000; }
.text-white { color: #fff; }
.text-black { color: #000; }
.bg-transparent { background-color: transparent; }

/* ---------- transitions / transforms ---------- */
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(.4,0,.2,1); transition-duration: .2s; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(.4,0,.2,1); transition-duration: .2s; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(.4,0,.2,1); transition-duration: .2s; }
.duration-200 { transition-duration: .2s; }
.duration-300 { transition-duration: .3s; }
.duration-1000 { transition-duration: 1s; }
.ease-in-out { transition-timing-function: ease-in-out; }

/* ---------- custom shadows from original ---------- */
.ds-amber { box-shadow: 0 6px 18px rgba(245,158,11,.45); }
.ds-amber-hover { box-shadow: 0 8px 22px rgba(245,158,11,.6); }
.ds-block { box-shadow: 3px 3px 0px #000; }
.drop-shadow-hard { filter: drop-shadow(2px 3px 0px rgba(0,0,0,.12)); }
.drop-shadow-hard-15 { filter: drop-shadow(2px 3px 0px rgba(0,0,0,.15)); }

/* ---------- animation ---------- */
@keyframes eggPulse { 50% { opacity: .5; } }
.animate-pulse { animation: eggPulse 2s cubic-bezier(.4,0,.6,1) infinite; }

@keyframes eggBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes eggPop { 0% { transform: scale(.2); opacity: 0; } 70% { transform: scale(1.25); } 100% { transform: scale(1); opacity: 1; } }
@keyframes eggSpin { to { transform: rotate(360deg); } }

/* ---------- cursor ---------- */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* ---------- sizes ---------- */
.h-px { height: 1px; }
.w-2 { width: 8px; } .h-2 { height: 8px; }
.w-2\.5 { width: 10px; } .h-2\.5 { height: 10px; }
.w-3 { width: 12px; } .h-3 { height: 12px; }
.w-3\.5 { width: 14px; } .h-3\.5 { height: 14px; }
.w-4 { width: 16px; } .h-4 { height: 16px; }
.w-6 { width: 24px; }
.min-h-110 { min-height: 110px; }
.min-h-120 { min-height: 120px; }
.min-h-96c { min-height: calc(100vh - 96px); }
.rotate-45 { transform: rotate(45deg); }
.grad-line { background: linear-gradient(to right, transparent, #cbd5e1, transparent); }

/* ---------- hover / active / disabled (element-level) ---------- */
.hover\:-translate-y-1:hover { transform: translateY(-4px); }
.hover\:shadow-lg:hover { box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1); }
.hover\:shadow-amber:hover { box-shadow: 0 8px 22px rgba(245,158,11,.6); }
.hover\:bg-amber-100:hover { background-color: #fef3c7; }
.hover\:bg-amber-400:hover { background-color: #fbbf24; }
.hover\:bg-slate-100:hover { background-color: #f1f5f9; }
.hover\:bg-slate-400:hover { background-color: #94a3b8; }
.hover\:border-black\/30:hover { border-color: rgba(0,0,0,.3); }
.hover\:scale-105:hover { transform: scale(1.05); }
.hover\:border-rose-400:hover { border-color: #fb7185; }
.hover\:border-purple-400:hover { border-color: #c084fc; }
.hover\:border-pink-400:hover { border-color: #f472b6; }
.hover\:border-slate-400:hover { border-color: #94a3b8; }
.hover\:border-zinc-600:hover { border-color: #52525b; }
.active\:scale-\[0\.98\]:active { transform: scale(.98); }
.active\:scale-\[0\.99\]:active { transform: scale(.99); }
.active\:scale-95:active { transform: scale(.95); }
.disabled\:opacity-30:disabled { opacity: .3; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }
.enabled\:hover\:scale-105:hover:not(:disabled) { transform: scale(1.05); }
.enabled\:active\:scale-95:active:not(:disabled) { transform: scale(.95); }

/* ---------- speaking badge on word cards ---------- */
.wcard .spk-badge { display: none; }
.wcard.speaking .spk-badge { display: inline-flex; }
.wcard.speaking .pos-badge { display: none; }

/* ---------- hover (desktop) ---------- */
.group:hover .group-hover\:translate-x-0\.5 { transform: translateX(2px); }
.group:hover .group-hover\:block { display: block; }
.group:hover .group-hover\:text-amber-600 { color: #d97706; }
.group:hover .group-hover\:text-amber-700 { color: #b45309; }

/* ---------- responsive ---------- */
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:text-sm { font-size: 14px; line-height: 20px; }
  .sm\:text-base { font-size: 16px; line-height: 24px; }
  .sm\:text-lg { font-size: 18px; line-height: 28px; }
  .sm\:text-2xl { font-size: 24px; line-height: 32px; }
  .sm\:text-3xl { font-size: 30px; line-height: 36px; }
  .sm\:text-4xl { font-size: 36px; line-height: 40px; }
  .sm\:flex-row { flex-direction: row; }
}
@media (min-width: 768px) {
  .md\:text-3xl { font-size: 30px; line-height: 36px; }
  .md\:text-4xl { font-size: 36px; line-height: 40px; }
  .md\:text-5xl { font-size: 48px; line-height: 1; }
  .md\:text-sm { font-size: 14px; line-height: 20px; }
  .md\:text-lg { font-size: 18px; line-height: 28px; }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ============ Easter egg layer ============ */
#egg-layer { position: fixed; inset: 0; z-index: 9999; pointer-events: none; overflow: hidden; }
#egg-layer .egg-img { position: absolute; image-rendering: pixelated; pointer-events: none; -webkit-user-select: none; user-select: none; }
#egg-layer .egg-clickable { pointer-events: auto; cursor: pointer; }

/* ---------- egg FX ---------- */
/* soft blue vignette for the swim egg */
#egg-layer.egg-vignette {
  background: radial-gradient(ellipse at center, rgba(56,150,255,.06) 0%, rgba(56,150,255,.16) 100%);
}

/* flash overlay */
#egg-layer .egg-flash {
  position: absolute; inset: 0; z-index: 50; pointer-events: none;
  animation: eggFlashFade .5s ease-out forwards;
}
@keyframes eggFlashFade { 0% { opacity: .85; } 100% { opacity: 0; } }

/* screen shake */
#egg-layer.egg-shake { animation: eggShake .5s linear; }
@keyframes eggShake {
  0%,100% { transform: translate(0,0); }
  10% { transform: translate(calc(var(--shake-amp,7px) * -1), 2px); }
  20% { transform: translate(var(--shake-amp,7px), -2px); }
  30% { transform: translate(calc(var(--shake-amp,7px) * -.7), 1px); }
  40% { transform: translate(calc(var(--shake-amp,7px) * .6), -1px); }
  50% { transform: translate(calc(var(--shake-amp,7px) * -.4), 0); }
  60% { transform: translate(calc(var(--shake-amp,7px) * .3), 1px); }
  70% { transform: translate(calc(var(--shake-amp,7px) * -.2), 0); }
  80% { transform: translate(calc(var(--shake-amp,7px) * .15), -1px); }
  90% { transform: translate(0, 0); }
}

/* breathing glow (sprite-safe via drop-shadow) */
#egg-layer .egg-glow { animation: eggGlow 1.1s ease-in-out infinite alternate; }
@keyframes eggGlow {
  from { filter: drop-shadow(0 0 1px var(--glow,#ffd700)); }
  to   { filter: drop-shadow(0 0 9px var(--glow,#ffd700)); }
}

/* strong glow for items revealed from lucky blocks */
#egg-layer .egg-glow-strong {
  animation: eggGlowStrong .7s ease-in-out infinite alternate;
}
@keyframes eggGlowStrong {
  from {
    filter:
      drop-shadow(0 0 4px var(--glow,#ffd700))
      drop-shadow(0 0 8px var(--glow,#ffd700));
  }
  to {
    filter:
      drop-shadow(0 0 9px var(--glow,#ffd700))
      drop-shadow(0 0 20px var(--glow,#ffd700))
      drop-shadow(0 0 30px #ffffff);
  }
}

/* gentle fade out for expired lucky blocks / collected items */
#egg-layer .egg-fade-out { animation: eggFadeOut .35s ease-out forwards; }
@keyframes eggFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* rainbow shimmer (invincible mario / starman) */
#egg-layer .egg-rainbow { animation: eggRainbow .38s linear infinite; }
@keyframes eggRainbow { to { filter: hue-rotate(360deg); } }

/* pixel particles */
#egg-layer .egg-particle {
  position: absolute; image-rendering: pixelated; pointer-events: none;
  border-radius: 1px;
}

/* ambient rising bubbles (swim egg) */
#egg-layer .egg-bubble {
  position: absolute; bottom: -30px; border-radius: 9999px; pointer-events: none;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.9), rgba(190,230,255,.3));
  animation-name: eggRise; animation-timing-function: linear; animation-iteration-count: infinite;
  opacity: 0;
}
@keyframes eggRise {
  0%   { transform: translateY(0); opacity: 0; }
  8%   { opacity: .75; }
  85%  { opacity: .55; }
  100% { transform: translateY(-120vh); opacity: 0; }
}

/* scrollbar subtle (original site look) */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100,116,139,.35); border-radius: 9999px; }

/* floating score popup (walk item pickup) */
#egg-layer .egg-score {
  position: absolute;
  pointer-events: none;
  z-index: 70;
  font-family: "Press Start 2P", monospace;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 1px;
  white-space: nowrap;
  color: var(--score-color, #ffffff);
  text-shadow:
    -2px 0 #000, 2px 0 #000, 0 -2px #000, 0 2px #000,
    -2px -2px #000, 2px -2px #000, -2px 2px #000, 2px 2px #000,
    0 0 10px var(--glow, #ffd700), 0 0 18px var(--glow, #ffd700);
  animation: eggScoreFloat 1.15s ease-out forwards;
}
/* 1UP uses the classic green text */
#egg-layer .egg-score.egg-score-oneup { --score-color: #6ee7b7; }
@keyframes eggScoreFloat {
  0%   { opacity: 0; transform: translateX(-50%) translateY(8px) scale(.5); }
  18%  { opacity: 1; transform: translateX(-50%) translateY(-2px) scale(1.2); }
  32%  { transform: translateX(-50%) translateY(-6px) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-70px) scale(1); }
}
/* rainbow shimmer on the 5000 star score */
#egg-layer .egg-score.egg-score-star {
  animation: eggScoreFloat 1.15s ease-out forwards, eggScoreHue .45s linear infinite;
}
@keyframes eggScoreHue { to { filter: hue-rotate(360deg); } }

/* ============================================================
   Breakout easter egg (elgoog.im/breakout style)
   ============================================================ */
#breakout-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: "Press Start 2P", monospace;
}
#breakout-overlay .bo-top {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 3;
}
#breakout-overlay .bo-x {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
#breakout-overlay .bo-x:hover { background: rgba(255, 255, 255, 0.28); }
#breakout-overlay canvas {
  max-width: min(92vw, 820px);
  width: 100%;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  image-rendering: pixelated;
}
#breakout-overlay .bo-game {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: #000;
  cursor: pointer;
  user-select: none;
}
#breakout-overlay .bo-game-title {
  font-size: 74px;
  color: #fff;
  letter-spacing: 8px;
  text-shadow: 0 0 26px rgba(61, 153, 255, 0.85), 0 8px 0 #3d9aff;
  animation: boTitlePulse 1.6s ease-in-out infinite;
}
#breakout-overlay .bo-game-sub {
  font-size: 16px;
  color: #ffd83d;
  animation: boBlink 1.1s steps(2) infinite;
}
#breakout-overlay .bo-game-hint {
  font-size: 11px;
  color: #8a8a8a;
  letter-spacing: 1px;
  line-height: 2;
  text-align: center;
}
@keyframes boTitlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes boBlink { 50% { opacity: 0.15; } }

/* ============================================================
   Tetris easter egg (elgoog.im/tetris style: GOOGLE pixel logo
   + autoplay Tetris show). Unlock: type "tetris"/"teris".
   ============================================================ */
#tetris-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: #fff;
  overflow: auto;
  font-family: Arial, Helvetica, sans-serif;
}
#tetris-overlay .tt-stage {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 26px 16px 18px;
  box-sizing: border-box;
}
#tetris-overlay .tt-logo {
  width: 272px;
  height: auto;
  margin-bottom: 8px;
  image-rendering: pixelated;
}
#tetris-overlay .tt-holder {
  width: 525px;
  max-width: 94vw;
  height: 550px;
  border-radius: 2px;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
  background: #040304;
}
#tetris-overlay .tt-holder canvas {
  image-rendering: pixelated;
}
#tetris-overlay .tt-footer {
  margin-top: 12px;
  font-size: 12px;
  color: #70757a;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
#tetris-overlay .tt-close {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
  color: #5f6368;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
#tetris-overlay .tt-close:hover { background: #f1f3f4; }
#tetris-overlay .tt-err {
  color: #d93025;
  font-size: 13px;
  padding: 24px;
  text-align: center;
}
@media (max-width: 600px) {
  #tetris-overlay .tt-logo { width: 200px; }
  #tetris-overlay .tt-holder { height: 420px; }
  #tetris-overlay .tt-footer { white-space: normal; text-align: center; }
}

/* ============================================================
   Google 2048 Easter Egg Overlay
   ============================================================ */
#g2048-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #faf8ef;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  font-family: 'Arial', 'Helvetica Neue', sans-serif;
}

#g2048-overlay .g2-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #e0e0e0;
  color: #5f6368;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
#g2048-overlay .g2-close:hover { background: #d0d0d0; }

#g2048-overlay .g2-stage {
  width: 500px;
  max-width: 100%;
}

#g2048-overlay .g2-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

#g2048-overlay .g2-title {
  font-size: 64px;
  font-weight: 900;
  margin: 0;
  letter-spacing: -2px;
}
#g2048-overlay .g2-c-red { color: #EA4335; }
#g2048-overlay .g2-c-green { color: #34A853; }
#g2048-overlay .g2-c-yellow { color: #FBBC05; }
#g2048-overlay .g2-c-blue { color: #4285F4; }

#g2048-overlay .g2-scores {
  display: flex;
  gap: 8px;
}

#g2048-overlay .g2-score-box {
  padding: 10px 20px;
  border-radius: 4px;
  text-align: center;
  min-width: 80px;
}
#g2048-overlay .g2-score-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.8;
}
#g2048-overlay .g2-score-val,
#g2048-overlay .g2-best-val {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}
#g2048-overlay .g2-score { background: #34A853; color: #fff; }
#g2048-overlay .g2-best { background: #FBBC05; color: #fff; }

#g2048-overlay .g2-intro {
  font-size: 15px;
  color: #776e65;
  margin: 0 0 16px 0;
}

#g2048-overlay .g2-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

#g2048-overlay .g2-btn {
  background: #C53929;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
#g2048-overlay .g2-btn:hover { background: #a82e22; }
#g2048-overlay .g2-bot-active { background: #1a73e8; }
#g2048-overlay .g2-bot-active:hover { background: #1557b0; }

#g2048-overlay .g2-board {
  position: relative;
  background: #BBADA0;
  border-radius: 6px;
  padding: 12px;
  width: 464px;
  max-width: 100%;
}

#g2048-overlay .g2-grid {
  position: relative;
  width: 440px;
  height: 440px;
  max-width: 100%;
}

#g2048-overlay .g2-cell {
  position: absolute;
  width: 104px;
  height: 104px;
  background: rgba(238, 228, 218, 0.35);
  border-radius: 4px;
}
/* Position cells in 4x4 grid */
#g2048-overlay .g2-cell:nth-child(1)  { top: 0;    left: 0; }
#g2048-overlay .g2-cell:nth-child(2)  { top: 0;    left: 112px; }
#g2048-overlay .g2-cell:nth-child(3)  { top: 0;    left: 224px; }
#g2048-overlay .g2-cell:nth-child(4)  { top: 0;    left: 336px; }
#g2048-overlay .g2-cell:nth-child(5)  { top: 112px; left: 0; }
#g2048-overlay .g2-cell:nth-child(6)  { top: 112px; left: 112px; }
#g2048-overlay .g2-cell:nth-child(7)  { top: 112px; left: 224px; }
#g2048-overlay .g2-cell:nth-child(8)  { top: 112px; left: 336px; }
#g2048-overlay .g2-cell:nth-child(9)  { top: 224px; left: 0; }
#g2048-overlay .g2-cell:nth-child(10) { top: 224px; left: 112px; }
#g2048-overlay .g2-cell:nth-child(11) { top: 224px; left: 224px; }
#g2048-overlay .g2-cell:nth-child(12) { top: 224px; left: 336px; }
#g2048-overlay .g2-cell:nth-child(13) { top: 336px; left: 0; }
#g2048-overlay .g2-cell:nth-child(14) { top: 336px; left: 112px; }
#g2048-overlay .g2-cell:nth-child(15) { top: 336px; left: 224px; }
#g2048-overlay .g2-cell:nth-child(16) { top: 336px; left: 336px; }

#g2048-overlay .g2-tile {
  position: absolute;
  width: 104px;
  height: 104px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 800;
  z-index: 2;
  transition: transform .18s cubic-bezier(.2, .75, .25, 1), opacity .18s ease;
  will-change: transform;
}

#g2048-overlay .g2-ghost {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  transition: transform .17s cubic-bezier(.2, .75, .25, 1);
  will-change: transform;
}

#g2048-overlay .g2-tile-new {
  animation: g2-spawn .24s cubic-bezier(.2, .8, .2, 1);
}
#g2048-overlay .g2-tile-merge {
  animation: g2-merge .26s cubic-bezier(.2, .8, .2, 1);
}
@keyframes g2-spawn {
  0%   { transform: scale(.55); opacity: .55; }
  70%  { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes g2-merge {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.11); }
  100% { transform: scale(1); }
}

/* Google-colored tiles */
#g2048-overlay .g2-tile-2    { background: #4285F4; color: #fff; }
#g2048-overlay .g2-tile-4    { background: #EA4335; color: #fff; }
#g2048-overlay .g2-tile-8    { background: #FBBC05; color: #fff; }
#g2048-overlay .g2-tile-16   { background: #34A853; color: #fff; }
#g2048-overlay .g2-tile-32   { background: #1A73E8; color: #fff; }
#g2048-overlay .g2-tile-64   { background: #D93025; color: #fff; }
#g2048-overlay .g2-tile-128  { background: #F9AB00; color: #fff; font-size: 34px; }
#g2048-overlay .g2-tile-256  { background: #0D904F; color: #fff; font-size: 34px; }
#g2048-overlay .g2-tile-512  { background: #4285F4; color: #fff; font-size: 34px; }
#g2048-overlay .g2-tile-1024 { background: #EA4335; color: #fff; font-size: 28px; }
#g2048-overlay .g2-tile-2048 { background: #FBBC05; color: #fff; font-size: 28px; box-shadow: 0 0 20px rgba(251, 188, 5, 0.5); }

#g2048-overlay .g2-overlay-msg {
  position: absolute;
  inset: 0;
  background: rgba(238, 228, 218, 0.73);
  border-radius: 6px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 800;
  color: #776e65;
  z-index: 10;
}

#g2048-overlay .g2-help {
  margin-top: 16px;
  font-size: 13px;
  color: #999;
  text-align: center;
}

@media (max-width: 600px) {
  #g2048-overlay { padding: 60px 12px 20px; }
  #g2048-overlay .g2-title { font-size: 44px; }
  #g2048-overlay .g2-grid { width: 340px; height: 340px; }
  #g2048-overlay .g2-cell,
  #g2048-overlay .g2-tile { width: 80px; height: 80px; }
  #g2048-overlay .g2-cell:nth-child(2), #g2048-overlay .g2-tile { left: auto; }
  /* Simplified responsive positioning */
  #g2048-overlay .g2-cell:nth-child(2)  { left: 88px; }
  #g2048-overlay .g2-cell:nth-child(3)  { left: 176px; }
  #g2048-overlay .g2-cell:nth-child(4)  { left: 264px; }
  #g2048-overlay .g2-cell:nth-child(5)  { top: 88px; }
  #g2048-overlay .g2-cell:nth-child(6)  { top: 88px; left: 88px; }
  #g2048-overlay .g2-cell:nth-child(7)  { top: 88px; left: 176px; }
  #g2048-overlay .g2-cell:nth-child(8)  { top: 88px; left: 264px; }
  #g2048-overlay .g2-cell:nth-child(9)  { top: 176px; }
  #g2048-overlay .g2-cell:nth-child(10) { top: 176px; left: 88px; }
  #g2048-overlay .g2-cell:nth-child(11) { top: 176px; left: 176px; }
  #g2048-overlay .g2-cell:nth-child(12) { top: 176px; left: 264px; }
  #g2048-overlay .g2-cell:nth-child(13) { top: 264px; }
  #g2048-overlay .g2-cell:nth-child(14) { top: 264px; left: 88px; }
  #g2048-overlay .g2-cell:nth-child(15) { top: 264px; left: 176px; }
  #g2048-overlay .g2-cell:nth-child(16) { top: 264px; left: 264px; }
  #g2048-overlay .g2-tile { font-size: 32px; }
}


/* glowing number badge (global timer cycles red/orange/yellow/green/blue) */
.glow-num{display:inline-flex;align-items:center;justify-content:center;min-width:27px;height:27px;padding:0 6px;border-radius:8px;font-family:"Press Start 2P",monospace;font-size:10px;line-height:1;text-shadow:0 0 8px currentColor;}


/* ---------- glassmorphism card / word / number (v28) ---------- */
.glass-card{
  background:rgba(255,255,255,.30)!important;
  border:1px solid rgba(255,255,255,.55)!important;
  -webkit-backdrop-filter:blur(16px) saturate(1.3)!important;
  backdrop-filter:blur(16px) saturate(1.3)!important;
  box-shadow:0 10px 24px rgba(15,23,42,.10), inset 0 1px 0 rgba(255,255,255,.65)!important;
}
.glass-word{
  display:inline-flex; align-items:center; flex-wrap:wrap; gap:2px;
  padding:6px 12px; border-radius:12px;
  background:rgba(255,255,255,.38);
  border:1px solid rgba(255,255,255,.55);
  -webkit-backdrop-filter:blur(10px) saturate(1.2);
  backdrop-filter:blur(10px) saturate(1.2);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.65), 0 2px 8px rgba(15,23,42,.08);
}
.glass-num{
  background:rgba(255,255,255,.38)!important;
  border:1px solid rgba(255,255,255,.55);
  -webkit-backdrop-filter:blur(10px) saturate(1.2);
  backdrop-filter:blur(10px) saturate(1.2);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.65), 0 2px 8px rgba(15,23,42,.10);
}


/* ---------- rainbow title pill (v29) ---------- */
.title-pill{
  display:inline-flex; align-items:center; padding:6px 16px; border-radius:12px;
  background:rgba(255,255,255,.30);
  border:1px solid rgba(255,255,255,.55);
  -webkit-backdrop-filter:blur(16px) saturate(1.3); backdrop-filter:blur(16px) saturate(1.3);
  box-shadow:0 10px 24px rgba(15,23,42,.10), inset 0 1px 0 rgba(255,255,255,.65);
}
.rainbow-title{
  background:linear-gradient(90deg,#ff5a5a,#ffa23a,#ffd23a,#7ee07e,#5ac8ff,#8a7bff,#ff5a5a);
  background-size:320% 100%;
  -webkit-background-clip:text; background-clip:text;
  color:transparent;
  animation:rainbowFlow 5s linear infinite;
  filter:drop-shadow(0 2px 3px rgba(0,10,20,.55));
}
@keyframes rainbowFlow{from{background-position:0 0}to{background-position:320% 0}}

/* ---------- word page language toggle (En / Cn / Cn-En) ---------- */
.lang-toggle{
  position:fixed; top:12px; right:12px; z-index:60;
  display:inline-flex; align-items:center; justify-content:center;
  height:34px; min-width:54px; padding:0 12px;
  border-radius:9999px; border:1px solid rgba(15,23,42,.16);
  background:rgba(255,255,255,.94);
  -webkit-backdrop-filter:blur(10px) saturate(1.2); backdrop-filter:blur(10px) saturate(1.2);
  box-shadow:0 2px 10px rgba(15,23,42,.10), inset 0 1px 0 rgba(255,255,255,.8);
  color:#111827; font-family:'Nunito',system-ui,sans-serif; font-size:13px; font-weight:800;
  letter-spacing:.02em; line-height:1; cursor:pointer; user-select:none;
  transition:transform .15s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.lang-toggle:hover{ transform:translateY(-1px); background:#fff; }
.lang-toggle:active{ transform:scale(.96); }
.lang-toggle[data-mode="cn"]{ color:#0f766e; border-color:rgba(13,148,136,.34); background:rgba(240,253,250,.96); }
.lang-toggle[data-mode="both"]{ color:#6d28d9; border-color:rgba(124,58,237,.32); background:rgba(245,243,255,.96); }
.lang-safe-topbar{ padding-right:92px; }
@media (max-width:640px){
  .lang-toggle{ top:10px; right:10px; height:32px; min-width:48px; padding:0 10px; font-size:12px; }
  .lang-safe-topbar{ padding-right:82px; }
}
/* ---------- stacked bilingual layout / Chinese word subtitle ---------- */
.word-zh{
  display:block; margin:1px 0 4px; max-width:100%;
  font-family:'Nunito',system-ui,sans-serif; font-size:12px; font-weight:700;
  line-height:1.3; color:#475569; overflow-wrap:anywhere; text-align:left;
}
/* keep the coloured English word and its Chinese subtitle in one vertical column */
.word-stack{
  display:inline-flex; flex-direction:column; align-items:flex-start; justify-content:flex-start;
  min-width:0; max-width:100%; vertical-align:top;
}
/* center the coloured word + Chinese subtitle as one vertical column */
.word-stack{
  display:inline-flex; flex-direction:column; align-items:center; justify-content:flex-start;
  min-width:0; max-width:100%; vertical-align:top; margin:0 auto;
}
.word-zh{ text-align:center; }

/* Chinese-only mode: the coloured Chinese translation takes the word slot */
.word-zh-main{
  margin:0; font-family:'Nunito',system-ui,sans-serif;
  font-size:1.15rem; line-height:1.3; font-weight:900; letter-spacing:.01em;
}
@media (max-width:640px){
  .word-zh-main{ font-size:1rem; }
}
