:root{
  --bg:#f4f4f1;
  --panel:#ffffff;
  --ink:#151515;
  --muted:#70736f;
  --line:#dedfd9;
  --soft:#ecece7;
  --signal:#ffd84a;
  --radius:20px;
  --shadow:0 12px 32px rgba(0,0,0,.10);
}

*{box-sizing:border-box}

html{scroll-behavior:smooth}

body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

button,input{font:inherit}
button,a{-webkit-tap-highlight-color:transparent}
button{color:inherit}
a{text-decoration:none;color:inherit}
img{max-width:100%;display:block}

/* ===== Header ===== */

.site-header{
  position:sticky;
  top:0;
  z-index:100;
  background:rgba(255,255,255,.95);
  backdrop-filter:blur(14px);
  border-bottom:1px solid var(--line);
}

.header-inner{
  width:min(1380px,calc(100% - 32px));
  min-height:72px;
  margin:auto;
  display:grid;
  grid-template-columns:210px minmax(240px,1fr) auto;
  gap:18px;
  align-items:center;
}

.logo-horizontal{
  width:190px;
  height:56px;
  object-fit:contain;
  object-position:left center;
}

.search-wrap{position:relative}

.search-wrap::before{
  content:"⌕";
  position:absolute;
  left:16px;
  top:50%;
  transform:translateY(-52%);
  font-size:23px;
  font-weight:900;
  color:#444;
}

.search-input{
  width:100%;
  border:1px solid var(--line);
  background:#f7f7f4;
  border-radius:999px;
  padding:12px 18px 12px 46px;
  outline:none;
  font-weight:750;
  color:var(--ink);
}

.search-input:focus{
  background:#fff;
  border-color:#9d9f98;
  box-shadow:0 0 0 4px rgba(0,0,0,.045);
}

.header-actions{
  display:flex;
  gap:8px;
  align-items:center;
}

.header-btn{
  border:1px solid var(--line);
  background:#fff;
  border-radius:999px;
  padding:10px 14px;
  font-weight:850;
  cursor:pointer;
  white-space:nowrap;
}

.header-btn:hover{border-color:#bfc1ba}

.header-btn.primary{
  background:var(--ink);
  color:#fff;
  border-color:var(--ink);
}

.header-btn.active{
  background:#ffe9ed;
  border-color:#f1bec7;
}

/* ===== Page / Hero ===== */

.page{
  width:min(1380px,calc(100% - 32px));
  margin:auto;
  padding:18px 0 64px;
}

.hero{
  position:relative;
  min-height:260px;
  overflow:hidden;
  border-radius:28px;
  background:
    radial-gradient(circle at 82% 28%,rgba(255,216,74,.28),transparent 30%),
    linear-gradient(135deg,#171717 0%,#262626 65%,#111 100%);
  color:#fff;
  padding:30px 38px;
  display:flex;
  align-items:center;
}

.hero-copy{
  position:relative;
  z-index:2;
  max-width:700px;
}

.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:var(--signal);
  color:#151515;
  border-radius:999px;
  padding:6px 10px;
  font-weight:950;
  font-size:.72rem;
  letter-spacing:.03em;
}

.hero h1{
  font-size:clamp(2.35rem,4.4vw,4.25rem);
  line-height:.93;
  margin:14px 0 10px;
  letter-spacing:-.055em;
}

.hero p{
  margin:0;
  max-width:580px;
  color:#d7d7d2;
  font-size:.96rem;
  line-height:1.5;
  font-weight:650;
}

.hero-actions{
  display:flex;
  gap:9px;
  flex-wrap:wrap;
  margin-top:17px;
}

.hero-action{
  border:0;
  border-radius:12px;
  padding:10px 14px;
  font-weight:900;
  cursor:pointer;
  background:#fff;
  color:#141414;
}

.hero-action.alt{
  background:transparent;
  color:#fff;
  border:1px solid #595959;
}

.hero-mascot{
  position:absolute;
  z-index:1;
  right:7%;
  bottom:-7%;
  height:98%;
  width:auto;
  max-width:36%;
  object-fit:contain;
  object-position:center bottom;
  opacity:.98;
  filter:drop-shadow(0 16px 26px rgba(0,0,0,.28));
}

/* ===== Sections ===== */

.section{margin-top:30px}

.section-head{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}

.section-head h2{
  margin:0;
  font-size:1.5rem;
  letter-spacing:-.025em;
}

.section-head p{
  margin:4px 0 0;
  color:var(--muted);
  font-weight:650;
  font-size:.84rem;
}

.clear-filter{
  border:1px solid var(--line);
  background:#fff;
  border-radius:999px;
  padding:8px 12px;
  font-weight:850;
  cursor:pointer;
}

/* ===== Portal game grid ===== */

.game-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}

.game-card{
  min-width:0;
  overflow:hidden;
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  cursor:pointer;
  transition:
    transform .16s ease,
    box-shadow .16s ease,
    border-color .16s ease;
}

.game-card:hover,
.game-card:focus-visible{
  transform:translateY(-4px);
  border-color:#c7c9c2;
  box-shadow:var(--shadow);
  outline:none;
}

.cover{
  position:relative;
  aspect-ratio:2/1;
  overflow:hidden;
  background:#202020;
  display:flex;
  align-items:center;
  justify-content:center;
}

.cover::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:2;
  pointer-events:none;
  background:
    linear-gradient(
      180deg,
      rgba(0,0,0,.05) 0%,
      transparent 35%,
      transparent 65%,
      rgba(0,0,0,.18) 100%
    );
}

.cover-image{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  z-index:1;
  transform:scale(1.002);
  transition:transform .28s ease,filter .28s ease;
}

.game-card:hover .cover-image,
.game-card:focus-visible .cover-image{
  transform:scale(1.045);
  filter:saturate(1.05) contrast(1.02);
}

.cover .emoji{
  position:relative;
  z-index:2;
  font-size:4rem;
}

.badge{
  position:absolute;
  left:9px;
  top:9px;
  z-index:5;
  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  padding:5px 8px;
  border-radius:999px;
  font-size:.61rem;
  font-weight:950;
  letter-spacing:.02em;
}

.like-btn{
  position:absolute;
  right:9px;
  top:9px;
  z-index:6;
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:50%;
  border:0;
  background:rgba(255,255,255,.95);
  font-size:1rem;
  cursor:pointer;
  box-shadow:0 2px 8px rgba(0,0,0,.12);
}

.like-btn.on{
  background:#ffe5ea;
}

.play-overlay{
  position:absolute;
  left:50%;
  top:50%;
  z-index:5;
  transform:translate(-50%,-42%);
  opacity:0;
  background:rgba(15,15,15,.88);
  color:#fff;
  border-radius:999px;
  padding:9px 15px;
  font-size:.78rem;
  font-weight:950;
  transition:.16s ease;
}

.game-card:hover .play-overlay,
.game-card:focus-visible .play-overlay{
  opacity:1;
  transform:translate(-50%,-50%);
}

.game-info{
  padding:10px 11px 11px;
}

.game-info h3{
  margin:0;
  font-size:1.05rem;
  line-height:1.15;
  font-weight:950;
  letter-spacing:-.012em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.game-meta{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:6px;
  color:#6a6e69;
  font-size:.64rem;
  font-weight:800;
}

.empty{
  grid-column:1/-1;
  border:1px dashed #bfc1ba;
  border-radius:18px;
  padding:32px;
  text-align:center;
  color:var(--muted);
  font-weight:750;
  background:#fafaf8;
}

/* ===== Explore ===== */

.explore-section{
  margin-top:46px;
  padding-top:4px;
}

.category-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:11px;
}

.category-card{
  min-height:92px;
  border:1px solid var(--line);
  background:#fff;
  border-radius:17px;
  padding:14px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:12px;
  align-items:center;
  text-align:left;
  cursor:pointer;
  transition:.15s ease;
}

.category-card:hover{
  transform:translateY(-2px);
  border-color:#c6c8c1;
  box-shadow:0 10px 24px rgba(0,0,0,.07);
}

.category-emoji{
  width:46px;
  height:46px;
  border-radius:13px;
  background:#f0f1ec;
  display:grid;
  place-items:center;
  font-size:1.55rem;
}

.category-copy{
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:0;
}

.category-copy strong{
  font-size:.92rem;
  line-height:1.15;
}

.category-copy small{
  color:var(--muted);
  font-size:.69rem;
  font-weight:700;
}

.category-arrow{
  font-size:1.2rem;
  color:#848780;
}

.year-area{
  margin-top:20px;
}

.year-area h3{
  margin:0 0 9px;
  font-size:1rem;
}

.year-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.year-chip{
  border:1px solid var(--line);
  background:#fff;
  border-radius:999px;
  padding:9px 12px;
  font-weight:850;
  cursor:pointer;
  display:flex;
  gap:8px;
  align-items:center;
}

.year-chip span{
  color:#777a75;
  font-size:.72rem;
}

/* ===== Footer ===== */

.site-footer{
  border-top:1px solid var(--line);
  background:#fff;
}

.footer-inner{
  width:min(1380px,calc(100% - 32px));
  margin:auto;
  padding:25px 0;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:24px;
}

.footer-left{
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
}

.footer-brand{
  display:flex;
  gap:9px;
  align-items:center;
  font-weight:950;
  font-size:1rem;
}

.footer-icon{
  width:34px;
  height:34px;
  object-fit:contain;
}

.footer-credit{
  margin-left:43px;
  margin-top:-4px;
  color:#878a84;
  font-size:.63rem;
  font-weight:750;
  letter-spacing:.015em;
}

.footer-copy{
  margin-top:9px;
  color:var(--muted);
  font-size:.76rem;
  font-weight:650;
  line-height:1.4;
}

.footer-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:9px;
  flex:0 0 auto;
}

.footer-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  padding:9px 14px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  color:var(--ink);
  font-size:.78rem;
  font-weight:900;
  transition:transform .15s ease,border-color .15s ease,background .15s ease;
}

.footer-btn:hover{
  transform:translateY(-1px);
  border-color:#bfc1ba;
  background:#f8f8f5;
}

.footer-btn.primary{
  background:var(--ink);
  border-color:var(--ink);
  color:#fff;
}

.footer-btn.primary:hover{
  background:#000;
  border-color:#000;
}

/* ===== Toast ===== */

.toast{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:200;
  background:#161616;
  color:#fff;
  border-radius:13px;
  padding:12px 14px;
  font-weight:800;
  font-size:.82rem;
  box-shadow:0 15px 35px rgba(0,0,0,.22);
  opacity:0;
  transform:translateY(8px);
  pointer-events:none;
  transition:.2s ease;
}

.toast.show{
  opacity:1;
  transform:translateY(0);
}

/* ===== Responsive ===== */

@media(max-width:1180px){
  .game-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .category-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .hero-mascot{right:4%;max-width:39%}
}

@media(max-width:960px){
  .header-inner{
    grid-template-columns:180px minmax(200px,1fr) auto;
  }

  .logo-horizontal{width:170px}

  .game-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .category-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:760px){
  .header-inner{
    width:min(100% - 20px,1380px);
    min-height:64px;
    grid-template-columns:1fr auto;
    gap:9px;
  }

  .logo-horizontal{
    width:155px;
    height:52px;
  }

  .search-wrap{
    grid-column:1/-1;
    grid-row:2;
    padding-bottom:9px;
  }

  .header-btn:not(.primary){display:none}

  .page{
    width:min(100% - 20px,1380px);
    padding-top:10px;
  }

  .hero{
    min-height:220px;
    border-radius:22px;
    padding:20px 18px;
    align-items:flex-start;
  }

  .hero-copy{max-width:76%}

  .hero h1{
    font-size:2rem;
    line-height:.96;
    margin:12px 0 8px;
  }

  .hero p{
    font-size:.8rem;
    line-height:1.4;
  }

  .hero-actions{margin-top:13px}

  .hero-action{
    padding:8px 10px;
    font-size:.78rem;
  }

  .hero-mascot{
    height:82%;
    right:-5%;
    bottom:-3%;
    max-width:48%;
  }

  .section{margin-top:24px}

  .section-head{
    margin-bottom:10px;
    align-items:center;
  }

  .section-head h2{font-size:1.22rem}

  .game-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }

  .game-info{
    padding:8px 9px 9px;
  }

  .game-info h3{
    font-size:.83rem;
  }

  .game-meta{
    gap:6px;
    font-size:.57rem;
  }

  .category-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
  }

  .category-card{
    min-height:78px;
    padding:11px;
    gap:9px;
  }

  .category-emoji{
    width:38px;
    height:38px;
    border-radius:11px;
    font-size:1.25rem;
  }

  .footer-inner{
    width:min(100% - 20px,1380px);
    align-items:flex-start;
  }

  .footer-copy{
    max-width:440px;
  }

  .footer-actions{
    margin-left:auto;
  }
}

@media(max-width:520px){
  .game-grid{
    grid-template-columns:1fr;
  }

  .cover{
    aspect-ratio:16/8.5;
  }

  .game-info h3{
    font-size:1rem;
  }

  .game-meta span:first-child{
    width:100%;
  }

  .category-grid{
    grid-template-columns:1fr 1fr;
  }

  .category-card{
    grid-template-columns:auto 1fr;
  }

  .category-arrow{display:none}

  .category-copy strong{
    font-size:.82rem;
  }

  .footer-inner{
    flex-direction:column;
    align-items:stretch;
    gap:16px;
  }

  .footer-copy{
    font-size:.7rem;
  }

  .footer-actions{
    width:100%;
    margin-left:0;
    justify-content:flex-start;
  }

  .footer-btn{
    flex:1 1 0;
  }
}

@media(max-width:390px){
  .hero-copy{max-width:79%}
  .hero h1{font-size:1.78rem}
  .hero p{font-size:.75rem}
  .hero-mascot{right:-8%;max-width:50%}

  .game-meta{
    display:none;
  }

  .category-copy small{
    display:none;
  }
}
