/* ---------- VARS ---------- */
:root {
  --bg: #0d1117;
  --card: #161b22;
  --border: #30363d;
  --text: #c9d1d9;
  --text-light: #8b949e;
  --accent: #58a6ff;
  --radius: 6px;
  --shadow: 0 4px 12px rgba(0,0,0,.3);
  --container: 1200px;
}

/* ---------- RESET & BASE ---------- */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  background-image:
    url('data:image/svg+xml,%3Csvg viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noise"%3E%3CfeTurbulence type="fractalNoise" baseFrequency=".75" numOctaves="3" stitchTiles="stitch"/%3E%3CfeDiffuseLighting in="noise" lighting-color="%23161b22" surfaceScale="2"%3E%3CfeDistantLight azimuth="45" elevation="60"/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noise)"/%3E%3C/svg%3E'),
    radial-gradient(1000px 280px at 30% 0%, rgba(37,99,235,.15), transparent 60%),
    radial-gradient(900px 260px at 90% 20%, rgba(14,165,233,.15), transparent 55%),
    linear-gradient(135deg, #0b1220, #111827);
  background-size: auto, 100% 100%, 100% 100%, 100% 100%;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0 0 1em; line-height: 1.6; }
ul { list-style: none; padding: 0; margin: 0; }

/* ---------- FEATURED GAME ---------- */
.featured-game {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 18px;
  padding: 48px 32px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  display: none; /* Hidden by default, shown by JS */
}
.featured-game::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(75deg, rgba(13,17,23,0.95) 30%, rgba(13,17,23,0.6) 70%, rgba(13,17,23,0.2) 100%);
  z-index: 1;
}
.featured-content { 
  position: relative; 
  z-index: 2; 
  max-width: 50%; 
}
.featured-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 2px 15px rgba(0,0,0,0.5);
  margin-bottom: 12px;
}
.featured-excerpt {
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 20px;
}
.featured-btn {
  background: var(--accent);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  transition: all .2s ease;
  box-shadow: 0 4px 15px rgba(88, 166, 255, 0.2);
}
.featured-btn:hover {
  background: #79bbff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 166, 255, 0.3);
}


/* ---------- HEADER ---------- */
.header {
  background: rgba(13,17,23,.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo a { font-size: 1.25rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.logo span { background: var(--accent); color: var(--bg); padding: 4px 8px; border-radius: var(--radius); font-weight: 800; }
.nav { display: flex; gap: 8px; }
.nav a { color: var(--text-light); padding: 8px 12px; border-radius: var(--radius); }
.nav a.active, .nav a:hover { color: var(--text); background: rgba(255,255,255,.05); text-decoration: none; }
.header-right { display: flex; align-items: center; gap: 12px; }
.search-container { position: relative; }
#q { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); padding: 6px 12px 6px 32px; font-size: 14px; min-width: 220px;}
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-light); }
.count-pill { background: var(--border); font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 99px; }
.burger { display: none; background: none; border: none; color: var(--text); font-size: 24px; }

/* ---------- LAYOUT ---------- */
.container { max-width: var(--container); margin: 18px auto 28px; padding: 0 16px; }
.main-grid { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.content-area { /* This will hold the feed or the single post */ }

/* ---------- FEED VIEW ---------- */
.feed { /* container for posts */ }
.post {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px;
  margin-bottom: 14px;
  transition: border-color .2s;
}
.post:hover { border-color: var(--accent); }
.post h2 { font-size: 1.2rem; margin-bottom: 4px; }
.post h2 a { color: var(--text); }
.post .excerpt { color: var(--text-light); font-size: .9rem; line-height: 1.5; }
.post .meta { font-size: .8rem; color: var(--text-light); margin-top: 8px; }
.datebox { text-align: center; background: rgba(0,0,0,.2); padding: 8px; border-radius: var(--radius); font-weight: 700; border: 1px solid var(--border); }
.datebox .mon { font-size: .8rem; text-transform: uppercase; color: var(--text-light); }
.datebox .day { font-size: 1.8rem; color: var(--accent); line-height: 1.1; }
.datebox .year { font-size: .8rem; color: var(--text-light); }
.pager { display: flex; align-items: center; gap: 4px; padding: 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 14px; }
.pager .page { display: inline-block; padding: 6px 12px; border-radius: 4px; color: var(--text-light); font-weight: 500; }
.pager .page.active, .pager .page:hover { background: var(--border); color: var(--text); text-decoration: none; }

/* ---------- POST DETAIL VIEW ---------- */
#post-view { display: none; /* shown by JS */ }
.post-full { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.btn-back { background: none; border: 1px solid var(--border); color: var(--text); padding: 8px 14px; font-size: .9rem; border-radius: var(--radius); cursor: pointer; margin-bottom: 24px; }
.btn-back:hover { background: var(--border); }
.post-full h1 { font-size: 2rem; line-height: 1.2; margin-bottom: 8px; }
.meta-full { color: var(--text-light); margin-bottom: 24px; }
.post-body p { font-size: 1.1rem; }
.post-body h3 { margin: 24px 0 12px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.reward-links { display: flex; flex-direction: column; gap: 12px; }
.reward-links li { /* container for each link */ }
.btn-link {
  display: block; 
  background: #2563eb; /* a blue color */
  color: white; 
  padding: 12px 18px; 
  border-radius: var(--radius); 
  text-decoration: none; 
  font-weight: 600;
  text-align: center;
  transition: background .2s;
}
.btn-link:hover { background: #1d4ed8; text-decoration: none; }

/* ---------- SIDEBAR ---------- */
.sidebar { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 14px; }
.widget { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.widget-title { padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 1rem; }
.widget-text { padding: 0 14px 14px; font-size: .9rem; color: var(--text-light); }
.widget-list { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.widget-list a { display: flex; justify-content: space-between; color: var(--text); padding: 4px 0; }
.widget-list a:hover { color: var(--accent); text-decoration: none; }
.widget-list span { color: var(--text-light); }
.share-buttons { display: flex; padding: 0 14px 14px; gap: 8px; }
.share-btn { flex: 1; text-align: center; background: var(--border); color: var(--text); padding: 8px; border-radius: var(--radius); font-size: .9rem; }
.share-btn:hover { background: #30363d; text-decoration: none; }

/* ---------- FOOTER ---------- */
.footer { background: var(--card); border-top: 1px solid var(--border); padding: 28px 16px; margin-top: 32px; font-size: .9rem; color: var(--text-light); }
.footer-grid { max-width: var(--container); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.footer h4 { color: var(--text); margin-bottom: 12px; font-size: 1rem; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-tags a { background: var(--border); padding: 4px 8px; border-radius: var(--radius); color: var(--text-light); font-size: .8rem; }
.footer-tags a:hover { background: #30363d; color: var(--text); text-decoration: none; }
.footer-bottom { text-align: center; margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--border); font-size: .8rem; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .main-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
@media (max-width: 768px) {
  .nav { display: none; position: absolute; top: 56px; left: 0; right: 0; background: var(--card); flex-direction: column; padding: 12px; border-bottom: 1px solid var(--border); }
  .nav.open { display: flex; }
  .burger { display: block; }
  .header-right { gap: 8px; }
  #q { min-width: 120px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .featured-content { max-width: 80%; }
}
@media (max-width: 480px) {
    .post { grid-template-columns: 1fr; }
    .datebox { grid-row: 1; width: 86px; margin-bottom: 14px; }
}

/* ---------- NEW VIEW STYLES ---------- */
.view-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: #fff;
}
.view-intro {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 24px;
}
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.game-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.game-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 8px 25px rgba(88, 166, 255, 0.15);
    text-decoration: none;
}
.game-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
}
.game-card h3 {
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.search-page-container {
    margin-bottom: 24px;
}

#search-page-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.2rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    box-shadow: var(--shadow);
}
