﻿/* =========================================================
   CWS Games â€” Site Styles (cleaned + polished)
   ========================================================= */

/* 1) DESIGN TOKENS */
:root{
  /* colors */
  --bg:#0b0d10;
  --panel:#0f141b;
  --line:#1f2833;
  --text:#e9eef3;
  --muted:#9fb1c3;

  --brand:#3c7cff;
  --brand-2:#7aa7ff;
  --accent:#22d3ee;
  --danger:#ff5a7a;

  /* shape + effects */
  --r:14px;
  --shadow:0 6px 24px rgba(0,0,0,.25);
  --elev:0 8px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.02);

  /* sizing */
  --container:1200px;
  --pad:24px;

  /* font */
  --font:Inter, system-ui, Segoe UI, Arial, sans-serif;
}

/* 2) RESET / BASE */
*{ box-sizing:border-box }
html,body{ height:100% }
html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}
body{
  margin:0; font-family:var(--font);
  background:var(--bg); color:var(--text);
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
}
img{ max-width:100%; height:auto; display:block }
a{ color:inherit; text-decoration:none }
h1,h2{ margin:0 0 12px }
a:focus-visible,button:focus-visible{
  outline:2px solid var(--accent); outline-offset:2px; border-radius:10px;
}

/* 3) LAYOUT */
.container{ max-width:var(--container); margin:0 auto; padding:var(--pad) }
.section{ margin:28px 0 }

.header{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; gap:14px;
  padding:14px 20px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg,#0f1318,rgba(15,19,24,.92));
}
.footer{
  padding:30px 20px; border-top:1px solid var(--line);
  color:var(--muted); font-size:13px;
}

/* brand lockup */
.brand{
  display:flex; align-items:center; gap:10px;
  font-weight:800; letter-spacing:.3px; font-size:20px;
}
.brand .logo{ height:26px; width:auto }
.brand a{ letter-spacing:.2px }

/* top categories */
.nav{ display:flex; gap:10px; flex-wrap:wrap; flex:1 }
.nav-toggle{
  display:none;
  border:1px solid #263042;
  background:#0f141b;
  color:var(--text);
  border-radius:999px;
  padding:8px 12px;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}
.nav-toggle:hover{ border-color:#314356; background:#121c28 }
.badge{
  display:inline-block; padding:7px 12px;
  border:1px solid #263042; border-radius:999px;
  background:#0f141b; font-size:12px;
  transition:border-color .12s, background .12s;
}
.badge:hover{ border-color:#314356; background:#121c28 }

/* global search (right side of header) */
.topsearch{ display:flex; align-items:center }
.topsearch input{
  width:240px; max-width:40vw;
  background:#0f141b;
  border:1px solid #223041; color:var(--text);
  border-radius:999px; padding:10px 14px 10px 40px;
  outline:none; transition:border-color .15s, box-shadow .15s;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239fb1c3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:12px 50%;
}
.topsearch input:focus{ border-color:#3c7cff; box-shadow:0 0 0 3px rgba(60,124,255,.15) }
@media (max-width:860px){ .topsearch{ display:none } }

/* 4) GRID + CARDS */
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(200px,1fr));
  gap:16px;
}
@media (min-width:1100px){ .grid{ gap:18px } }

.card{
  background:var(--panel);
  border:1px solid #1e2733;
  border-radius:var(--r);
  overflow:hidden;
  box-shadow:var(--elev);
  transition:transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.card:hover{ transform:translateY(-3px); border-color:#2c3b4e; box-shadow:0 10px 28px rgba(0,0,0,.45) }
.thumb{
  width:100%; aspect-ratio:16/9; object-fit:cover;
  background:#0d0f13; border-bottom:1px solid #1c2531;
}

.card h3{
  font-size:15px; line-height:1.35; font-weight:750;
  padding:10px 12px; margin:0; min-height:48px;
}
.card h3 .ver{ font-weight:500; color:var(--muted); font-size:13px }

/* micro */
.card a:hover h3{ text-decoration:underline }

/* chips */
.metachips{ display:flex; gap:6px; flex-wrap:wrap; padding:0 12px 12px }
.chip{
  font-size:11px; color:#c4d0dc;
  border:1px solid #2a394a;
  background:linear-gradient(180deg,#0f141b,#0c1117);
  border-radius:999px; padding:4px 8px;
}
.badge-new{ background:#1f2b16; color:#c8f7a1; border-color:#27401b }

/* trending badge hook */
.card.hot h3::before{
  content:"HOT";
  display:inline-block;
  margin-right:6px;
  padding:2px 6px;
  border-radius:999px;
  font-size:10px;
  line-height:1;
  font-weight:800;
  letter-spacing:.02em;
  color:#fff;
  background:#d9480f;
  border:1px solid #f97316;
  vertical-align:middle;
}

/* 5) GAME PAGE */
body[data-page="single"]{
  background:
    radial-gradient(900px 420px at 85% 18%, rgba(60,124,255,.14), transparent 60%),
    radial-gradient(700px 360px at 18% 44%, rgba(34,211,238,.08), transparent 62%),
    var(--bg);
}
.game-hero{ display:grid; gap:20px; grid-template-columns:1.4fr 1fr }
.game-hero img{ border-radius:var(--r); border:1px solid var(--line) }
.meta{ color:var(--muted); font-size:13px; margin:8px 0; opacity:.9 }
.byline{
  color:var(--muted);
  font-size:13px;
  line-height:1.25;
  margin:-6px 0 10px;
}
.byline a{ color:inherit; text-decoration:underline }
.byline a:hover{ text-decoration:none }
.single-main,
.related-panel{
  background:linear-gradient(180deg, rgba(15,20,27,.94), rgba(11,15,20,.95));
  border:1px solid #1f2a37;
  border-radius:16px;
  padding:16px;
  box-shadow:var(--elev);
}
.single-main h1{
  font-size:46px;
  line-height:1.08;
  margin-bottom:8px;
}
.single-main h1 .ver{
  color:#b8c8da;
  font-weight:600;
}
.single-hero-media{
  margin:12px 0 14px;
}
.single-hero-media .thumb{
  border-radius:18px;
  box-shadow:0 18px 44px rgba(0,0,0,.45);
}
.single-play-stats{
  margin:0 0 10px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 11px;
  border:1px solid #2b4060;
  border-radius:999px;
  background:#0f1a27;
  color:#c8dbf3;
}
.game-desc{
  font-size:19px;
  line-height:1.55;
  color:#dde7f2;
  max-width:74ch;
  margin:0 0 8px;
}
.single-actions{
  margin:12px 0 6px;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.single-actions .playbtn{
  margin:0;
}
.single-actions .supportbar{
  margin:0;
}
.single-subhead{
  font-size:24px;
  margin:4px 0 12px;
  font-weight:800;
}
.single-meta-box{
  margin-top:14px;
  border:1px solid #243142;
  background:#0e141c;
  border-radius:12px;
  padding:10px 12px;
}
.single-meta-box .meta{
  margin:4px 0;
  font-size:12px;
  line-height:1.3;
}
.related-panel #related{
  grid-template-columns:repeat(2,minmax(200px,1fr));
}
.related-panel .card{
  box-shadow:none;
}

/* keep play area visible on desktop */
@media (min-width:1000px){
  .game-hero{ align-items:start }
  .game-hero > div:first-child{ position:sticky; top:92px }
}

/* 6) BUTTONS */
.playbtn{
  display:inline-block; margin:10px 0; padding:13px 18px;
  border-radius:12px; border:0; color:#fff; font-weight:800; font-size:15px;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  box-shadow:0 6px 18px rgba(60,124,255,.28);
  transition:filter .15s ease;
}
.playbtn:hover{ filter:brightness(1.08) }

.supportbar{ display:flex; gap:10px; flex-wrap:wrap; margin:12px 0 }
.supportbtn{
  display:inline-block; padding:10px 14px; border-radius:10px;
  color:#fff; font-size:14px; font-weight:700;
  background:#182130; border:1px solid #2b3a4b;
  transition:background .2s, border-color .2s;
}
.supportbtn:hover{ background:#1b2636 }
.supportbtn.patreon{ background:#ff424d; border-color:#ff6b79 }
.supportbtn.kofi{ background:#29abe0; border-color:#54c3ee }
.supportbtn.subscribestar{ background:#2b8a3e; border-color:#3aa952 }

/* 7) SECTION HEADERS */
.section h2, .container > h2{
  font-size:22px; font-weight:800; letter-spacing:.2px; margin-bottom:12px;
}
.section h2::after,
.container > h2::after{
  content:"";
  display:block;
  height:4px;
  width:min(260px, 40%);
  margin-top:10px;
  background:linear-gradient(90deg, var(--brand), var(--brand-2) 70%, transparent);
  border-radius:999px;
  opacity:1;
  box-shadow:0 0 0 1px rgba(60,124,255,.18),
             0 4px 12px rgba(60,124,255,.25);
}

.badge-updated{ background:#2a6; color:#fff; }

.footer-link {
  color: #aaa;
  text-decoration: none;
}
.footer-link:hover {
  text-decoration: underline;
  color: #fff;
}

/* Discovery blocks */
.tag-cloud, .quick-filters{
  display:flex; flex-wrap:wrap; gap:8px;
}
.mobile-only{ display:none }

/* Archive controls */
.controls{
  display:grid;
  gap:10px;
  grid-template-columns:2fr 1fr 1fr 1fr auto auto;
  align-items:start;
  margin-bottom:12px;
}
.controls input,
.controls select{
  width:100%;
  background:#0f141b;
  border:1px solid #223041;
  color:var(--text);
  border-radius:10px;
  padding:10px 12px;
}
.empty-state{
  border:1px solid #2a394a;
  background:#0f141b;
  border-radius:12px;
  padding:14px;
  margin:10px 0 16px;
}

/* Card metadata */
.card-meta{
  color:var(--muted);
  font-size:12px;
  line-height:1.3;
  padding:0 12px 8px;
  opacity:.92;
}

.card-all-games-thumb{
  display:grid;
  place-items:center;
  color:#dbe8ff;
  font-weight:800;
  font-size:24px;
  letter-spacing:.2px;
  background:linear-gradient(135deg, #15305d, #1d3f7a 60%, #2962c9);
}

@media (max-width:980px){
  .controls{ grid-template-columns:1fr 1fr }
}

/* 8) ADS */
.ad{
  display:flex; align-items:center; justify-content:center;
  border:1px dashed #2b3a4b; border-radius:12px;
  color:#8aa0b6; background:#0f141b;
}
.ad.top{ min-height:90px; margin:14px 0 }
.ad.single{ min-height:250px; margin:16px 0 }
.ad.filled{ border:0; background:transparent; color:inherit }
.ad.hidden{ display:none !important }

/* loader-added helper */
.ad-slot{ display:block; background:#0f141b; border:1px dashed #2b3a4b }
.ad-slot.filled{ background:transparent; border:none }

/* iframes */
.ad.top iframe{
  width:100%; max-width:728px; height:90px;
  border:0; display:block; margin:0 auto;
}
@media (max-width:768px){
  .ad.top{ min-height:62px; }
  .ad.top iframe{
    max-width:320px;
    height:62px;
  }
}
/* only single keeps fixed 300x250; grid is styled like a card below */
.ad.single iframe{
  width:300px; height:250px;
  border:0; display:block; margin:0 auto;
}
.ad.skyscraper{
  min-height:612px;
  margin:14px auto 0;
  width:160px;
  max-width:100%;
}
.ad.skyscraper iframe{
  width:160px;
  height:612px;
  border:0;
  display:block;
  margin:0 auto;
}

/* Sticky ad shell (game page) */
.cws-sticky-wrap{
  position:fixed;
  right:16px;
  bottom:16px;
  z-index:60;
  display:flex;
  align-items:flex-start;
  gap:6px;
}
.cws-sticky-wrap.hidden{
  display:none !important;
}
.cws-sticky-wrap .ad.sticky{
  min-height:0;
  margin:0;
  border-radius:10px;
  overflow:hidden;
  box-shadow:0 12px 30px rgba(0,0,0,.45);
}
.ad.sticky iframe{
  width:300px;
  height:250px;
  border:0;
  display:block;
}
.cws-sticky-close{
  border:1px solid #304359;
  background:#0f1a27;
  color:#c7d7eb;
  border-radius:999px;
  width:24px;
  height:24px;
  line-height:1;
  font-size:14px;
  cursor:pointer;
}
.cws-sticky-close:hover{
  border-color:#3f5f81;
  background:#122033;
}
@media (max-width:768px){
  .cws-sticky-wrap{
    right:50%;
    transform:translateX(50%);
    bottom:12px;
  }
  .ad.sticky iframe{
    width:300px;
    height:50px;
  }
}

/* Grid ads: same size as cards, centered creative */
.grid > .ad.grid{ grid-column:span 1; min-width:0 }
.ad.grid{
  position:relative;
  display:grid; place-items:center;
  background:var(--panel);
  border:1px solid #1e2733;
  border-radius:var(--r);
  box-shadow:var(--elev);
  overflow:hidden;
  transition:transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  aspect-ratio:300/250;
}
.ad.grid:hover{
  transform:translateY(-2px);
  border-color:#2c3b4e;
  box-shadow:0 10px 28px rgba(0,0,0,.45);
}
.ad.grid .ad-frame{
  width:100%; height:100%;
  display:grid; place-items:center;
  padding:0;
}
.ad.grid iframe{
  width:100%;
  height:100%;
  max-height:100%;
  border:0; display:block;
}
.ad.grid::after{
  content:"Sponsored";
  position:absolute; top:10px; left:10px;
  font:600 11px/1.2 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  color:#fff; background:#22c55e; padding:4px 8px; border-radius:999px;
  letter-spacing:.02em; opacity:.95;
}

/* 9) RESPONSIVE */
@media (max-width:1000px){ .game-hero{ grid-template-columns:1fr } }
@media (max-width:720px){
  .brand{ font-size:18px }
  .header{ flex-wrap:wrap }
  .nav-toggle{ display:inline-block }
  .nav{
    display:none;
    width:100%;
    order:3;
    padding-top:8px;
  }
  body.mobile-nav-open .nav{ display:flex }
  .mobile-only{ display:block }
  .controls{ grid-template-columns:1fr }
  .btn-discord span{ display:none }
  .single-main h1{ font-size:35px }
  .game-desc{ font-size:18px; line-height:1.5 }
  .single-main,
  .related-panel{ padding:12px }
  .related-panel #related{ grid-template-columns:1fr }
  .ad.skyscraper{ display:none !important }
  .c-head{ flex-direction:column; align-items:flex-start }
  .c-head-right{ width:100%; justify-content:space-between }

}

/* Comments */
.comments{ margin:18px 0 }
.comments-panel{
  margin-top:16px;
  border:1px solid #243142;
  border-radius:14px;
  background:linear-gradient(180deg,#0f141b,#0c1118);
  padding:12px;
}
.c-form{
  display:grid; gap:10px; margin-bottom:14px;
  background:#0f141b;
  border:1px solid #223041;
  border-radius:14px;
  padding:12px;
}
.c-input{
  background:#0f141b; border:1px solid #223041;
  color:var(--text); border-radius:10px; padding:10px 12px;
}
.c-text{
  min-height:100px; resize:vertical; background:#0f141b;
  border:1px solid #223041; color:var(--text); border-radius:10px; padding:10px 12px;
}
.c-actions{ display:flex; justify-content:flex-end }
.c-list{ display:grid; gap:12px }
.c-item{
  background:linear-gradient(180deg,#0f141b,#0d1218);
  border:1px solid #233141;
  border-radius:14px; padding:12px;
  box-shadow:0 6px 18px rgba(0,0,0,.25);
}
.c-head{
  color:#c4d0dc; font-size:13px; margin-bottom:8px;
  display:flex; justify-content:space-between; align-items:flex-start; gap:10px;
}
.c-author{ display:flex; align-items:center; gap:8px; min-width:0 }
.c-avatar{
  width:26px; height:26px; border-radius:50%;
  display:inline-grid; place-items:center;
  color:#dce9fb; font-size:12px; font-weight:800;
  background:linear-gradient(135deg,#274b85,#17315a);
  border:1px solid #35568d;
}
.c-head-right{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end }
.c-time{ color:#9fb1c3; font-weight:500; white-space:nowrap }
.c-tools{ display:flex; align-items:center; gap:6px }
.c-btn{
  border:1px solid #304359;
  background:#0f1a27;
  color:#c7d7eb;
  border-radius:999px;
  padding:4px 9px;
  font-size:11px;
  font-weight:700;
  cursor:pointer;
}
.c-btn:hover{ border-color:#3f5f81; background:#122033 }
.c-btn:disabled{ opacity:.6; cursor:wait }
.c-body{ white-space:pre-wrap; word-wrap:break-word; line-height:1.4 }
.c-more{
  margin-top:10px; background:#0f141b; border:1px solid #223041;
  color:var(--text); border-radius:10px; padding:10px 12px; cursor:pointer;
}
.c-more:hover{ border-color:#2c3b4e }
.header-cta{ display:flex; align-items:center; gap:10px }
.btn-discord{
  display:inline-flex; align-items:center; gap:8px;
  padding:9px 12px; border-radius:999px;
  border:1px solid #2a3f6a; background:#112341; color:#cfe2ff;
  font-size:12px; font-weight:700;
}
.btn-discord:hover{ border-color:#3b5da2; background:#17305a }


