.page-home{
  min-height:100vh;
  overflow-x:hidden;
}

.page-home main{
  width:100%;
  max-width:1120px;
  margin:0 auto;
  padding:0 20px 74px;
}

.page-home .visually-hidden{
  position:absolute;
  width:1px;
  height:1px;
  margin:-1px;
  padding:0;
  overflow:hidden;
  clip:rect(0 0 0 0);
  white-space:nowrap;
  border:0;
}

.home-game{
  width:100%;
  max-width:760px;
  margin:0 auto 26px;
}

.topic-card:hover,
.topic-card:focus-visible{
  border-color:var(--accent);
  box-shadow:0 20px 52px -34px rgba(0,0,0,.95), 0 0 18px -10px var(--accent);
  text-decoration:none;
}

.home-topics{
  margin:0 auto;
}

.home-topics > h2{
  margin:0 0 16px;
  color:var(--heading);
  font-size:24px;
  line-height:1.2;
  text-align:center;
  border:0;
}

.topic-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:14px;
  min-width:0;
}

.topic-card{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  width:100%;
  min-width:0;
  max-width:100%;
  min-height:226px;
  padding:16px;
  background:color-mix(in srgb, var(--panel) 88%, #000);
  border:1px solid var(--border);
  border-radius:8px;
  box-shadow:0 18px 46px -34px rgba(0,0,0,.95);
  text-decoration:none;
  touch-action:pan-y;
  transition:border-color .12s, box-shadow .12s, background .12s;
}

.topic-card h3{
  margin:0 0 8px;
  color:var(--greenhi);
  font-size:17px;
  line-height:1.25;
}

.home-game h2{
  margin:0 0 10px;
  color:var(--greenhi);
  font-size:clamp(22px, 3.4vw, 32px);
  line-height:1.12;
  border:0;
  padding-bottom:0;
}

.home-title-image{
  display:block;
  width:100%;
  height:auto;
  margin:0 auto 14px;
  border-radius:8px;
  image-rendering:auto;
}

.home-game p{
  max-width:760px;
  margin:0 0 18px;
  color:var(--text);
  font-size:16px;
  line-height:1.55;
  overflow-wrap:anywhere;
}

.topic-card p{
  max-width:none;
  margin:0 0 14px;
  color:var(--text);
  font-size:14px;
  line-height:1.55;
  overflow-wrap:anywhere;
}

.topic-image{
  display:block;
  max-width:100%;
  width:100%;
  height:auto;
  aspect-ratio:1200 / 676;
  object-fit:cover;
  margin-top:auto;
  border:1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius:6px;
  background:#050607;
  box-shadow:0 14px 36px -24px rgba(0,0,0,.95);
  transition:border-color .12s, box-shadow .12s, filter .12s;
  -webkit-user-drag:none;
}

.topic-card:hover .topic-image,
.topic-card:focus-visible .topic-image{
  border-color:color-mix(in srgb, var(--accent) 42%, var(--border));
  box-shadow:0 18px 42px -24px rgba(0,0,0,.95), 0 0 14px -10px var(--accent);
  filter:saturate(1.06) brightness(1.04);
}

.play-link{
  display:block;
  max-width:640px;
  margin:0 auto;
  color:inherit;
  text-decoration:none;
  touch-action:pan-y;
}

.home-bot-preview{
  position:relative;
}

.home-bot-hit{
  position:absolute;
  inset:0;
  z-index:5;
  border-radius:20px;
}

.home-bot-hit:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:6px;
}

.home-bot-hidden{
  position:absolute;
  width:1px;
  height:1px;
  margin:-1px;
  padding:0;
  overflow:hidden;
  clip:rect(0 0 0 0);
  white-space:nowrap;
  border:0;
}

.play-link:hover,
.play-link:focus-visible{
  text-decoration:none;
}

/* CRT monitor shell around the play image, mirroring the one on game.html */
.play-link .crt{
  position:relative;
  display:block;
  background:var(--crt-case-bg);
  border-radius:20px;
  padding:18px 22px 15px;
  box-shadow:var(--crt-case-shadow);
  transition:box-shadow .14s, transform .14s;
}

.play-link .crt-tube{
  position:relative;
  display:block;
  background:#060708;
  padding:9px;
  border-radius:14px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.035), inset 0 0 18px 5px rgba(0,0,0,.9);
}

.play-link .crt-tube::after{
  content:"";
  position:absolute;
  inset:9px;
  z-index:1;
  border-radius:7px;
  background:rgba(255, 0, 0, .58);
  opacity:0;
  pointer-events:none;
  mix-blend-mode:screen;
  transition:opacity .08s;
}

.home-bot-preview #screen{
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:4 / 3;
  object-fit:fill;
  background:#000;
  border-radius:7px;
  image-rendering:pixelated;
  box-shadow:0 0 0 2px #000, 0 0 44px -2px var(--glow);
}

.home-bot-preview #tube.stuck-red::after{
  opacity:1;
}

.home-bot-preview #power{
  display:none;
}

.play-link .crt-glass{
  position:absolute;
  inset:9px;
  border-radius:7px;
  pointer-events:none;
  z-index:2;
  background:linear-gradient(133deg, rgba(255,255,255,.07), rgba(255,255,255,.012) 24%, transparent 40%), radial-gradient(128% 132% at 50% 47%, transparent 56%, rgba(0,0,0,.40) 100%), repeating-linear-gradient(to bottom, rgba(0,0,0,.16) 0 1px, transparent 1px 3px);
  box-shadow:inset 0 0 26px 5px rgba(0,0,0,.5);
}

.play-link .crt-panel{
  display:flex;
  align-items:center;
  gap:11px;
  height:16px;
  margin-top:13px;
  padding:0 5px;
}

.play-link .crt-logo{
  font:700 10px/1 ui-monospace, monospace;
  letter-spacing:.24em;
  text-transform:uppercase;
  color:var(--crt-logo);
  text-shadow:var(--crt-logo-shadow);
}

.play-link .crt-led{
  width:7px;
  height:7px;
  border-radius:50%;
  background:radial-gradient(circle at 34% 30%, #e6ffe6, var(--phos) 52%, rgba(0,0,0,.7) 100%);
  box-shadow:0 0 9px 1px var(--glow);
}

.play-link .crt-knobs{
  margin-left:auto;
  display:flex;
  gap:11px;
}

.play-link .crt-knobs i{
  position:relative;
  width:15px;
  height:15px;
  border-radius:50%;
  background:var(--crt-knob-bg);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08), 0 1px 2px rgba(0,0,0,.6);
}

.play-link .crt-knobs i::after{
  content:"";
  position:absolute;
  left:50%;
  top:2px;
  width:1.5px;
  height:5px;
  background:rgba(0,0,0,.6);
  border-radius:1px;
  transform:translateX(-50%);
}

.play-link:hover .crt,
.play-link:focus-visible .crt{
  box-shadow:var(--crt-case-hover-shadow);
  transform:translateY(-2px);
}

.home-bot-preview:hover #screen,
.home-bot-hit:focus-visible + .crt #screen{
  box-shadow:0 0 0 2px #000, 0 0 56px 0 var(--glow);
}

@media (max-width:900px){
  .topic-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media (max-width:640px){
  .page-home main{
    padding:0 12px 52px;
  }
  .home-game{
    margin-bottom:18px;
  }
  .home-game h2{
    font-size:22px;
  }
  .home-title-image{
    width:calc(100% + 8px);
    max-width:none;
    margin-left:-4px;
    margin-right:-4px;
    margin-bottom:10px;
  }
  .home-game p{
    margin-bottom:12px;
    font-size:14px;
    line-height:1.45;
  }
  .topic-grid{
    grid-template-columns:1fr;
    gap:10px;
  }
  .topic-card{
    min-height:0;
    padding:12px;
  }
  .topic-card h3{
    margin-bottom:5px;
    font-size:15.5px;
  }
  .topic-card p{
    margin-bottom:10px;
    font-size:13px;
    line-height:1.42;
  }
  .topic-image{
    max-height:104px;
    object-position:center;
  }
  .home-topics > h2{
    margin-bottom:12px;
    font-size:21px;
  }
  .play-link{
    width:100vw;
    max-width:none;
    margin-left:calc(50% - 50vw);
    margin-right:calc(50% - 50vw);
  }
  .play-link .crt{
    background:none;
    border-radius:0;
    padding:0;
    box-shadow:none;
  }
  .play-link:hover .crt,
  .play-link:focus-visible .crt{
    box-shadow:none;
    transform:none;
  }
  .play-link .crt-tube{
    background:none;
    padding:0;
    border-radius:0;
    box-shadow:none;
  }
  .home-bot-preview #screen{
    width:100vw;
    max-width:none;
    height:auto;
    max-height:none;
    margin:0 auto;
    border-radius:0;
    box-shadow:none;
  }
  .play-link:hover .play-image,
  .play-link:focus-visible .play-image{
    box-shadow:none;
  }
  .play-link .crt-glass{
    display:none;
  }
  .play-link .crt-tube::after{
    inset:0;
    border-radius:0;
  }
  .home-bot-hit{
    border-radius:0;
  }
  .play-link .crt-panel{
    display:none;
  }
}

@media (max-width:420px){
  .home-game{
    margin-bottom:18px;
  }
  .topic-image{
    max-height:92px;
  }
}
