/* GameHubLive Arcade — shell styles. Dark, neon-accented arcade lobby.
   Inline styles are fine under Discord's CSP (style-src allows 'unsafe-inline');
   only inline <script> is forbidden. */
:root {
  --bg: #0a0c12;
  --bg2: #10131d;
  --panel: #161b28;
  --panel2: #1c2233;
  --line: #262f44;
  --text: #eef1f8;
  --mut: #97a0b8;
  --accent: #e6b84b;
  --brand1: #7c5cff;
  --brand2: #35c2ff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(120% 80% at 15% -10%, #1a1740 0%, transparent 55%),
    radial-gradient(120% 80% at 100% 0%, #072b3a 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

/* ---------- Boot loader ---------- */
#boot-loader {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--bg); transition: opacity .35s ease; padding: 20px;
}
#boot-loader.gone { opacity: 0; pointer-events: none; }
.spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 5px solid var(--line); border-top-color: var(--brand1);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#boot-status { font-size: 13px; color: var(--mut); }
#boot-log {
  font-family: ui-monospace, Menlo, monospace; font-size: 10px; line-height: 1.5; color: #5f6a85;
  max-width: 92vw; max-height: 34vh; overflow: auto; white-space: pre-wrap; word-break: break-word;
  background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px;
}

/* ---------- Lobby ---------- */
#lobby { position: fixed; inset: 0; overflow-y: auto; padding: clamp(16px, 4vw, 40px); }
.brandbar { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.brandbar h1 {
  font-size: clamp(22px, 4vw, 34px); font-weight: 900; letter-spacing: .5px;
  background: linear-gradient(90deg, var(--brand1), var(--brand2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brandbar .tag {
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  color: #0a0c12; background: linear-gradient(180deg, #ffe08a, var(--accent));
  padding: 3px 8px; border-radius: 20px;
}
.lobby-sub { color: var(--mut); font-size: 13px; margin-bottom: 22px; }

#lobby-actions { display: flex; gap: 10px; margin: -8px 0 22px; flex-wrap: wrap; }
.action-btn {
  background: rgba(255, 255, 255, .06); color: var(--fg);
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px;
  padding: 8px 16px; font: inherit; font-size: 13px; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.action-btn:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .28); }
.action-btn:active { transform: translateY(1px); }

.tile-grid {
  display: grid; gap: clamp(12px, 2vw, 20px);
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.tile {
  position: relative; display: flex; flex-direction: column; text-align: left;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  color: var(--text); font: inherit; padding: 0;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.tile:hover, .tile:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 0 1px var(--accent) inset;
  outline: none;
}
.tile-art {
  height: 128px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(90% 90% at 50% 20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), var(--bg2);
  border-bottom: 1px solid var(--line);
}
.tile-art.emoji { font-size: 64px; line-height: 1; filter: drop-shadow(0 6px 14px rgba(0,0,0,.5)); }
.tile-art img { width: 100%; height: 100%; object-fit: cover; }
.tile-badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 9px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: #0a0c12; background: var(--accent); padding: 3px 7px; border-radius: 6px;
}
.tile-meta { padding: 12px 14px 14px; }
.tile-title { font-size: 15px; font-weight: 800; }
.tile-sub { font-size: 11.5px; color: var(--mut); margin-top: 3px; }

/* ---------- Game view ---------- */
#game-view {
  position: fixed; inset: 0; z-index: 30; background: #000;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
#game-view.active { opacity: 1; pointer-events: auto; }
#game-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #0a0c12; }
#back-btn {
  position: absolute; top: 12px; left: 12px; z-index: 32;
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--text);
  background: rgba(12,14,22,.82); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; cursor: pointer; backdrop-filter: blur(6px);
  transition: background .14s ease, border-color .14s ease;
}
#back-btn:hover { background: rgba(30,36,54,.92); border-color: var(--accent); }
#game-view-title {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 32;
  font-size: 12px; font-weight: 700; color: var(--mut);
  background: rgba(12,14,22,.7); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#game-loading {
  position: absolute; inset: 0; z-index: 31; display: flex; align-items: center; justify-content: center;
  background: var(--bg); transition: opacity .3s ease;
}
#game-loading.gone { opacity: 0; pointer-events: none; }
