/* Arcade Protocol — dark arcade aesthetic */
:root {
    --bg: #0d0d0d;
    --surface: #1a1a1a;
    --border: #333;
    --text: #e0e0e0;
    --text-dim: #888;
    --accent: #00ff9d;
    --accent-2: #ff6b35;
    --danger: #ff4444;
    --link: #5cdbff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, mono;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.container { max-width: 1000px; margin: 0 auto; padding: 1rem; flex: 1; }
header {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    background: var(--surface);
}
header nav {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
header nav a { color: var(--text-dim); text-decoration: none; font-weight: 500; }
header nav a:hover { color: var(--text); }
header nav .balance { margin-left: auto; color: var(--accent); font-weight: bold; }
footer {
    border-top: 1px solid var(--border);
    padding: 1rem;
    text-align: center;
    color: var(--text-dim);
    background: var(--surface);
}
footer a { color: var(--link); }
.btn {
    display: inline-block; padding: 0.5rem 1rem; border-radius: 4px;
    text-decoration: none; border: none; cursor: pointer;
    font-size: 0.95rem; transition: all 0.2s;
}
.btn.primary { background: var(--accent); color: #000; }
.btn.primary:hover { opacity: 0.9; }
.btn.secondary { background: var(--border); color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.disabled { opacity: 0.5; cursor: not-allowed; }
input[type="text"], input[type="email"], input[type="password"], textarea {
    width: 100%; padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 4px;
    font-family: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
.hero { text-align: center; padding: 4rem 1rem; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
.hero h1 { font-size: 2.5rem; color: var(--accent); margin-bottom: 0.5rem; }
.tagline { font-size: 1.2rem; margin-bottom: 0.5rem; }
.sub { color: var(--text-dim); }
.how-it-works { margin-bottom: 3rem; }
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}
.step {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.step h3 { color: var(--accent); margin-bottom: 0.5rem; }
.econ-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}
.econ-item {
    background: var(--surface);
    padding: 1rem;
    text-align: center;
    border-radius: 8px;
}
.econ-item .label { display: block; color: var(--text-dim); font-size: 0.85rem; }
.econ-item .value { font-size: 1.5rem; font-weight: bold; color: var(--accent); }
.prizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}
.prize-card {
    background: var(--surface);
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.prize-card .cost {
    display: inline-block;
    background: var(--accent-2);
    color: #000;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
    margin: 0.5rem 0;
}
.auth-form {
    max-width: 400px;
    margin: 2rem auto;
    background: var(--surface);
    padding: 2rem;
    border-radius: 8px;
}
.auth-form label { display: block; margin: 0.5rem 0 0.3rem; }
.auth-form input { margin-bottom: 1rem; }
.auth-form .btn { width: 100%; }
.auth-form .alt { text-align: center; margin-top: 1rem; color: var(--text-dim); }
.game-container { max-width: 1200px; margin: 0 auto; }
.game-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}
.game-desc { color: var(--text-dim); margin: 0.5rem 0; }
.stats { display: flex; gap: 2rem; margin-top: 1rem; }
.stat { text-align: center; }
.stat-label { display: block; color: var(--text-dim); font-size: 0.85rem; }
.stat-value { font-size: 1.8rem; color: var(--accent); font-weight: bold; }
.game-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
@media (max-width: 768px) {
    .game-layout { grid-template-columns: 1fr; }
}
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}
.panel h3 { margin-bottom: 0.75rem; color: var(--accent); }
.code-panel pre {
    background: #111;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.4;
}
.code-panel code { color: #aaf; }
.chat-box {
    height: 300px;
    overflow-y: auto;
    background: #111;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}
.message {
    margin: 0.5rem 0;
    padding: 0.5rem;
    border-radius: 6px;
    max-width: 85%;
}
.message.user { background: var(--border); margin-left: auto; text-align: right; }
.message.assistant { background: #1a3320; border-left: 3px solid var(--accent); }
.message.system { color: var(--text-dim); font-style: italic; text-align: center; }
.message.error { color: var(--danger); background: #3d1a1a; }
#query-form { display: flex; gap: 0.5rem; }
#query-form input { flex: 1; }
.cost-hint { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.3rem; }
.actions { margin: 1.5rem 0; }
.in-session { display: flex; align-items: center; gap: 1rem; }
.submit-fix { margin-top: 2rem; }
.submit-fix textarea { font-family: monospace; font-size: 0.9rem; margin-bottom: 1rem; }
#result-area { margin-top: 1rem; }
.result-win { background: #1a3d20; padding: 1rem; border-radius: 8px; border: 1px solid var(--accent); }
.result-loss { background: #3d1a1a; padding: 1rem; border-radius: 8px; border: 1px solid var(--danger); }
.leaderboard { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.leaderboard th, .leaderboard td {
    padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border);
}
.leaderboard th { color: var(--accent); text-transform: uppercase; font-size: 0.8rem; }
.prizes-list { display: flex; flex-direction: column; gap: 1rem; }
.prize-item {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--surface);
    padding: 1.5rem; border: 1px solid var(--border); border-radius: 8px;
}
.prize-info h3 { color: var(--accent); }
.tickets-cost { color: var(--accent-2); font-weight: bold; }
.prize-action .btn { min-width: 120px; }
.flash { background: var(--accent-2); color: #000; padding: 0.75rem 1rem; border-radius: 4px; margin-bottom: 1rem; }
.cta {
    text-align: center;
    padding: 3rem 1rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}
.cta h2 { color: var(--accent); margin-bottom: 1rem; }
.cta .btn { margin: 0 0.5rem; }
.text-muted { color: var(--text-dim); }
small { color: var(--text-dim); font-size: 0.85rem; }
.htmx-request .btn { opacity: 0.6; }
.htmx-request .btn[disabled] { opacity: 0.3; }
