:root {
  --bg: #0b0f0c;
  --fg: #c8d3c5;
  --green: #39ff7a;
  --dgreen: #1f7a3e;
  --red: #ff4d5e;
  --amber: #ffcc4d;
  --blue: #5ecbff;
  --dim: #5f6f63;
  --line: #1d2a21;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--mono); }
body { min-height: 100vh; overflow-x: hidden; }
::selection { background: var(--green); color: #000; }

#snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.crt { position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply; }
.crt::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,.55) 100%); }

#app { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; margin-bottom: 18px; }
#logo { margin: 0; font-size: clamp(24px, 4.4vw, 44px); font-weight: 700; letter-spacing: .02em; line-height: 1.15; }
#logo::before { content: "> "; color: var(--dim); }
#logo::after { content: "█"; margin-left: .15em; animation: blink 1s steps(1) infinite; font-size: .8em; }
#statusline { font-size: 13px; text-align: right; }

.green { color: var(--green); } .red { color: var(--red); } .amber { color: var(--amber); }
.blue { color: var(--blue); } .dim { color: var(--dim); }
.glow { text-shadow: 0 0 6px rgba(57,255,122,.6), 0 0 18px rgba(57,255,122,.25); }

.term { white-space: pre-wrap; word-break: break-word; }
#boot { min-height: 50vh; }
.cursor::after { content: "█"; animation: blink 1s steps(1) infinite; color: var(--green); }
@keyframes blink { 50% { opacity: 0; } }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px; align-items: center; }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } }

/* choinka */
#tree { margin: 0 auto; width: max-content; max-width: 100%; font-size: 18px; line-height: 1.14; position: relative; text-align: left; color: var(--dgreen); user-select: none; }
#tree .star { color: var(--amber); text-shadow: 0 0 10px var(--amber); animation: twinkle 2.4s ease-in-out infinite; }
#tree .trunk { color: #8a5a2b; }
#tree .orn { color: #2a3a2e; }
#tree .orn.ready { color: var(--fg); animation: blink 1.2s steps(1) infinite; cursor: pointer; }
#tree .orn.on { animation: lights 3s ease-in-out infinite; text-shadow: 0 0 8px currentColor; cursor: pointer; }
#tree .orn.c0 { color: var(--red); } #tree .orn.c1 { color: var(--amber); } #tree .orn.c2 { color: var(--blue); } #tree .orn.c3 { color: #ff8cf0; }
#tree .gift { color: var(--red); } #tree .gift.g2 { color: var(--blue); } #tree .gift.g3 { color: var(--amber); }
/* lampki */
#tree .light { animation: bulb 1.6s ease-in-out infinite; }
#tree .light.l0 { color: #ff4d5e; text-shadow: 0 0 6px #ff4d5e, 0 0 14px #ff4d5e; }
#tree .light.l1 { color: #ffcc4d; text-shadow: 0 0 6px #ffcc4d, 0 0 14px #ffcc4d; }
#tree .light.l2 { color: #5ecbff; text-shadow: 0 0 6px #5ecbff, 0 0 14px #5ecbff; }
#tree .light.l3 { color: #ff8cf0; text-shadow: 0 0 6px #ff8cf0, 0 0 14px #ff8cf0; }
#tree .light.l4 { color: #b6ff6a; text-shadow: 0 0 6px #b6ff6a, 0 0 14px #b6ff6a; }
@keyframes bulb { 0%, 100% { opacity: 1; } 50% { opacity: .25; text-shadow: none; } }
/* gwiazda na czubku = dzień 24 */
#tree .topstar { position: relative; display: inline-block; width: 1ch; color: transparent; cursor: default; }
#tree .topstar::before { content: "★"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -58%); font-size: 66px; line-height: 1; color: #3b3622; }
#tree .topstar.ready { cursor: pointer; }
#tree .topstar.ready::before { color: var(--amber); animation: twinkle 1.4s ease-in-out infinite; text-shadow: 0 0 18px rgba(255,204,77,.7); }
#tree .topstar.on { cursor: pointer; }
#tree .topstar.on::before { content: ""; width: 96px; height: 92px; background: linear-gradient(135deg, #fff4c2, #ffcc4d 40%, #c98a12);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  filter: drop-shadow(0 0 12px #ffcc4d); transform: translate(-50%, -60%); }
#tree .topstar.on i { position: absolute; left: 50%; top: 50%; width: 80px; height: 77px; transform: translate(-50%, -61%); z-index: 2;
  background: #222 center / cover no-repeat;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
#tree .topstar.on { animation: starglow 2.5s ease-in-out infinite; }
#tree .topstar.pop::before { animation: starpopA 1.1s cubic-bezier(.2,1.6,.4,1) both; }
#tree .topstar.pop i { animation: starpopB 1.1s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes starpopA { from { transform: translate(-50%, -60%) scale(0) rotate(-180deg); } to { transform: translate(-50%, -60%) scale(1) rotate(0); } }
@keyframes starpopB { from { transform: translate(-50%, -61%) scale(0) rotate(-180deg); } to { transform: translate(-50%, -61%) scale(1) rotate(0); } }
@keyframes starglow { 50% { filter: drop-shadow(0 0 18px #ffcc4d) brightness(1.15); } }
#tree .orn { position: relative; }
#tree .orn:has(.bauble) { color: transparent; text-shadow: none; animation: none; }
.bauble { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  background: #222 center / cover no-repeat; border: 2px solid currentColor; z-index: 2; transition: transform .25s, box-shadow .25s;
  box-shadow: 0 0 10px var(--glow, rgba(255,255,255,.35)), 0 3px 6px rgba(0,0,0,.6); }
.bauble::before { content: ""; position: absolute; left: 50%; top: -7px; width: 8px; height: 6px; margin-left: -4px; background: #c9a24a; border-radius: 2px 2px 0 0; }
.bauble::after { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.75) 0 7%, rgba(255,255,255,.18) 18%, transparent 42%),
              radial-gradient(circle at 50% 50%, transparent 55%, rgba(0,0,0,.45) 100%); }
#tree .orn.c0 .bauble { border-color: var(--red); --glow: rgba(255,77,94,.55); }
#tree .orn.c1 .bauble { border-color: var(--amber); --glow: rgba(255,204,77,.55); }
#tree .orn.c2 .bauble { border-color: var(--blue); --glow: rgba(94,203,255,.55); }
#tree .orn.c3 .bauble { border-color: #ff8cf0; --glow: rgba(255,140,240,.55); }
.bauble { animation: sway 4s ease-in-out infinite; transform-origin: 50% -6px; }
#tree .orn:nth-child(odd) .bauble { animation-delay: -2s; }
#tree .orn:hover .bauble { transform: scale(3); z-index: 10; animation: none; }
.bauble.pop { animation: pop .9s cubic-bezier(.2,1.6,.4,1) both, sway 4s ease-in-out .9s infinite; }
@keyframes sway { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes pop { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1) rotate(0); } }
@keyframes twinkle { 50% { opacity: .55; } }
@keyframes lights { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
#progress { text-align: center; margin-top: 10px; font-size: 13px; }
#tree-wrap { overflow: hidden; }

/* kalendarz */
.prompt-line { color: var(--fg); }
.user { color: var(--green); } .path { color: var(--blue); }
#grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 12px 0 14px; }
@media (max-width: 480px) { #grid { grid-template-columns: repeat(4, 1fr); } }
.box { font: inherit; background: transparent; border: 1px solid var(--line); color: var(--dim); padding: 10px 0 8px; cursor: not-allowed;
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: .15s; position: relative; }
.box .n { font-size: 18px; } .box .s { font-size: 11px; }
.box.ready { border-color: var(--green); color: var(--green); cursor: pointer; box-shadow: 0 0 12px rgba(57,255,122,.25) inset; animation: pulse 2s ease-in-out infinite; }
.box.ready:hover, .box.open:hover { background: rgba(57,255,122,.08); }
.box.open { border-color: var(--dgreen); color: var(--fg); cursor: pointer; }
.box.open .s { color: var(--green); }
.box.today::before { content: "NEW"; position: absolute; top: -8px; right: -6px; background: var(--red); color: #fff; font-size: 9px; padding: 0 4px; }
@keyframes pulse { 50% { box-shadow: 0 0 18px rgba(57,255,122,.5) inset; } }
#countdown { margin-bottom: 14px; font-size: 13px; }

.btn { font: inherit; background: transparent; color: var(--green); border: 1px solid var(--green); padding: 6px 14px; cursor: pointer; }
.btn:hover:not(:disabled) { background: var(--green); color: #000; }
.btn:disabled { color: var(--dim); border-color: var(--line); cursor: not-allowed; }
.btn.ghost { color: var(--dim); border-color: var(--line); }
.btn.big { width: 100%; padding: 12px; font-size: 16px; }

#shell { margin-top: 36px; border-top: 1px dashed var(--line); padding-top: 14px; }
#out div { margin: 2px 0; }
.input-line { display: flex; align-items: center; }
#cmd { flex: 1; background: transparent; border: 0; outline: 0; color: var(--fg); font: inherit; caret-color: var(--green); padding: 0; }

/* okna */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.78); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.window { width: min(760px, 100%); max-height: 94vh; overflow: auto; background: #0d130f; border: 1px solid var(--dgreen); box-shadow: 0 0 40px rgba(57,255,122,.15); }
.titlebar { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--line); color: var(--dim); font-size: 13px; position: sticky; top: 0; background: #0d130f; }
.dots i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; background: var(--red); }
.dots i:nth-child(2) { background: var(--amber); } .dots i:nth-child(3) { background: var(--green); }
.titlebar span:nth-child(2) { flex: 1; }
.x { background: none; border: 0; color: var(--dim); font: inherit; cursor: pointer; }
.window-body { padding: 18px 20px 20px; }
#pzHead { margin: 0 0 14px; font-size: 13px; }
#pzQ { font-size: 18px; margin: 0 0 12px; }
.code { margin: 0 0 16px; padding: 14px 16px; background: #050806; border: 1px solid var(--line); border-left: 3px solid var(--green);
  color: #e6edf3; font-size: 16px; white-space: pre-wrap; word-break: break-all; }
.pz-form { display: flex; align-items: center; gap: 10px; border: 1px solid var(--dgreen); padding: 8px 10px; }
.pz-form input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--fg); font: inherit; font-size: 16px; caret-color: var(--green); min-width: 0; }
#pzOut { min-height: 1.5em; margin: 12px 0; white-space: pre-wrap; }
#unpack { margin: 0; white-space: pre-wrap; font-size: 13px; }
.frame { border: 1px solid var(--line); background: #000; aspect-ratio: 4 / 3; overflow: hidden; }
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
#dayTitle { margin: 16px 0 6px; font-size: 20px; font-weight: normal; }
#dayTitle::before { content: "# "; color: var(--dim); }
#dayMsg { white-space: pre-wrap; margin: 0 0 12px; }
#dayAppend { margin: 0 0 14px; font-size: 13px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }


@media (max-width: 520px) { #tree { font-size: 11px; } #tree .topstar::before { font-size: 44px; } #tree .topstar.on::before { width: 66px; height: 63px; } #tree .topstar.on i { width: 55px; height: 53px; } .bauble { width: 23px; height: 23px; margin: -11.5px 0 0 -11.5px; } .bauble::before { top: -5px; width: 6px; height: 4px; margin-left: -3px; } }
