/* isaac.css — The Binding of Isaac: Raytraced. Same palette as the main site, far fewer effects. */
:root {
  --bg: #07020f; --ink: #f4ecff; --dim: #a99bc4; --pink: #ff2bd6; --cyan: #00f0ff; --yellow: #ffe14d; --red: #ff3b3b;
  --display: 'Unbounded', system-ui, sans-serif; --mono: 'Space Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); overflow-x: hidden; overflow-x: clip; }
body {
  min-height: 100vh; color: var(--ink); font: 14px/1.6 var(--mono);
  background: radial-gradient(ellipse at 50% -10%, #3a0a2e 0%, #14062a 40%, var(--bg) 75%);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); }

.top { max-width: 920px; margin: 0 auto; padding: 26px 16px 8px; text-align: center; }
.back { display: inline-block; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--cyan); border: 1px solid rgba(0, 240, 255, .35); border-radius: 999px; padding: 6px 14px; }
.back:hover { background: rgba(0, 240, 255, .12); }
h1 {
  margin: 18px 0 12px; font: 900 clamp(1.5rem, 6.2vw, 3.6rem)/1 var(--display); letter-spacing: .01em;
  color: var(--red); text-shadow: 0 0 2px #000, 3px 3px 0 #5a0000, 0 0 34px rgba(255, 59, 59, .55);
}
h1 span { display: block; margin-top: 8px; font-size: .42em; letter-spacing: .34em; color: var(--ink); text-shadow: 0 0 20px rgba(0, 240, 255, .5); }
.sub { max-width: 66ch; margin: 0 auto 22px; color: var(--dim); font-size: .82rem; line-height: 1.75; }

main { max-width: 920px; margin: 0 auto; padding: 0 16px 70px; }
.frame {
  position: relative; width: 100%; aspect-ratio: 16 / 10; background: #000; overflow: hidden; outline: none;
  border: 4px solid; border-color: #8a8a8a #2a2a2a #2a2a2a #8a8a8a;
  box-shadow: 0 0 0 2px #000, 0 0 40px rgba(255, 59, 59, .3), 0 30px 80px rgba(0, 0, 0, .6);
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: none;
}
.frame:focus-visible { box-shadow: 0 0 0 2px #000, 0 0 0 5px var(--cyan); }
#gl { display: block; width: 100%; height: 100%; }
.frame.nogl #gl { background: radial-gradient(circle at 50% 40%, #3a0a1e, #07020f 70%); }

/* ---------- HUD ---------- */
.hud { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.hearts { position: absolute; left: 12px; top: 10px; display: flex; flex-wrap: wrap; gap: 3px; max-width: 56%; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .8)); }
.hearts i { position: relative; width: 22px; height: 20px; font: 20px/20px sans-serif; color: #3a0a12; -webkit-text-stroke: 1px #000; }
.hearts i::before, .hearts i::after { content: '♥'; position: absolute; left: 0; top: 0; }
.hearts i::after { color: #ff2a3c; clip-path: inset(0 100% 0 0); }
.hearts i.full::after { clip-path: none; }
.hearts i.half::after { clip-path: inset(0 50% 0 0); }
.hearts i.soul::before { color: #0a1a3a; }
.hearts i.soul::after { color: #4a9dff; }
.map-wrap { position: absolute; right: 10px; top: 8px; text-align: center; }
.minimap { display: block; width: 70px; height: 70px; opacity: .92; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .8)); }
.floorname { margin-top: 2px; font: 700 9px/1 var(--mono); letter-spacing: .14em; color: var(--yellow); text-shadow: 0 1px 2px #000; }
.bossname {
  position: absolute; left: 50%; top: 18%; translate: -50% 0; text-align: center;
  font: 900 clamp(1.4rem, 5vw, 2.6rem)/1 var(--display); color: #fff; text-shadow: 0 0 2px #000, 3px 3px 0 #5a0000, 0 0 30px rgba(255, 0, 0, .9);
  animation: bossin 2.4s ease-out both;
}
.bossname i { display: block; margin-top: 6px; font: 700 .42em var(--mono); letter-spacing: .4em; color: var(--yellow); }
.bossname[hidden] { display: none; }
.bossbar { position: absolute; left: 50%; bottom: 36px; translate: -50% 0; width: 42%; height: 10px; background: rgba(0, 0, 0, .6); border: 2px solid #3a0a12; box-shadow: 0 0 10px rgba(0, 0, 0, .6); }
.bossbar[hidden] { display: none; }
.bossbar i { display: block; height: 100%; width: 100%; background: linear-gradient(#ff5a5a, #a3121c); transition: width .15s; }
.bossbar b { position: absolute; left: 0; right: 0; bottom: 100%; margin-bottom: 3px; text-align: center; font: 700 9px/1 var(--mono); letter-spacing: .2em; color: #fff; text-shadow: 0 1px 2px #000; }
@keyframes bossin { 0% { opacity: 0; scale: 2; } 15% { opacity: 1; scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
.card {
  position: absolute; left: 50%; bottom: 16%; translate: -50% 0; text-align: center; white-space: nowrap;
  animation: cardin 2.8s ease-out both;
}
.card[hidden] { display: none; }
.card b { display: block; font: 900 clamp(1rem, 3.4vw, 1.7rem)/1.1 var(--display); color: #fff; text-shadow: 0 0 2px #000, 2px 2px 0 #000, 0 0 20px rgba(255, 225, 77, .7); }
.card i { display: block; margin-top: 4px; font: 700 .8rem var(--mono); font-style: normal; letter-spacing: .1em; color: var(--yellow); text-shadow: 0 1px 2px #000; }
@keyframes cardin { 0% { opacity: 0; translate: -50% 20px; } 10% { opacity: 1; translate: -50% 0; } 85% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- overlay screens ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px;
  padding: 24px 16px; text-align: center; background: rgba(5, 0, 10, .62); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.overlay[hidden] { display: none; }
.overlay h2 { font: 900 clamp(1.4rem, 5.5vw, 2.8rem)/1 var(--display); color: var(--red); text-shadow: 0 0 2px #000, 3px 3px 0 #5a0000, 0 0 30px rgba(255, 59, 59, .7); }
.overlay[data-screen="dead"] h2 { color: #ddd; text-shadow: 0 0 2px #000, 3px 3px 0 #222; }
.overlay[data-screen="win"] h2 { color: var(--yellow); text-shadow: 0 0 2px #000, 3px 3px 0 #5a4000, 0 0 30px rgba(255, 225, 77, .7); }
.overlay .tag { font: 700 .8rem var(--mono); letter-spacing: .3em; color: var(--yellow); }
.overlay p { color: #e8dcff; font-size: .85rem; }
.overlay .hint { color: var(--dim); font-size: .68rem; line-height: 1.7; max-width: 48ch; }
.overlay .stats { font: 700 .9rem var(--mono); color: #fff; letter-spacing: .06em; }
.overlay .stats b { color: var(--yellow); }
.btn {
  display: inline-block; margin: 6px 2px 0; padding: 12px 22px; font: 700 .9rem var(--display); color: #fff; cursor: pointer; text-transform: uppercase; letter-spacing: .06em;
  background: #a3121c; border: 3px solid; border-color: #ff6a6a #5a0000 #5a0000 #ff6a6a; box-shadow: 0 0 20px rgba(255, 59, 59, .5);
}
.btn:hover { background: #d81a27; }
.btn:active { border-color: #5a0000 #ff6a6a #ff6a6a #5a0000; }

/* ---------- touch sticks ---------- */
.touch { position: absolute; inset: 0; z-index: 3; display: none; pointer-events: none; }
.frame.has-touch.playing .touch { display: block; }
.stick { position: absolute; bottom: 60px; width: 110px; height: 110px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .07); opacity: .4; transition: opacity .15s; }
.stick.move { left: 22px; }
.stick.shoot { right: 22px; border-color: rgba(255, 59, 59, .6); }
.stick.on { opacity: .9; }
.stick i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(255, 255, 255, .55); box-shadow: 0 0 14px rgba(0, 240, 255, .6); }
.stick.shoot i { background: rgba(255, 90, 90, .6); box-shadow: 0 0 14px rgba(255, 59, 59, .7); }

/* ---------- bottom bar ---------- */
.bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 4px 6px; font: 10px/1 var(--mono); letter-spacing: .06em; color: #cfcfcf; background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .75)); pointer-events: none;
}
.bar .stats { opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.bar .btns { display: flex; gap: 4px; pointer-events: auto; }
.bar button { width: 30px; height: 26px; font-size: 13px; line-height: 1; color: #fff; background: rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .35); border-radius: 4px; cursor: pointer; }
.bar button:hover { background: rgba(255, 59, 59, .55); border-color: var(--red); }

/* fullscreen: real (top layer) or fake (pinned to the viewport on iPhone) */
.frame:fullscreen, .frame:-webkit-full-screen, .frame.fake-full { width: 100%; height: 100%; aspect-ratio: auto; border: 0; box-shadow: none; background: #000; }
.frame.fake-full { position: fixed; inset: 0; z-index: 95; }
.frame:fullscreen #gl, .frame:-webkit-full-screen #gl, .frame.fake-full #gl { object-fit: contain; }
html.fake-full, html.fake-full body { overflow: hidden; }

.foot { max-width: 820px; margin: 18px auto 0; text-align: center; color: var(--dim); font-size: .72rem; line-height: 1.75; }
.foot.dim { opacity: .7; }

@media (max-width: 700px) {
  .top { padding-top: 18px; }
  .sub { font-size: .76rem; }
  .hearts i { width: 18px; height: 16px; font-size: 16px; line-height: 16px; }
  .minimap { width: 56px; height: 56px; }
  .overlay { gap: 6px; padding: 12px; }
  .overlay .hint { font-size: .6rem; }
  .btn { padding: 9px 14px; font-size: .75rem; }
  .stick { width: 90px; height: 90px; bottom: 44px; }
  .stick.move { left: 14px; }
  .stick.shoot { right: 14px; }
  .stick i { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
  .bar { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .bossname, .card { animation-duration: .01s; }
}
