/* ------------------------------------------------------------------------
   Layout: game stage on the left, streamer panel on the right.
   ------------------------------------------------------------------------ */
:root {
  --bg: #0b0c12;
  --panel: #161824;
  --panel-border: #262a3b;
  --text: #e8eaf2;
  --muted: #8b90a6;
  --accent: #fe2c55;      /* TikTok red */
  --accent-2: #25f4ee;    /* TikTok cyan */
  --ok: #3ddc84;
  --warn: #ffb02e;
  --err: #ff5c6c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  overflow: hidden;
}

body {
  display: flex;
}

#stage {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100vh;
}

#game {
  width: 100%;
  height: 100%;
}

/* ------------------------------------------------------------------------
   Panel
   ------------------------------------------------------------------------ */
#panel {
  width: 320px;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--panel);
  border-left: 1px solid var(--panel-border);
  padding: 16px;
}

body.panel-hidden #panel { display: none; }

#show-panel-btn {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0.25;
}
#show-panel-btn:hover { opacity: 1; }
body.panel-hidden #show-panel-btn { display: block; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

h1 { font-size: 18px; margin: 0; }
h2 { font-size: 14px; margin: 0 0 10px; color: var(--accent-2); }
h3 { font-size: 12px; margin: 14px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

section {
  padding: 14px 0;
  border-top: 1px solid var(--panel-border);
}

label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.at { color: var(--muted); font-weight: 600; }

input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  background: #0f1119;
  color: var(--text);
  font-size: 14px;
}
input:focus { outline: 2px solid var(--accent-2); outline-offset: -1px; }

button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  background: #22263a;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
button:hover:not(:disabled) { background: #2d3250; }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); font-weight: 600; }
button.primary:hover:not(:disabled) { background: #ff4b6e; }
button.small { flex: none; padding: 4px 8px; font-size: 12px; }
button.wide { width: 100%; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.grid .wide { grid-column: span 2; }

.status {
  margin: 4px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #0f1119;
  font-size: 13px;
}
.status::before { content: "● "; }
.status-idle::before,
.status-disconnected::before { color: var(--muted); }
.status-connecting::before { color: var(--warn); }
.status-connected::before { color: var(--ok); }
.status-error::before { color: var(--err); }
.status-error { color: var(--err); }

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 8px 0 0;
}

code {
  background: #0f1119;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 11px;
}

/* Home button (panel header) */
.panel-header { gap: 8px; }
.panel-header h1 { flex: 1; }
.home-btn {
  flex: none;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--accent-2, #25f4ee);
  background: rgba(37, 244, 238, 0.12);
  color: var(--text, #e8eaf2);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.home-btn:hover { background: rgba(37, 244, 238, 0.25); }
