:root { --green: #14532d; --red: #b91c1c; --gold: #e3b93c; --cream: #fffaf0; --night: #0b1d3a; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: #0f3d2a; }
body.xmas { margin: 0; min-height: 100vh; color: var(--cream); font-family: Georgia, "Times New Roman", serif; line-height: 1.55;
  background: linear-gradient(180deg, var(--night) 0%, #10335a 45%, #0f3d2a 100%) fixed; }
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
a { color: var(--gold); }
.xm-header, .xm-main, .xm-footer { position: relative; z-index: 2; }
.xm-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; padding: 1rem 1.4rem; background: rgba(0,0,0,.25); border-bottom: 3px solid var(--gold); }
.xm-brand { color: var(--cream); font-size: 1.4rem; font-weight: 700; text-decoration: none; }
.xm-nav a { margin-left: 1.2rem; text-decoration: none; font-weight: 700; }
.xm-main { max-width: 920px; margin: 0 auto; padding: 1rem; }
.xm-hero { text-align: center; padding: 3rem 1rem 2rem; }
.xm-hero h1 { font-size: clamp(2.2rem, 7vw, 4rem); margin: 0; line-height: 1.1; text-shadow: 0 3px 10px rgba(0,0,0,.5); }
.xm-hero h1 span { display: block; font-size: .5em; color: var(--gold); margin-top: .3em; }
.xm-count { display: inline-block; margin-top: 1.2rem; padding: .5rem 1.2rem; border: 2px dashed var(--gold); border-radius: 999px; font-size: 1.15rem; }
.xm-panel { background: rgba(255,250,240,.96); color: #2b2b2b; border-radius: 16px; padding: 1.6rem; margin: 1.6rem 0; border-top: 6px solid var(--red); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.xm-panel h2 { margin-top: 0; color: var(--green); }
.xm-panel h1 { color: var(--red); }
.xm-santa { border-top-color: var(--gold); background: linear-gradient(135deg, #fffaf0, #fdf1d6); }
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.tabs button { font: inherit; padding: .5rem 1rem; border: 2px solid var(--green); background: #fff; color: var(--green); border-radius: 999px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--green); color: #fff; }
.btn, .big-btn { font: inherit; background: var(--red); color: #fff; border: 0; border-radius: 999px; padding: .55rem 1.2rem; cursor: pointer; box-shadow: 0 3px 0 #7f1d1d; }
.btn.alt { background: var(--green); box-shadow: 0 3px 0 #052e16; }
.btn:hover, .big-btn:hover { filter: brightness(1.1); }
.stats { font-size: 1.1rem; margin: .2rem 0; }
.hint { color: #555; margin: .3rem 0 .8rem; }
.msg { min-height: 1.6em; font-weight: 700; color: var(--green); }
.canvas-wrap { position: relative; max-width: 480px; margin: 0 auto; }
#catch-canvas { width: 100%; height: auto; border-radius: 12px; border: 3px solid var(--gold); touch-action: none; display: block; background: #0b1d3a; }
.big-btn { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); font-size: 1.4rem; padding: .8rem 2rem; }
.big-btn[hidden] { display: none; }
.memory { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; max-width: 420px; margin: .8rem auto; }
.mcard { aspect-ratio: 1; border: 3px solid var(--green); border-radius: 12px; background: var(--red); font-size: 2.2rem; cursor: pointer; position: relative; padding: 0; color: #fff; }
.mcard .mface { display: none; }
.mcard.up, .mcard.done { background: #fff; }
.mcard.up .mback, .mcard.done .mback { display: none; }
.mcard.up .mface, .mcard.done .mface { display: inline; }
.mcard.done { border-color: var(--gold); opacity: .8; }
.scr-word { font-size: clamp(1.8rem, 8vw, 3rem); letter-spacing: .15em; color: var(--red); font-weight: 700; text-align: center; margin: 1rem 0; }
#scr-input { font: inherit; font-size: 1.2rem; padding: .5rem .8rem; border: 2px solid var(--gold); border-radius: 8px; text-transform: uppercase; max-width: 100%; }
.joke { min-height: 6rem; text-align: center; font-size: 1.3rem; margin: .8rem 0; }
#joke-q { font-weight: 700; color: var(--green); }
#joke-a { color: var(--red); font-style: italic; }
.xm-footer { text-align: center; padding: 2rem 1rem 3rem; color: var(--cream); }
.xm-tiny { font-size: .8rem; opacity: .7; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
