/* GemHack — gamesense-inspired panel theme (rounded).
   Dark grey beveled gradient panels, lime-green accent, signature rainbow divider,
   rounded corners. 8-bit display font for titles, MS Sans pixel for body. No emojis. */

@font-face {
  font-family: 'PixelSans';
  src: url('/assets/ms_sans_serif.woff2') format('woff2'),
       url('/assets/ms_sans_serif.woff') format('woff');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'PixelSans';
  src: url('/assets/ms_sans_serif_bold.woff2') format('woff2'),
       url('/assets/ms_sans_serif_bold.woff') format('woff');
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: 'PixelTitle';
  src: url('/assets/8bitoperator.ttf') format('truetype');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'PixelTitle';
  src: url('/assets/8bitoperator-bold.ttf') format('truetype');
  font-weight: 700; font-display: swap;
}

:root {
  --bg:       #0e0e0f;
  --panel-a:  #2f2f30;
  --panel-b:  #161617;
  --bg2:      #1b1b1d;
  --bg3:      #242427;
  --border:   #3a3a3d;
  --border-hi:#4a4a4e;
  --border-lo:#0e0e0f;
  --accent:   #366aac;
  --accent-l: #4f86cc;
  --accent-d: #24466f;
  --gold:     #ffcf5c;
  --text:     #d4d4d4;
  --muted:    #8a8a8a;
  --danger:   #ff5b5b;
  --shadow:   #000;
  --r:        10px;   /* panels */
  --r-sm:     7px;    /* controls */
  /* signature bar: static blue -> navy(lacivert) -> light blue (no animation) */
  --bar: linear-gradient(90deg, #2f7dff 0%, #0a1a5e 50%, #86d6ff 100%);
}

.rainbow, hr {
  height: 3px; border: none; margin: 16px 0; padding: 0; border-radius: 2px;
  background-image: var(--bar);
}

* { box-sizing: border-box; }

body {
  margin: 0; min-height: 100vh; color: var(--text);
  font-family: 'PixelSans', Tahoma, 'MS Sans Serif', sans-serif;
  font-size: 15px; -webkit-font-smoothing: none;
  background: var(--bg);
}

.brand, .side-brand, h2, h4, .stat .num, .game-card .hd b { font-family: 'PixelTitle', 'PixelSans', monospace; }
h2, h4 { margin: 0 0 12px; text-transform: uppercase; letter-spacing: 1px; }
h2 { font-size: 22px; color: #fff; }
h4 { font-size: 14px; color: var(--accent); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-l); text-decoration: underline; }
.muted { color: var(--muted); }
.center { text-align: center; }
code { font-family: 'Courier New', monospace; background: #0c0c0d; border: 1px solid var(--border); color: var(--accent); padding: 1px 5px; border-radius: 4px; }

.gem-diamond {
  width: 46px; height: 46px; margin: 0 auto;
  background: var(--accent); transform: rotate(45deg); border-radius: 8px;
  box-shadow: inset -7px -7px 0 rgba(0,0,0,.25);
}

/* ============ centered shell (landing / auth) ============ */
.app { max-width: 400px; margin: 0 auto; padding: 44px 16px; }
.topbar-solo {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; position: relative; overflow: hidden;
  background: linear-gradient(to bottom, var(--panel-a), var(--panel-b));
  border: 1px solid var(--border); border-top-color: var(--border-hi);
  border-radius: var(--r) var(--r) 0 0;
}
.topbar-solo::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background-image: var(--bar);
}
.brand { font-weight: 700; font-size: 22px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--accent); text-shadow: 0 0 8px rgba(54,106,172,.4); }
.brand::after { content: '_'; animation: blink 1.1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.panel { padding: 22px; background: var(--bg2); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--r) var(--r); }
.cap { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }

/* ============ dashboard shell (centered frame: sidebar + main) ============ */
body.app-layout { display: flex; justify-content: center; padding: 36px 24px; }
.shell { width: 100%; max-width: 1160px; display: grid; grid-template-columns: 232px 1fr; gap: 22px; align-items: start; }

.sidebar {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border); border-top-color: var(--border-hi);
  border-radius: var(--r); min-height: 600px;
}
.side-brand {
  position: relative;
  padding: 18px 16px; font-weight: 700; font-size: 19px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent);  background: linear-gradient(to bottom, var(--panel-a), var(--panel-b));
}
.side-brand::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background-image: var(--bar);
}
.side-nav { display: flex; flex-direction: column; padding: 12px 10px; gap: 3px; flex: 1; }
.side-nav a {
  display: block; padding: 10px 12px; color: var(--text); font-size: 12px; border-radius: var(--r-sm);
  text-transform: uppercase; letter-spacing: 1px; border-left: 3px solid transparent;
}
.side-nav a:hover { background: var(--bg3); color: #fff; text-decoration: none; }
.side-nav a.active { background: var(--bg3); color: var(--accent); border-left-color: var(--accent); }
.side-foot { padding: 14px 12px; border-top: 1px solid var(--border); font-size: 12px; }
.side-user { margin-bottom: 8px; color: var(--muted); }
.side-logout { display: inline-block; color: var(--danger); text-transform: uppercase; font-size: 11px; letter-spacing: 1px; }

.main {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border); border-top-color: var(--border-hi);
  border-radius: var(--r); min-height: 600px;
}
.topbar {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 22px;
  background: linear-gradient(to bottom, var(--panel-a), var(--panel-b));
}
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background-image: var(--bar);
}
.topbar .cap.title { font-size: 13px; color: var(--accent); }
.content { padding: 22px; flex: 1; }
.notice {
  margin: 16px 22px 0; padding: 10px 14px; font-size: 13px; color: var(--gold);
  background: rgba(255,207,92,.08); border: 1px solid #7a6320; border-radius: var(--r-sm);
}
.notice button { margin: 0 4px; vertical-align: middle; }

@media (max-width: 680px) {
  body.app-layout { padding: 18px 12px; }
  .shell { grid-template-columns: 1fr; gap: 16px; }
  .sidebar { min-height: auto; }
  .side-nav { flex-direction: row; flex-wrap: wrap; flex: none; }
  .side-nav a { flex: 1 1 auto; text-align: center; border-left: none; border-bottom: 3px solid transparent; }
  .side-nav a.active { border-left: none; border-bottom-color: var(--accent); }
}

/* ============ cards / stats ============ */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 8px; }
.card { padding: 16px; background: var(--bg3); border: 1px solid var(--border); border-top-color: var(--border-hi); border-radius: var(--r-sm); }
.card:hover { border-color: var(--accent); }
.card.link { cursor: pointer; }
.stat .num { font-size: 30px; color: var(--accent); line-height: 1; }
.stat .lbl { margin-top: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }

/* profile */
.profile-head { display: flex; align-items: center; gap: 18px; }
.avatar {
  width: 76px; height: 76px; flex: none; border-radius: 12px; overflow: hidden;
  background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: 'PixelTitle', monospace; font-size: 32px; color: var(--accent);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.qr { width: 176px; height: 176px; border: 6px solid #fff; border-radius: 6px; background: #fff; image-rendering: pixelated; display: block; }

/* game card (store) */
.game-card { background: var(--bg3); border: 1px solid var(--border); border-top-color: var(--border-hi); border-radius: var(--r-sm); overflow: hidden; margin-bottom: 16px; }
.game-card .hd {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
  background: linear-gradient(to bottom, var(--panel-a), var(--panel-b));
  border-bottom: 1px solid var(--border-lo);
}
.game-card .hd b { font-size: 15px; letter-spacing: 1px; text-transform: uppercase; color: #fff; }
.product-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); gap: 12px; }
.product-row:last-child { border-bottom: none; }
.product-row .price { color: var(--accent); font-weight: 700; white-space: nowrap; }

/* ============ shoutbox (gamesense-style) ============ */
.shoutbox { border: 1px solid var(--border); border-top-color: var(--border-hi); border-radius: var(--r-sm); overflow: hidden; background: var(--bg3); }
.shoutbox .sb-list { max-height: 220px; overflow-y: auto; padding: 6px 0; }
.shout { padding: 5px 12px; font-size: 13px; }
.shout .u { color: var(--accent); font-weight: 700; margin-right: 6px; }
.shout .t { color: #55565a; font-size: 10px; margin-left: 6px; }
.shout .ping { color: var(--gold); font-weight: 700; text-decoration: none; }
.shout a.ping:hover { text-decoration: underline; }
.shout.sys .u { color: var(--accent); }
.shout .del { margin-left: 8px; color: #55565a; cursor: pointer; font-weight: 700; }
.shout .del:hover { color: var(--danger); }
.shoutbox .sb-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.shoutbox .sb-input input { flex: 1; }

/* ============ controls ============ */
button {
  font-family: inherit; font-size: 12px; cursor: pointer;
  text-transform: uppercase; letter-spacing: 1px;
  color: #fff; border: 1px solid var(--accent-d); border-radius: var(--r-sm);
  background: linear-gradient(to bottom, var(--accent-l), var(--accent));
  padding: 8px 16px;
}
button:hover { background: linear-gradient(to bottom, #5f94d6, var(--accent-l)); }
button:active { transform: translateY(1px); }
button.ghost {
  color: var(--text); background: linear-gradient(to bottom, #3a3a3d, #232326);
  border: 1px solid var(--border); border-top-color: var(--border-hi);
  padding: 6px 13px;
}
button.ghost:hover { color: var(--accent); border-color: var(--accent); }

input, textarea, select {
  font-family: inherit; font-size: 14px; width: 100%;
  color: var(--text); background: #0c0c0d;
  border: 1px solid var(--border); border-top-color: var(--border-lo); border-radius: var(--r-sm); padding: 8px 10px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(54,106,172,.2); }
textarea { resize: vertical; }
label { display: block; margin-bottom: 5px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.field-row-stacked { margin-bottom: 12px; }
.err { color: var(--danger); margin: 8px 0; min-height: 1em; font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }

/* ============ tabs ============ */
.tabs a { display: inline-block; padding: 6px 13px; margin: 0 3px 4px 0; color: var(--text);
  background: linear-gradient(to bottom, #3a3a3d, #232326);
  border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.tabs a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ============ lists ============ */
ul.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--bg2); }
ul.list li { padding: 11px 13px; border-bottom: 1px solid #242427; }
ul.list li:last-child { border-bottom: none; }
ul.list li:hover { background: var(--bg3); }
ul.list li a { color: var(--accent); }

/* ============ badges ============ */
.badge { display: inline-block; padding: 1px 7px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); background: #0c0c0d; border: 1px solid var(--border); border-radius: 5px; }
.badge.ok { color: var(--accent); border-color: var(--accent-d); }
.badge.warn { color: var(--gold); border-color: #7a6320; }
.badge.admin { color: #fff; background: var(--accent); border-color: var(--accent); font-weight: 700; }

/* ============ auth page (login / register) — same language as the panel ============ */
body.authpage {
  display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px;
  background: var(--bg);
  background-image:
    linear-gradient(rgba(54,106,172,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54,106,172,.05) 1px, transparent 1px);
  background-size: 32px 32px;
}
.auth-window {
  width: 100%; max-width: 380px; overflow: hidden;
  border: 1px solid var(--border); border-top-color: var(--border-hi); border-radius: var(--r);
  box-shadow: 6px 6px 0 var(--shadow);
}
.auth-hd {
  position: relative; padding: 18px; text-align: center;
  background: linear-gradient(to bottom, var(--panel-a), var(--panel-b));
  font-family: 'PixelTitle', monospace; color: var(--accent);
  font-size: 24px; letter-spacing: 4px; text-transform: uppercase;
}
.auth-hd::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background-image: var(--bar);
}
.auth-body { background: var(--bg2); padding: 22px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.auth-tabs .tab {
  flex: 1; cursor: pointer; padding: 9px 0; font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text); border: 1px solid var(--border); border-top-color: var(--border-hi); border-radius: var(--r-sm);
  background: linear-gradient(to bottom, #3a3a3d, #232326);
}
.auth-tabs .tab:hover { color: var(--accent); border-color: var(--accent); }
.auth-tabs .tab.active { color: #fff; border-color: var(--accent-d); background: linear-gradient(to bottom, var(--accent-l), var(--accent)); }
.auth-form { display: flex; flex-direction: column; }
.auth-form.hidden { display: none; }
.auth-form .btn-block { width: 100%; margin-top: 4px; padding: 11px; }
.auth-form .err { text-align: center; margin: 4px 0 10px; }

/* ============ forum posts ============ */
.post { border: 1px solid var(--border); border-top-color: var(--border-hi); background: var(--bg3); border-radius: var(--r-sm); padding: 12px; margin: 10px 0; white-space: pre-wrap; word-break: break-word; }
.post .meta { color: var(--muted); font-size: 11px; margin-bottom: 6px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
