:root{
  --brand:#e60013;
  --panel:#ffe5da;
  --ink:#111;
  --safe-bottom: env(safe-area-inset-bottom);
}
*{box-sizing:border-box}

/* Page base + sticky footer via CSS Grid */
html,body{height:100%}
html{background:var(--brand)} /* ensures no odd background seam on some browsers */

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial,sans-serif;
  background:var(--brand);
  color:#fff;

  /* grid rows: header / main fills / footer */
  display:grid;
  grid-template-rows:auto 1fr auto;

  /* dynamic viewport to avoid mobile toolbar gaps */
  min-height:100dvh;
}

/* Header */
.site-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:12px 16px;background:#fff;color:#111;border-bottom:2px solid #b0000f;
  position:sticky;top:0;z-index:20
}
.header-logo{height:36px;width:auto}
.nav{display:flex;gap:14px}
.nav a{color:#e60013;text-decoration:none;font-weight:600;padding:6px 10px;border-radius:10px}
.nav a:hover{background:#ffe5da}
.nav-toggle{display:none;border:none;background:transparent;color:#e60013;padding:8px;border-radius:8px}
.site-header[data-menu-open="true"] .nav{
  display:flex;position:absolute;top:60px;right:12px;flex-direction:column;
  background:#fff;border:1px solid #eee;border-radius:12px;padding:10px;box-shadow:0 8px 24px rgba(0,0,0,.12)
}
@media (max-width: 768px){
  .nav{display:none}
  .nav-toggle{display:inline-flex}
}

/* Center hero */
.center{min-height:40vh;display:grid;place-items:center}
#logo{max-width:min(680px,80vw);height:auto}

/* Footer (tight around text, sticky, safe-area aware) */
.site-footer{
  background:#fff;
  color:#e60013;
  text-align:center;
  padding:8px 12px; /* thinner box */
  padding-bottom: calc(8px + var(--safe-bottom, 0px)); /* fill iPhone home indicator area */
}
.site-footer p{
  margin:0;           /* remove default p margins so box hugs text */
  line-height:1.2;    /* a touch tighter line height */
}

/* Cards grid (home/blog/games) */
.section{max-width:1200px;margin:24px auto;padding:0 16px}
.section h2{margin:0 0 6px;color:#fff}
.section .sub{margin:0 0 16px;color:#ffd7cf}
.grid{display:grid;gap:18px;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));align-items:stretch}
.card{display:flex;flex-direction:column;background:#fff;border:1px solid #e6e6e6;border-radius:18px;overflow:hidden;color:#111;min-height:100%}
.card .cover-wrap{position:relative;width:100%;aspect-ratio:16/9;background:#f2f2f2}
.card img.cover{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.card .content{padding:14px 16px 16px;display:flex;flex-direction:column;gap:8px}
.card h3{margin:0;font-size:18px;line-height:1.25}
.card .meta{color:#888;font-size:12px}
.card .excerpt{color:#333;font-size:15px;line-height:1.45;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden}

/* Buttons */
.btn{border:1px solid #ccc;background:#fff;color:#111;padding:.5rem .8rem;border-radius:12px;cursor:pointer;text-decoration:none;display:inline-block}
.btn:hover{background:#f6f6f6}

/* Modal (games/blog preview) */
.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.5);display:none;align-items:center;justify-content:center;padding:16px;z-index:50}
.modal{max-width:min(980px,96vw);max-height:92vh;overflow:auto;background:#fff;color:#111;border-radius:16px;border:1px solid #ddd}
.modal header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid #eee}
.modal .body{padding:16px;display:grid;gap:14px}
.modal .gallery{display:grid;gap:10px}
.modal .gallery .hero{width:100%;aspect-ratio:16/9;background:#f3f3f3;border-radius:12px;overflow:hidden}
.modal .gallery .hero img{width:100%;height:100%;object-fit:cover;display:block}
.modal .thumbs{display:grid;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));gap:8px}
.modal .thumbs img{width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:8px;border:1px solid #eee;cursor:pointer}
.modal .video{position:relative;width:100%;aspect-ratio:16/9;border-radius:12px;overflow:hidden;background:#000}
.modal .video iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.modal .desc{white-space:pre-wrap;line-height:1.5}

/* Editors (shown only when logged in) */
.editor{background:#fff;border:1px solid #e6e6e6;border-radius:16px;color:#111;padding:16px;margin:18px 0}
.editor h3{margin-top:0}
.editor .row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.editor label{display:flex;flex-direction:column;font-size:13px;color:#444;gap:6px}
.editor input,.editor textarea{padding:10px;border:1px solid #ccc;border-radius:10px;font:inherit}
.editor textarea{min-height:120px;resize:vertical}
.editor .actions{display:flex;gap:10px;margin-top:10px;flex-wrap:wrap}
@media (max-width:700px){ .editor .row{grid-template-columns:1fr} }

/* Home divider spacing between games and posts */
.divider{height:8px}

/* Homepage hero logo — sizing + hover/opacity/shadow */
main.center {
  display: grid;
  place-items: center;
  background: #e60013; /* brand red (kept) */
  padding: 56px 16px;
}

.center #logo {
  display: block;
  width: clamp(200px, 40vw, 560px);
  height: auto;
  transform-origin: center;
  transition: transform 180ms ease, opacity 180ms ease, filter 180ms ease; /* include filter */
  will-change: transform, opacity, filter;                                  /* include filter */
  filter: drop-shadow(0 12px 28px rgba(0,0,0,.18)); /* base shadow */
  max-height: min(48vh, 520px);
  object-fit: contain;
  opacity: 0.5; /* half opacity by default */
}

.center #logo:hover,
.center #logo:active,
.center #logo:focus-visible {
  opacity: 1;
  transform: scale(1.035);
  /* stronger, softer shadow on hover */
  filter: drop-shadow(0 18px 36px rgba(0,0,0,.28));
}

/* Prevent sticky header overlap on ultra-short pages */
header[style*="position:sticky"],
header.sticky { z-index: 10; }
