/* The single-page site shell: tabs for the game, Verity, and the prompt chat */
:root {
  --bg: #030712;
  --panel: rgba(15, 23, 42, 0.94);
  --border: #1e293b;
  --green: #4ade80;
  --cyan: #22d3ee;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --display: 'Orbitron', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: 'Inter', system-ui, sans-serif;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  background: rgba(2, 6, 23, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.brand {
  font-family: var(--display);
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 0.2em;
  color: var(--green);
  white-space: nowrap;
}
.brand span { color: var(--cyan); }
.tag {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
  white-space: nowrap;
}

.tabs { display: flex; gap: 6px; }
.tab {
  font: 600 12px 'Inter', system-ui, sans-serif;
  color: #cbd5e1;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tab:hover { background: #1e293b; color: #fff; }
.tab[aria-selected="true"] {
  color: #052e16;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  border-color: transparent;
}
.tab:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

main { position: fixed; inset: 54px 0 0; }

.frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg);
  display: none;
}
body[data-tab="game"] #gameFrame,
body[data-tab="verity"] #verityFrame,
body[data-tab="prompt"] #verityFrame { display: block; }

/* Prompt Verity chat */
.prompt-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  width: 390px;
  max-width: calc(100vw - 24px);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid rgba(74, 222, 128, 0.45);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55), 0 0 26px rgba(74, 222, 128, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
body[data-tab="prompt"] .prompt-panel { display: flex; }

.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #a7f3d0;
  background: rgba(2, 6, 23, 0.6);
  border-bottom: 1px solid var(--border);
}
.prompt-x {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.prompt-x:hover { color: #fff; }

.prompt-log {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.msg {
  max-width: 88%;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.user {
  align-self: flex-end;
  color: #052e16;
  background: linear-gradient(135deg, #86efac, #67e8f9);
  border-bottom-right-radius: 4px;
}
.msg.verity {
  align-self: flex-start;
  color: var(--text);
  background: #111c30;
  border: 1px solid #24344d;
  border-bottom-left-radius: 4px;
}
.msg.verity.thinking { color: var(--muted); font-style: italic; }
.msg.system {
  align-self: center;
  max-width: 100%;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  background: none;
  padding: 2px 6px;
}
.msg.offline { border-color: rgba(245, 158, 11, 0.5); }

.prompt-form {
  display: flex;
  gap: 7px;
  padding: 10px;
  border-top: 1px solid var(--border);
}
.prompt-form input {
  flex: 1;
  min-width: 0;
  font: 13px 'Inter', system-ui, sans-serif;
  color: var(--text);
  background: #020617;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 9px 11px;
}
.prompt-form input:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
.prompt-form button {
  font: 700 12px 'Inter', system-ui, sans-serif;
  color: #052e16;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
}
.prompt-form button:disabled { opacity: 0.55; cursor: wait; }
.prompt-note {
  margin: 0;
  padding: 0 12px 10px;
  font-size: 10px;
  color: #64748b;
}

@media (max-width: 720px) {
  .tag { display: none; }
  .site-header { gap: 8px; padding: 0 8px; }
  .brand { font-size: 14px; letter-spacing: 0.12em; }
  .tab { padding: 6px 9px; font-size: 11px; }
  .prompt-panel { top: 8px; right: 8px; bottom: 8px; left: 8px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .tab { transition: none; }
}
