:root{
  --bg:#070A12;
  --fg:#EAF0FF;
  --muted: rgba(234,240,255,.72);

  --glassA: rgba(15,18,33,.58);
  --glassB: rgba(15,18,33,.30);

  --border: rgba(234,240,255,0.12);
  --borderSoft: rgba(234,240,255,0.09);

  --accent:#7CF7FF;
  --accent2:#B88CFF;

  --radius: 18px;
  --shadow: 0 12px 34px rgba(0,0,0,.50);

  --max: 1500px;
  --pad: 16px;
  --gap: 14px;
}

/* ===== Base ===== */
*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--fg);
  background:
  radial-gradient(1100px 800px at 20% 12%, rgba(184,140,255,0.12), transparent 60%),
  radial-gradient(900px 650px at 80% 22%, rgba(124,247,255,0.10), transparent 55%),
  radial-gradient(900px 900px at 50% 92%, rgba(124,247,255,0.06), transparent 60%),
  var(--bg);
  min-height:100vh;
  overflow-x:hidden;
  line-height: 1.5;
}

#starfield{
position: fixed;
inset: 0;
width:100%;
height:100%;
z-index: 0;
opacity: .62;
}

a{ color: inherit; }
.muted{ color: var(--muted); }

/* ===== Layout ===== */
.container{
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px 16px 64px;
}

.section{
  margin-top: 26px;
  padding-top: 10px;
}

.grid{
  display:grid;
  gap: var(--gap);
  margin-top: 16px;
}

/* ===== Topbar ===== */
.topbar{
  position: sticky;
  top: 0;
  z-index: 10;

  display:flex;
  align-items:center;
  justify-content:space-between;

  padding: 14px max(16px, calc((100vw - var(--max))/2));
  backdrop-filter: blur(12px);

  background: linear-gradient(to bottom, rgba(7,10,18,0.82), rgba(7,10,18,0.42));
  border-bottom: 1px solid rgba(234,240,255,0.10);
}

.brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color: var(--fg);
}

.brandMark{
  width: 12px;
  height: 12px;
  border-radius: 6px;
  background:
  radial-gradient(circle at 30% 30%, var(--accent), transparent 62%),
  radial-gradient(circle at 70% 70%, var(--accent2), transparent 62%),
  rgba(255,255,255,0.10);
  box-shadow: 0 0 18px rgba(124,247,255,0.22),
  0 0 18px rgba(184,140,255,0.18);
}

.brandText{
  font-weight: 850;
  letter-spacing: .4px;
}

.nav{ display:flex; gap: 10px; }
.nav a{
  text-decoration:none;
  color: var(--muted);
  font-weight: 750;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.nav a:hover{
  color: var(--fg);
  background: rgba(255,255,255,0.03);
  border-color: rgba(234,240,255,0.10);
}
.nav a.active{
  color: var(--fg);
  background: rgba(255,255,255,0.03);
  border-color: rgba(124,247,255,0.18);
}

/* ===== Headers ===== */
.pageHeader h1{
  margin: 10px 0 6px;
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: -0.02em;
}
.pageHeader p{ margin:0; }

/* ===== Surfaces ===== */
.card, .panel{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--glassA), var(--glassB));
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.card{ padding: var(--pad); }

.panel{
  margin-top: 20px;
}
.panel.wide{
  grid-column: 1 / -1;
}
.panelBody{
  padding: 14px;
}

/* ===== Card header ===== */
.cardTop{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.card h3{
  margin: 0;
  font-size: 16px;
}

.badge{
  font-size: 12px;
  color: var(--muted);
  border: 1px solid rgba(234,240,255,0.11);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
}

/* ===== Copy Row (index.html) ===== */
.copyRow{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.copyRow code{
  flex: 1;
  padding: 8px 12px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--borderSoft);
  border-radius: 10px;
  font-size: 14px;
  color: var(--accent);
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
}

/* ===== System: stat rows ===== */
.statRow{
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid rgba(234,240,255,0.08);
}

.statRow:first-of-type{
  border-top: none;
  padding-top: 6px;
}

.label{
  color: var(--muted);
  font-weight: 750;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.value{
  font-weight: 850;
  word-break: break-word;
  color: var(--fg);
  font-size: 15px;
}

/* ===== Buttons ===== */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration:none;
  font-weight: 850;
  border: 1px solid var(--border);
  color: var(--fg);
  background: rgba(255,255,255,0.03);
  cursor:pointer;
  font-size: 14px;
  transition: all 150ms ease;
}
.btn:hover{
  border-color: rgba(124,247,255,0.25);
  background: rgba(255,255,255,0.06);
}

/* ===== GAMES PAGE ===== */

/* Game wrapper */
.gameWrap{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Game header (title + status) */
.gameHead{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
}

.gameTitle{
  margin: 0;
  font-size: 18px;
  font-weight: 850;
  color: var(--fg);
}

/* Status indicators */
.status{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 750;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--borderSoft);
}

.status-on{
  color: #10E856;
  background: rgba(16,232,86,0.08);
  border-color: rgba(16,232,86,0.25);
}

.status-off{
  color: #FF4444;
  background: rgba(255,68,68,0.08);
  border-color: rgba(255,68,68,0.20);
}

.status .dot{
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: block;
}

.status-on .dot{
  background: #10E856;
  box-shadow: 0 0 10px rgba(16,232,86,0.8), 0 0 4px rgba(16,232,86,1);
}

.status-off .dot{
  background: #FF4444;
  box-shadow: 0 0 10px rgba(255,68,68,0.6), 0 0 4px rgba(255,68,68,1);
}

/* Game card */
.gameCard{
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--glassA), var(--glassB));
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  padding: var(--pad);
  text-decoration: none;
  color: inherit;
  transition: all 200ms ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.gameCard::before{
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(124,247,255,0.03) 100%);
  opacity: 0;
  transition: opacity 200ms ease;
}

.gameCard:hover::before{
  opacity: 1;
}

.gameCard:hover{
  border-color: rgba(124,247,255,0.25);
  transform: translateY(-2px);
}

.gameInner{
  position: relative;
  z-index: 1;
}

/* Key-value pairs in game cards */
.kv{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.kvRow{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 4px 0;
}

.kvRow .k{
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.kvRow .v{
  color: var(--fg);
  font-size: 14px;
  font-weight: 850;
  text-align: right;
}

/* Pills */
.pillRow{
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill{
  display: inline-block;
  font-size: 11px;
  font-weight: 750;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(234,240,255,0.10);
  padding: 4px 10px;
  border-radius: 999px;
}

/* ===== Footer & Toast ===== */
.footer{
  margin-top: 40px;
  border-top: 1px solid rgba(234,240,255,0.10);
  padding-top: 16px;
  text-align: center;
}

/* ===== Age Counter (about.html) ===== */
.ageCounter{
  margin-top: 20px;
  padding: 32px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--glassA), var(--glassB));
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  text-align: center;
}

.ageLabel{
  font-size: 13px;
  font-weight: 750;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.ageDisplay{
  font-size: clamp(16px, 2.5vw, 24px);
  font-weight: 850;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.ageNum{
  color: var(--accent);
  font-size: clamp(18px, 3vw, 28px);
  margin-right: 6px;
}

@media (max-width: 640px){
  .ageDisplay{
    font-size: 16px;
    gap: 12px;
  }
  .ageNum{
    font-size: 20px;
  }
}

.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(15,18,33,0.85);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--fg);
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

/* ===== Responsive Grid Systems ===== */

/* Default: 1 column */
.grid.accounts,
.grid.games,
.grid.cards{
  grid-template-columns: 1fr;
}

/* Medium screens: 2 columns */
@media (min-width: 640px){
  .grid.accounts,
  .grid.games,
  .grid.cards{
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large screens: 3 columns */
@media (min-width: 900px){
  .grid.accounts,
  .grid.games,
  .grid.cards{
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== Additional Responsive Tweaks ===== */
@media (max-width: 520px){
  .nav{ gap: 6px; }
  .nav a{ padding: 8px 8px; }

  .gameHead{
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .kvRow{
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .kvRow .v{
    text-align: left;
  }
}
