/* ═══════════════════════════════════════
   PLAYHAVEN — Editor's Picks / Content Mode
   ═══════════════════════════════════════ */

:root {
  --bg: #faf9f5;
  --card: #ffffff;
  --text: #1f1f2e;
  --text2: #717184;
  --text3: #a0a0b4;
  --border: #e8e7e2;
  --accent: #0891b2;
  --accent2: #f43f5e;
  --green: #10b981;
  --shadow: 0 1px 4px rgba(0,0,0,0.04);
  --shadow-h: 0 8px 24px rgba(0,0,0,0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent2); }

.page { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) { .page { padding: 0 28px; } }

/* ═══ HEADER ═══ */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,249,245,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 60px;
}
.h-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; gap: 14px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 700;
}
.logo-m {
  width: 30px; height: 30px; background: var(--accent);
  border-radius: 8px; display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 14px; font-weight: 800;
}
.logo span { color: var(--accent); font-weight: 300; }
.nav { display: none; gap: 4px; }
.nav a {
  padding: 6px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 500; color: var(--text2);
  transition: all .2s;
}
.nav a:hover, .nav a.active { background: rgba(8,145,178,0.06); color: var(--accent); }
@media (min-width: 768px) { .nav { display: flex; align-items: center; } }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: transparent; border: 1px solid var(--border);
  color: var(--text2); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
@media (min-width: 768px) { .icon-btn.m-only { display: none; } }

/* Search Bar (desktop) */
.sb-desktop { display: none; position: relative; flex: 1; max-width: 320px; }
.sb-desktop input {
  width: 100%; height: 34px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 0 14px 0 34px; font-size: 13px;
  outline: none; transition: all .2s; color: var(--text);
}
.sb-desktop input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(8,145,178,0.08); }
.sb-desktop input::placeholder { color: var(--text3); }
.sb-desktop .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 12px; }
@media (min-width: 768px) { .sb-desktop { display: block; } }

/* ═══ EDITOR'S PICK ═══ */
.ep-section { padding: 32px 0 12px; }
.ep-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .ep-grid { grid-template-columns: 2fr 1fr; } }

.ep-main {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: all .25s;
  display: flex; flex-direction: column;
  position: relative;
}
.ep-main:hover { box-shadow: var(--shadow-h); transform: translateY(-2px); }
.ep-main-top {
  position: relative; width: 100%; padding: 28px 28px 24px;
  background: linear-gradient(135deg, #e0f2fe, #dbeafe);
  display: flex; align-items: center; justify-content: center;
  min-height: 180px;
}
.ep-main-top img {
  width: 100px; height: 100px; border-radius: 20px;
  object-fit: cover; box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border: 3px solid #fff;
}
.ep-main-top .tag-overlay {
  position: absolute; top: 14px; left: 14px;
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; padding: 4px 12px;
  border-radius: 20px; background: rgba(255,255,255,0.85);
  color: var(--accent); backdrop-filter: blur(4px);
}
.ep-main-body { padding: 20px 22px 22px; flex: 1; display: flex; flex-direction: column; }
.ep-main-body .cat-tag {
  display: inline-block; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 3px 10px; border-radius: 4px;
  background: rgba(8,145,178,0.06); color: var(--accent);
  width: fit-content; margin-bottom: 8px;
}
.ep-main-body h2 { font-size: 20px; font-weight: 700; line-height: 1.2; margin-bottom: 6px; }
.ep-main-body p { font-size: 13px; color: var(--text2); line-height: 1.5; flex: 1; margin-bottom: 12px; }
.ep-main-body .stats { font-size: 11px; color: var(--text3); display: flex; gap: 14px; margin-bottom: 14px; }
.ep-play {
  display: inline-block; padding: 10px 28px; border-radius: 20px;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 600;
  width: fit-content; transition: all .2s;
}
.ep-play:hover { opacity: 0.9; transform: translateY(-1px); color: #fff; }

.ep-side {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.ep-side .card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  cursor: pointer; transition: all .2s;
  text-decoration: none; color: var(--text);
}
.ep-side .card:hover { box-shadow: var(--shadow-h); transform: translateY(-1px); }
.ep-side .card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.ep-side .card .body { padding: 8px 10px 10px; }
.ep-side .card .body h4 { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-side .card .body .m { font-size: 9px; color: var(--text3); margin-top: 1px; }

/* ═══ HOT CATEGORIES ═══ */
.hc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 36px; }
@media (min-width: 640px) { .hc-grid { grid-template-columns: repeat(4,1fr); gap: 14px; } }
.hc-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 16px;
  text-align: center; cursor: pointer; transition: all .25s;
  text-decoration: none; color: var(--text);
}
.hc-card:hover { box-shadow: var(--shadow-h); transform: translateY(-2px); }
.hc-card .emoji { font-size: 28px; margin-bottom: 6px; }
.hc-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.hc-card .sub { font-size: 11px; color: var(--text2); }
.hc-card .top-game { font-size: 10px; color: var(--text3); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ═══ RECENTLY PLAYED — Vertical List ═══ */
.vlist { display: flex; flex-direction: column; margin-bottom: 36px; }
.vi {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
  text-decoration: none; color: var(--text);
}
.vi:hover { background: rgba(0,0,0,0.02); margin: 0 -8px; padding: 12px 8px; border-radius: var(--radius-sm); }
.vi:last-child { border-bottom: none; }
.vi img { width: 52px; height: 52px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.vi .info { flex: 1; min-width: 0; }
.vi .info h4 { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vi .info .detail { font-size: 11px; color: var(--text2); margin-top: 1px; display: flex; gap: 10px; }
.vi .play-tag {
  font-size: 10px; font-weight: 600; color: var(--accent);
  padding: 4px 12px; border-radius: 12px;
  background: rgba(8,145,178,0.06);
}

/* ═══ Grid ═══ */
.sec-hd { display: flex; align-items: center; gap: 10px; margin: 36px 0 18px; }
.sec-hd h2 { font-size: 18px; font-weight: 600; }
.sec-hd .line { flex: 1; height: 1px; background: var(--border); }
.sec-hd .num { font-size: 10px; font-weight: 700; color: var(--accent); background: rgba(8,145,178,0.06); padding: 2px 10px; border-radius: 20px; letter-spacing: 1px; }

.gg { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin-bottom: 48px; }
@media (min-width: 500px) { .gg { grid-template-columns: repeat(3,1fr); } }
@media (min-width: 768px) { .gg { grid-template-columns: repeat(4,1fr); } }
@media (min-width: 1024px) { .gg { grid-template-columns: repeat(5,1fr); gap: 14px; } }

.gc {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  cursor: pointer; transition: all .2s; text-decoration: none; color: var(--text);
}
.gc:hover { box-shadow: var(--shadow-h); transform: translateY(-2px); }
.gc .thumb { width: 100%; aspect-ratio: 1; overflow: hidden; background: #f0efeb; position: relative; }
.gc .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gc:hover .thumb img { transform: scale(1.05); }
.gc .hot-tag {
  position: absolute; top: 5px; right: 5px;
  background: var(--accent2); color: #fff; font-size: 7px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
}
.gc .info { padding: 9px 10px 10px; }
.gc .info h3 { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc .info .m { font-size: 9px; color: var(--text3); margin-top: 2px; display: flex; gap: 8px; }

/* ═══ Footer ═══ */
footer { border-top: 1px solid var(--border); padding: 36px 0; margin-top: 24px; }
.fg { display: grid; grid-template-columns: 1fr; gap: 24px; font-size: 13px; }
@media (min-width: 640px) { .fg { grid-template-columns: 2fr 1fr 1fr; } }
footer h4 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; color: var(--text3); }
footer a { display: block; color: var(--text2); font-size: 12px; padding: 3px 0; }
footer a:hover { color: var(--accent); }
footer p { color: var(--text2); font-size: 12px; line-height: 1.7; }
footer .copy { font-size: 10px; color: var(--text3); margin-top: 12px; }

/* ═══ Category Page ═══ */
.ch { padding: 32px 0 20px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.ch h1 { font-size: 26px; font-weight: 700; }
.ch p { color: var(--text2); font-size: 13px; margin-top: 4px; }

/* ═══ Game Detail ═══ */
.bc { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text3); padding: 14px 0; }
.bc a { color: var(--text3); } .bc a:hover { color: var(--accent); }

.gd-wrap { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 900px) { .gd-wrap { grid-template-columns: 2fr 1fr; } }

.play-box { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.play-area { position: relative; width: 100%; aspect-ratio: 16/9; background: #0a0a14; }
.pl {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px; text-align: center;
}
.pl img { width: 56px; height: 56px; border-radius: 12px; margin-bottom: 10px; border: 2px solid rgba(255,255,255,0.08); }
.pl h2 { color: #fff; font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.pl p { color: rgba(255,255,255,0.5); font-size: 12px; margin-bottom: 16px; }
.pb {
  padding: 10px 30px; border: none; background: var(--accent);
  color: #fff; font-size: 14px; font-weight: 600; border-radius: 20px;
  cursor: pointer; transition: all .2s;
}
.pb:hover { opacity: 0.9; transform: scale(1.03); }
.gi { position: absolute; inset: 0; width: 100%; height: 100%; border: none; display: none; }
.fs {
  position: absolute; bottom: 10px; right: 10px; z-index: 10;
  background: rgba(0,0,0,0.45); color: #fff; border: none;
  font-size: 10px; padding: 6px 14px; border-radius: 6px; cursor: pointer; display: none;
}
.gm { padding: 18px 20px; }
.gm .top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.gm h1 { font-size: 18px; font-weight: 700; }
.gm .sr { display: flex; gap: 10px; font-size: 11px; font-weight: 500; padding: 5px 12px; border: 1px solid var(--border); border-radius: 20px; color: var(--text2); background: var(--bg); }
.gm .desc { font-size: 13px; line-height: 1.7; color: var(--text2); }
.gm .desc strong { color: var(--text); }

.info-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: var(--card); }
.info-box h3 { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.sg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.si { } .si .l { font-size: 9px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; } .si .v { font-size: 14px; font-weight: 600; margin-top: 1px; }

/* ── Search Overlay ── */
.so { display: none; position: fixed; inset: 0; z-index: 200; background: var(--card); flex-direction: column; }
.so.open { display: flex; }
.st { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.st input { flex: 1; font-size: 16px; background: transparent; border: none; color: var(--text); outline: none; }
.sr { flex: 1; overflow-y: auto; padding: 16px; display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; align-content: start; }

/* ── Drawer ── */
.do { display: none; position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,0.3); }
.do.open { display: block; }
.drawer { position: fixed; top: 0; left: 0; bottom: 0; width: 270px; background: var(--card); z-index: 160; transform: translateX(-100%); transition: transform .3s; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.drawer.open { transform: translateX(0); }
.dh { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.dn { flex: 1; overflow-y: auto; padding: 12px; }
.di { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text2); transition: all .15s; }
.di:hover { background: rgba(8,145,178,0.05); color: var(--accent); }
.dc { font-size: 10px; background: var(--bg); padding: 1px 8px; border-radius: 10px; color: var(--text3); }
.dl { border-top: 1px solid var(--border); padding: 12px; } .dl a { display: block; font-size: 12px; color: var(--text2); padding: 6px 14px; } .dl a:hover { color: var(--accent); }

@media (max-width:640px){
  .ep-grid { grid-template-columns: 1fr; }
  .ep-side { grid-template-columns: 1fr 1fr; }
  .hc-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hc-card { padding: 14px 10px; }
  .hc-card .emoji { font-size: 22px; }
  .vi { gap: 10px; }
  .vi img { width: 44px; height: 44px; }
  .gg { gap: 8px; }
  .play-area { aspect-ratio: 4/3; }
  .gm h1 { font-size: 16px; }
}
