@import url('../fonts/fonts.css');

/* ------------------------------------------------------------------ HDO GAMES — shared */
:root {
  --bg: #050303;
  --ink: #efe6dc;
  --dim: #8d8077;
  --red: #e0241b;
  --blood: #7a0a06;
  --gold: #d9a640;
  --glow: rgba(224, 36, 27, .55);
  --f-title: 'Rubik Wet Paint', 'Rubik Glitch', 'Karantina', sans-serif;
  --f-glitch: 'Rubik Glitch', 'Karantina', sans-serif;
  --f-body: 'Karantina', 'Arial Hebrew', sans-serif;
  --f-mono: 'Courier New', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: clamp(19px, 1.35vw, 24px); line-height: 1.35;
  direction: rtl; overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { background: var(--red); color: #000; }

/* film grain, scanlines, vignette — over everything, never in the way */
.fx-noise, .fx-scan, .fx-vig, .fx-track { position: fixed; inset: 0; pointer-events: none; z-index: 900; }
.fx-noise { width: 100%; height: 100%; opacity: .055; mix-blend-mode: screen; image-rendering: pixelated; }
.fx-scan { background: repeating-linear-gradient(0deg, rgba(0,0,0,.28) 0 1px, transparent 1px 3px); opacity: .55; }
.fx-vig { background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.78) 100%); }
.fx-track { height: 14vh; inset: auto 0 auto 0; top: -20vh; background: linear-gradient(180deg, transparent, rgba(255,255,255,.07) 40%, rgba(255,255,255,.16) 50%, rgba(255,255,255,.05) 60%, transparent); filter: blur(1px); mix-blend-mode: screen; }
.fx-track.run { animation: track 1.4s linear; }
@keyframes track { from { top: -20vh; } to { top: 110vh; } }
.fx-flash { position: fixed; inset: 0; z-index: 950; pointer-events: none; display: none; background: #000 center/cover no-repeat; mix-blend-mode: normal; }
.fx-flash.on { display: block; animation: flashjit .12s steps(2) infinite; }
@keyframes flashjit { 0% { transform: translate(-1.5%, .5%) scale(1.06); filter: contrast(1.8) saturate(.2) hue-rotate(-20deg); } 100% { transform: translate(1.5%, -.5%) scale(1.1); filter: contrast(2.2) saturate(1.6); } }
body.shake { animation: shake .35s linear; }
@keyframes shake { 0%,100% { transform: none; } 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -4px); } 60% { transform: translate(-3px, -2px); } 80% { transform: translate(4px, 3px); } }

/* top bar: the VHS on-screen display */
.osd { position: fixed; top: 0; left: 0; right: 0; z-index: 800; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px clamp(16px, 3vw, 40px); font: 700 clamp(14px, 1.2vw, 20px) var(--f-mono); letter-spacing: .08em; color: #f2f2f2; text-shadow: 0 0 6px rgba(0,0,0,.9), 2px 0 rgba(255,0,0,.35), -2px 0 rgba(0,200,255,.3); direction: ltr; pointer-events: none; }
.osd a, .osd button { pointer-events: auto; }
.osd .l, .osd .r { display: flex; gap: 18px; align-items: center; }
.osd .rec { color: #ff2a2a; }
.osd .rec::before { content: '●'; margin-right: 6px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.osd .home { text-decoration: none; border: 1px solid rgba(255,255,255,.35); padding: 3px 10px; background: rgba(0,0,0,.35); }
.osd .home:hover { background: var(--red); color: #000; border-color: var(--red); }
.snd { background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.35); padding: 3px 10px; cursor: pointer; font: inherit; letter-spacing: inherit; }
.snd[aria-pressed="false"] { opacity: .55; text-decoration: line-through; }

/* glitch text: two offset copies */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after { content: attr(data-t); position: absolute; inset: 0; pointer-events: none; }
.glitch::before { color: #00e5ff; transform: translate(3px, 0); mix-blend-mode: screen; opacity: .55; clip-path: inset(0 0 60% 0); animation: gl1 3.2s infinite steps(1); }
.glitch::after { color: #ff1a1a; transform: translate(-3px, 0); mix-blend-mode: screen; opacity: .6; clip-path: inset(55% 0 0 0); animation: gl2 2.7s infinite steps(1); }
@keyframes gl1 { 0%, 92% { transform: translate(3px,0); clip-path: inset(0 0 60% 0); } 93% { transform: translate(-9px, 2px); clip-path: inset(20% 0 40% 0); } 96% { transform: translate(7px,-2px); clip-path: inset(70% 0 5% 0); } }
@keyframes gl2 { 0%, 88% { transform: translate(-3px,0); clip-path: inset(55% 0 0 0); } 90% { transform: translate(10px, 1px); clip-path: inset(10% 0 70% 0); } 94% { transform: translate(-6px,0); clip-path: inset(40% 0 30% 0); } }

/* page transition: static wipe */
.wipe { position: fixed; inset: 0; z-index: 990; pointer-events: none; background: #000; opacity: 0; }
.wipe canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.wipe.in { opacity: 1; transition: opacity .18s; pointer-events: auto; }

/* download button (shared) */
.dl { position: relative; display: inline-flex; align-items: center; gap: 16px; padding: 18px 34px 16px; border: 2px solid var(--red); background: linear-gradient(180deg, #2a0503, #120201); color: #fff; font: 700 clamp(26px, 2.4vw, 40px) var(--f-body); letter-spacing: .04em; text-decoration: none; cursor: pointer; box-shadow: 0 0 0 1px #000, 0 0 30px var(--glow), inset 0 0 24px rgba(224,36,27,.35); transition: transform .12s, box-shadow .2s; }
.dl small { font: 700 .5em var(--f-mono); color: #ff9c90; letter-spacing: .1em; direction: ltr; }
.dl:hover { transform: translate(var(--jx, 0), var(--jy, 0)) scale(1.03); box-shadow: 0 0 0 1px #000, 0 0 60px rgba(255,40,20,.85), inset 0 0 30px rgba(255,60,40,.5); }
.dl:active { transform: scale(.98); }
.dl.locked { border-color: #555; background: #0b0b0b; color: #888; box-shadow: none; cursor: not-allowed; }
.dl.locked small { color: #777; }
.dl .ico { width: 1.1em; height: 1.1em; flex: none; }
.dl-note { margin-top: 12px; font-size: .85em; color: var(--dim); }

/* section headings */
.sec { position: relative; padding: clamp(70px, 10vw, 140px) clamp(16px, 5vw, 80px); max-width: 1400px; margin: 0 auto; }
.sec h2 { margin: 0 0 28px; font: 400 clamp(44px, 6vw, 96px)/1 var(--f-title); color: var(--ink); letter-spacing: .01em; }
.sec h2 em { font-style: normal; color: var(--red); }
.kicker { font: 700 clamp(14px, 1.1vw, 18px) var(--f-mono); letter-spacing: .3em; color: var(--red); direction: ltr; text-align: right; margin-bottom: 10px; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 970; background: rgba(0,0,0,.92); display: none; align-items: center; justify-content: center; padding: 4vw; cursor: zoom-out; }
.lb.on { display: flex; }
.lb img, .lb video { max-width: 100%; max-height: 86vh; box-shadow: 0 0 80px rgba(224,36,27,.35); }
.lb .cap { position: absolute; bottom: 3vh; left: 0; right: 0; text-align: center; font: 700 20px var(--f-mono); letter-spacing: .2em; color: #ddd; direction: ltr; }

/* features row */
.feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 30px; }
.feat { border: 1px solid rgba(255,255,255,.12); background: rgba(10,4,3,.6); padding: 20px 22px; }
.feat b { display: block; font: 400 clamp(30px, 2.6vw, 44px)/1 var(--f-title); color: var(--red); margin-bottom: 8px; }
.feat span { color: #cfc3b8; }

/* footer */
.foot { padding: 50px 20px 70px; text-align: center; color: var(--dim); font-size: .85em; border-top: 1px solid rgba(255,255,255,.07); }
.foot a { color: #cbbfb3; margin: 0 10px; }
.foot .warn { font: 700 13px var(--f-mono); letter-spacing: .2em; color: #6d1a14; margin-top: 16px; direction: ltr; }

/* countdown */
.cd { display: flex; gap: clamp(8px, 1.6vw, 22px); direction: ltr; justify-content: center; }
.cd .u { min-width: clamp(64px, 8vw, 128px); text-align: center; border: 1px solid rgba(224,36,27,.45); background: rgba(20,2,1,.75); padding: 10px 6px 6px; box-shadow: inset 0 0 22px rgba(224,36,27,.25); }
.cd .n { font: 700 clamp(40px, 6vw, 92px)/1 var(--f-mono); color: #ff3b2e; text-shadow: 0 0 18px rgba(255,40,20,.7); font-variant-numeric: tabular-nums; }
.cd .t { font: 400 clamp(19px, 1.5vw, 26px) var(--f-body); color: #c9b9ad; direction: rtl; }
.cd .sep { align-self: center; font: 700 clamp(30px, 4vw, 64px) var(--f-mono); color: #6e130d; animation: blink 1s steps(1) infinite; }

@media (prefers-reduced-motion: reduce) {
  .glitch::before, .glitch::after, .fx-track.run, .fx-flash.on, body.shake { animation: none !important; }
}
@media (max-width: 640px) {
  .osd { padding: 10px 16px; font-size: 12px; }
  .osd .l, .osd .r { gap: 10px; }
  .osd .hide-m { display: none; }
  .dl { padding: 14px 22px 12px; gap: 10px; }
}

/* ------------------------------------------------------------------ nav between the games (creep.js) */
.gnav { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 805; display: flex; gap: 4px; padding: 4px; background: rgba(6,3,3,.72); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(6px); max-width: calc(100vw - 32px); overflow-x: auto; scrollbar-width: none; }
.gnav::-webkit-scrollbar { display: none; }
.gnav a, .gnav button { flex: none; padding: 5px 14px 3px; font: 400 clamp(17px, 1.25vw, 21px) var(--f-body); color: #cdbfb4; text-decoration: none; background: none; border: 0; cursor: pointer; white-space: nowrap; }
.gnav a:hover, .gnav button:hover { color: #fff; background: rgba(255,255,255,.07); }
.gnav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--red); }
.gnav .help-btn { color: #ffb3aa; border-right: 1px solid rgba(255,255,255,.12); }
@media (max-width: 980px) { .gnav { top: 46px; } }

/* how to install */
.help { position: fixed; inset: 0; z-index: 972; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.86); }
.help.on { display: flex; }
.help-box { position: relative; width: min(760px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: #0d0605; border: 1px solid var(--red); box-shadow: 0 0 60px rgba(224,36,27,.35); padding: clamp(22px, 3vw, 38px); }
.help-box h3 { margin: 0 0 14px; font: 400 clamp(36px, 4vw, 58px)/1 var(--f-title); color: #fff; }
.help-box .steps { margin: 0; padding: 0 22px 0 0; display: grid; gap: 10px; color: #e3d6cb; }
.help-box .steps b, .help-box .fix b { color: #fff; }
.help-box .fix { margin: 0; padding: 0 22px 0 0; color: #cbbcb0; display: grid; gap: 6px; }
.help-box .help-more { margin: 20px 0 0; color: var(--dim); }
.help-x { position: absolute; top: 12px; left: 12px; background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; font: 700 18px var(--f-mono); width: 40px; height: 40px; cursor: pointer; }
.help-x:hover { background: var(--red); border-color: var(--red); color: #000; }

/* phones */
.phone-note { margin-top: 10px; font-size: .85em; color: #d8c8bd; }
.phone-note button { margin-top: 6px; display: inline-block; background: none; border: 1px solid rgba(255,255,255,.35); color: #fff; padding: 6px 12px 4px; font: inherit; cursor: pointer; }

/* the dot that follows you */
.ghost-dot { position: fixed; left: 0; top: 0; z-index: 940; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #ff2a1a; box-shadow: 0 0 14px #ff2a1a, 0 0 4px #fff; pointer-events: none; mix-blend-mode: screen; opacity: .75; }

/* hands on the glass */
.hand { position: fixed; z-index: 930; width: 54px; height: 64px; margin: -32px 0 0 -27px; pointer-events: none; transform: rotate(var(--rot, 0deg)) scale(.6); opacity: 0; animation: hand 4.2s ease-out forwards; }
.hand svg { width: 100%; height: 100%; fill: rgba(150,8,4,.78); filter: drop-shadow(0 0 4px rgba(255,20,10,.4)); }
@keyframes hand { 0% { opacity: 0; transform: rotate(var(--rot)) scale(.6); } 6% { opacity: .9; transform: rotate(var(--rot)) scale(1); } 60% { opacity: .7; } 100% { opacity: 0; transform: rotate(var(--rot)) scale(1) translateY(16px); } }

/* headings that change their mind */
.swap { color: var(--red) !important; text-shadow: 3px 0 #00e5ff, -3px 0 #ff1a1a !important; letter-spacing: .03em; }

/* the face at the edge */
.peek { position: fixed; z-index: 925; width: clamp(140px, 16vw, 240px); aspect-ratio: 1; background: #000 center/cover no-repeat; pointer-events: none; filter: grayscale(.4) contrast(1.4) brightness(.75); -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 38%, transparent 70%); mask-image: radial-gradient(circle at 50% 50%, #000 38%, transparent 70%); transition: transform 1.4s cubic-bezier(.2,.7,.2,1); }
.peek.fast { transition-duration: .12s; }
.peek.l { left: 0; top: var(--pos); transform: translateX(-100%); }
.peek.r { right: 0; top: var(--pos); transform: translateX(100%) scaleX(-1); }
.peek.b { bottom: 0; left: var(--pos); transform: translateY(100%); }
.peek.l.in { transform: translateX(-38%); }
.peek.r.in { transform: translateX(38%) scaleX(-1); }
.peek.b.in { transform: translateY(42%); }

/* idle */
.idle { position: fixed; inset: 0; z-index: 945; display: flex; align-items: center; justify-content: center; pointer-events: none; background: radial-gradient(ellipse at center, rgba(0,0,0,.55), rgba(0,0,0,.96)); opacity: 0; transition: opacity 3s; }
.idle.on { opacity: 1; }
.idle p { margin: 0; padding: 0 16px; text-align: center; font: 400 clamp(32px, 5vw, 76px)/1.1 var(--f-title); color: #d9cfc6; text-shadow: 0 0 30px rgba(255,20,10,.5); animation: breatheT 4s ease-in-out infinite; }
@keyframes breatheT { 50% { opacity: .45; transform: scale(1.03); } }

/* the last minute */
body.lastmin::after { content: ''; position: fixed; inset: 0; z-index: 899; pointer-events: none; box-shadow: inset 0 0 160px rgba(255,0,0,.55); animation: beat 1s ease-out infinite; }
@keyframes beat { 0% { opacity: 1; } 15% { opacity: .35; } 30% { opacity: .9; } 100% { opacity: .2; } }

@media (prefers-reduced-motion: reduce) { .peek, .ghost-dot, .hand { display: none !important; } .idle p { animation: none; } body.lastmin::after { animation: none; } }
