/* Note Doors. Own look: arched "windows" on a colored wall. Theme = CSS variables. */
:root { --font: system-ui, -apple-system, "Segoe UI", sans-serif; --serif: Georgia, "Times New Roman", serif; }
.app[data-theme="pine"]  { --bg1:#1f3a34; --bg2:#0e1f1b; --wall:#2c5248; --door:#f4ead8; --door-ink:#2c5248; --accent:#f2c14e; --hot:#e4572e; }
.app[data-theme="snow"]  { --bg1:#2a4c75; --bg2:#13243b; --wall:#3c6597; --door:#f3f7fb; --door-ink:#2a4c75; --accent:#bfe3ff; --hot:#ff7a59; }
.app[data-theme="ember"] { --bg1:#5a1f24; --bg2:#2a0d10; --wall:#7a2c31; --door:#fbead6; --door-ink:#7a2c31; --accent:#ffb347; --hot:#ffd166; }
.app[data-theme="rose"]  { --bg1:#7b1e3a; --bg2:#3a0b1b; --wall:#9b2d4f; --door:#ffe9ef; --door-ink:#9b2d4f; --accent:#ffc2d1; --hot:#ff4d6d; }
.app[data-theme="blush"] { --bg1:#c2577a; --bg2:#6d2440; --wall:#d97a98; --door:#fff4f7; --door-ink:#a33c60; --accent:#fff0a8; --hot:#7b1e3a; }
.app[data-theme="night"] { --bg1:#2b1d4a; --bg2:#120b24; --wall:#40306b; --door:#efe8ff; --door-ink:#40306b; --accent:#ff8fab; --hot:#ffd6e0; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: #0e1f1b; color: #1b1b1b; line-height: 1.45; overflow-x: hidden; }
body.locked { overflow: hidden; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 6px; z-index: 99; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #0e1f1b; color: #fff; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-family: var(--serif); font-size: 20px; }
.logo { color: #f2c14e; }

.app { background: linear-gradient(180deg, var(--bg1), var(--bg2)); color: #fff; padding: 16px 16px 28px; min-height: 70vh; }
.banner { max-width: 640px; margin: 0 auto 12px; text-align: center; }
.banner h1 { font-family: var(--serif); font-size: clamp(24px, 6vw, 34px); margin: 4px 0; }
.banner .sub { margin: 4px 0 8px; opacity: .92; }
.count { font-size: 14px; opacity: .85; margin: 4px 0 0; }
.lights { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; margin: 6px auto; max-width: 420px; }
.lights i { width: 10px; height: 14px; border-radius: 50% 50% 45% 45%; background: rgba(255,255,255,.18); }
.lights i.on { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* the wall of doors */
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; max-width: 520px; margin: 0 auto 16px; padding: 10px; background: var(--wall); border-radius: 18px; box-shadow: inset 0 0 0 3px rgba(255,255,255,.08); }
.grid[data-doors="14"] { grid-template-columns: repeat(7, 1fr); }
.door { position: relative; aspect-ratio: 3 / 4; border: 0; border-radius: 999px 999px 10px 10px; background: var(--door); color: var(--door-ink); font: 700 clamp(15px, 4.2vw, 22px) var(--serif); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px; overflow: hidden; transition: transform .12s; }
.door:active { transform: scale(.96); }
.door:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.door.empty { background: transparent; color: rgba(255,255,255,.75); border: 2px dashed rgba(255,255,255,.45); }
.door .num { line-height: 1; }
.door .stk { font-size: clamp(16px, 4.5vw, 22px); line-height: 1.1; }
.door .who { font: 600 9px var(--font); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.door.filled .num { font-size: 11px; position: absolute; top: 6px; }
.door.filled .stk { margin-top: 12px; }
.door.today { box-shadow: 0 0 0 3px var(--accent), 0 0 16px var(--accent); }
.door.open.filled { background: #fff; }
.door.mine { outline: 2px solid var(--accent); outline-offset: -2px; }
.door.mine::after { content: ""; position: absolute; bottom: 3px; right: 6px; font: 600 9px var(--font); opacity: .7; }
.door.w-gold { background: linear-gradient(135deg, #f8e08e, #c9962b 60%, #f8e08e); }
.door.w-frost { background: linear-gradient(135deg, #e8f6ff, #a8d8f0); }
.door.w-aurora { background: linear-gradient(135deg, #1b2a4a, #2bb39a 50%, #8a5cf6); color: #fff; }

/* panels and controls */
.panel { max-width: 520px; margin: 0 auto; display: grid; gap: 10px; }
.card { background: rgba(255,255,255,.96); color: #1b1b1b; border-radius: 14px; padding: 14px; }
.card.warn { border: 2px solid var(--hot); }
.card.code.big { outline: 3px solid var(--accent); }
.codeText { font: 700 26px ui-monospace, Menlo, monospace; letter-spacing: 2px; margin: 6px 0; word-break: break-all; }
label { display: block; font-weight: 600; margin: 10px 0 4px; }
input:not([type=radio]):not([type=checkbox]), textarea, select { width: 100%; font: 16px var(--font); padding: 10px 12px; border: 1.5px solid #c9c2b6; border-radius: 10px; background: #fff; color: #1b1b1b; }
textarea { resize: vertical; background: repeating-linear-gradient(#fff 0 27px, #ece6da 27px 28px); line-height: 28px; }
.chips { border: 0; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips legend { font-weight: 600; margin-bottom: 4px; }
.chips label { margin: 0; font-weight: 500; }
.chips input { position: absolute; opacity: 0; }
.chips span { display: inline-block; padding: 8px 12px; border: 1.5px solid #c9c2b6; border-radius: 999px; background: #fff; cursor: pointer; }
.chips input:checked + span { border-color: var(--hot); background: #fff4ec; box-shadow: 0 0 0 2px var(--hot) inset; }
.chips input:focus-visible + span { outline: 3px solid var(--accent); }
.stickers span { font-size: 22px; padding: 4px 10px; }
.check { font-weight: 500; display: flex; gap: 8px; align-items: center; }
.ideas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font: 13px var(--font); border: 1px solid #c9c2b6; background: #faf7f1; border-radius: 999px; padding: 6px 10px; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 15px var(--font); padding: 11px 14px; border-radius: 12px; border: 1.5px solid #c9c2b6; background: #fff; color: #1b1b1b; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn.primary { background: var(--hot, #e4572e); border-color: transparent; color: #fff; font-size: 17px; }
.btn.danger { color: #b3261e; border-color: #e6b1ad; }
.btn.ghost { background: transparent; color: inherit; border-color: rgba(255,255,255,.5); }
.card .btn.ghost { color: #1b1b1b; border-color: #c9c2b6; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn:disabled { opacity: .6; }
.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 10px; padding: 6px 10px; font: 600 14px var(--font); cursor: pointer; }
.link { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 6px; }
.hint { font-size: 14px; opacity: .85; margin: 6px 0; }
.center { text-align: center; }
.share .row, .row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.share .row .btn { flex: 1 1 30%; font-size: 14px; padding: 10px 8px; }

/* bottom sheet */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.sheet[hidden] { display: none; }
.sheet-card { position: relative; background: #fffdf8; color: #1b1b1b; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px 16px 24px; }
.sheet-card h2 { font-family: var(--serif); margin: 0 32px 8px 0; font-size: 22px; }
.x { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 28px; cursor: pointer; width: 44px; height: 44px; }
.note { border: 1px solid #e3dccf; border-radius: 12px; padding: 12px; margin: 8px 0; background: #fff; white-space: pre-wrap; word-wrap: break-word; }
.note .from { margin: 0 0 4px; }
.nw-gold { background: linear-gradient(135deg, #fff6d6, #f3d98b); }
.nw-frost { background: linear-gradient(135deg, #f2fbff, #d3ecfa); }
.nw-aurora { background: linear-gradient(135deg, #e9e4ff, #c9f5ea); }
.copybox { font-size: 14px; }
img.story { width: 100%; height: auto; border-radius: 12px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #1b1b1b; color: #fff; padding: 12px 16px; border-radius: 12px; max-width: calc(100% - 32px); z-index: 60; box-shadow: 0 6px 20px rgba(0,0,0,.3); }

/* door-opening effect */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.fx i { position: absolute; left: calc(var(--i) * 4.1%); top: -20px; width: 10px; height: 10px; border-radius: 50%; background: #ffd166; animation: fall 1.6s ease-in forwards; animation-delay: calc(var(--i) * 25ms); }
.fx-frost i { background: #dff3ff; } .fx-aurora i { background: #8a5cf6; } .fx-classic i { background: #ff8fab; }
@keyframes fall { to { transform: translateY(105vh) rotate(240deg); opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .fx { display: none; } .door { transition: none; } }

/* content below the app */
.seo { max-width: 640px; margin: 0 auto; padding: 24px 16px; background: #fffdf8; color: #1b1b1b; }
.seo h2 { font-family: var(--serif); }
.steps li { margin: 6px 0; }
details { margin: 8px 0; } summary { cursor: pointer; font-weight: 600; }
.foot { text-align: center; padding: 18px 16px; background: #0e1f1b; color: #cfd8d4; font-size: 14px; }
.foot a { color: #f2c14e; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 420px); justify-content: center; column-gap: 28px; align-items: start; }
  .banner { grid-column: 1 / -1; }
  .grid { margin: 0; width: 100%; }
  .panel { margin: 0; }
  .sheet { align-items: center; }
  .sheet-card { border-radius: 18px; }
}
