/* launch.css — Page-specific styles for the Agents page (launch.html)
   Nav, seal, wallet pill, and seal dropdown styles are in shared styles.css.
   Toast system is in shared.css. */

/* ===== Variable Overrides ===== */
:root {
    --gray-300: #bbb;
    --gray-500: #666;
    --yellow: #eab308;
    --red: #ef4444;
}

/* ===== Page Layout ===== */
.container { max-width: 920px; margin: 0 auto; padding: 2rem 1.5rem; }
.hero-mini { text-align: center; padding: 2.5rem 1.5rem 1rem; }
.hero-mini h1 { font-family: 'Orbitron', sans-serif; font-size: 2rem; font-weight: 800; background: linear-gradient(135deg, var(--gold), var(--gold-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 0.5rem; }
.hero-mini p { color: var(--gray-400); font-size: 1rem; max-width: 600px; margin: 0 auto; }

/* Load error */
.load-error { display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4rem 2rem; gap: 1rem; }
.load-error h2 { color: var(--red); font-family: 'Orbitron', sans-serif; font-size: 1.2rem; }
.load-error p { color: var(--gray-400); font-size: 0.9rem; max-width: 500px; }
.load-error code { background: var(--gray-800); padding: 0.75rem 1rem; border-radius: 10px; font-size: 0.8rem; color: var(--cyan); }

/* ===== Sections ===== */
.deploy-section { background: var(--gray-800); border: 1px solid var(--gray-700); border-radius: 14px; padding: 1.75rem; margin-bottom: 1.5rem; transition: opacity 0.4s, border-color 0.3s; }
.deploy-section.disabled { opacity: 0.35; pointer-events: none; }
.deploy-section.active { border-color: rgba(212,175,55,0.5); }
.deploy-section.done { border-color: var(--green); }
.deploy-section.collapsed .section-body { display: none; }
.deploy-section.collapsed { padding: 1rem 1.75rem; }
.section-header { margin-bottom: 1.25rem; }
.section-title { font-family: 'Orbitron', sans-serif; font-size: 1.15rem; font-weight: 700; }
.section-sub { color: var(--gray-400); font-size: 0.85rem; margin-top: 0.4rem; }
.section-summary { display: none; align-items: center; gap: 0.5rem; font-size: 0.85rem; flex-wrap: wrap; }
.deploy-section.collapsed .section-summary { display: flex; }
.summary-check { width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: var(--black); font-size: 0.65rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.summary-dim { color: var(--gray-400); }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.65rem 1.25rem; border-radius: 10px; border: none; font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: background 0.2s, transform 0.1s, opacity 0.2s; text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: var(--black); }
.btn-gold:hover:not(:disabled) { background: var(--gold-light); }
.btn-outline { background: transparent; border: 1px solid var(--gray-600); color: var(--gray-300); }
.btn-outline:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.btn-green { background: var(--green); color: var(--black); }
.btn-red { background: var(--red); color: var(--white); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.75rem; }
.btn-full { width: 100%; justify-content: center; }

/* ===== Forms ===== */
.input, .select { background: var(--gray-900); border: 1px solid var(--gray-700); color: var(--white); padding: 0.6rem 0.85rem; border-radius: 10px; font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; width: 100%; transition: border-color 0.2s; }
.input:focus, .select:focus { outline: none; border-color: var(--gold); }
.select option { background: var(--gray-800); }
.address-box { background: var(--gray-900); border: 1px solid var(--gray-700); border-radius: 10px; padding: 0.75rem 1rem; display: flex; align-items: center; gap: 0.75rem; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--cyan); word-break: break-all; }
.address-box .label { color: var(--gray-400); font-size: 0.65rem; text-transform: uppercase; white-space: nowrap; }
.address-box .addr { flex: 1; }
.copy-btn { background: none; border: none; color: var(--gray-400); cursor: pointer; font-family: 'JetBrains Mono', monospace; font-size: 0.65rem; font-weight: 600; padding: 0.25rem 0.5rem; transition: color 0.2s; text-transform: uppercase; letter-spacing: 0.05em; }
.copy-btn:hover { color: var(--gold); }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.gap-sm { gap: 0.5rem; }
.mt-1 { margin-top: 0.75rem; }
.mb-1 { margin-bottom: 0.75rem; }

/* ===== Identity Paths ===== */
.identity-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.path-card { background: var(--gray-900); border: 1px solid var(--gray-700); border-radius: 14px; padding: 1.25rem; text-align: center; transition: border-color 0.2s; }
.path-card:hover { border-color: var(--gray-600); }
.path-icon { width: 48px; height: 48px; border-radius: 14px; background: rgba(212,175,55,0.1); border: 1px solid rgba(212,175,55,0.2); display: flex; align-items: center; justify-content: center; font-family: 'Orbitron', sans-serif; font-size: 1rem; font-weight: 700; color: var(--gold); margin: 0 auto 0.75rem; }
.path-title { font-family: 'Orbitron', sans-serif; font-size: 0.85rem; font-weight: 700; margin-bottom: 0.75rem; }

/* Drop zone */
.drop-zone { border: 2px dashed var(--gray-600); border-radius: 10px; padding: 1rem; cursor: pointer; font-size: 0.75rem; color: var(--gray-400); text-align: center; transition: border-color 0.2s, background 0.2s; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--gold); background: rgba(212,175,55,0.05); }

/* QR */
.qr-wrap { text-align: center; flex-shrink: 0; }
.qr-wrap canvas { border-radius: 10px; cursor: pointer; }
.qr-label { font-size: 0.65rem; color: var(--gray-400); margin-top: 0.3rem; }
.fund-grid { display: grid; grid-template-columns: 180px 1fr; gap: 1.5rem; align-items: start; }

/* ===== Tabs ===== */
.tab-bar { display: flex; gap: 0; margin-bottom: 1.25rem; border-bottom: 1px solid var(--gray-700); }
.tab-btn { padding: 0.65rem 1.25rem; font-family: 'Orbitron', sans-serif; font-size: 0.78rem; font-weight: 700; background: none; border: none; color: var(--gray-400); cursor: pointer; border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s; }
.tab-btn:hover { color: var(--white); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== Provider ===== */
.provider-grid { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.provider-btn { padding: 0.5rem 1rem; border-radius: 10px; background: var(--gray-900); border: 2px solid var(--gray-700); color: var(--gray-300); font-size: 0.8rem; font-family: 'JetBrains Mono', monospace; cursor: pointer; transition: border-color 0.2s; }
.provider-btn:hover { border-color: var(--gray-400); }
.provider-btn.selected { border-color: var(--gold); color: var(--gold); }

/* ===== Prompt ===== */
.prompt-textarea { width: 100%; min-height: 120px; max-height: 300px; resize: vertical; background: var(--gray-900); border: 1px solid var(--gray-700); border-radius: 10px; color: var(--white); padding: 0.75rem; font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; line-height: 1.6; }
.prompt-textarea:focus { outline: none; border-color: var(--gold); }
.quick-prompts { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; margin-bottom: 1rem; }
.quick-btn { padding: 0.3rem 0.7rem; border-radius: 20px; background: var(--gray-900); border: 1px solid var(--gray-700); color: var(--gray-400); font-size: 0.7rem; cursor: pointer; transition: border-color 0.2s, color 0.2s; position: relative; }
.quick-btn:hover { border-color: var(--gold); color: var(--gold); }
.quick-btn[data-tooltip]:hover::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--gray-900); border: 1px solid rgba(212,175,55,0.25); color: var(--gray-300); font-size: 0.65rem; font-weight: 400; padding: 0.35rem 0.6rem; border-radius: 6px; white-space: nowrap; pointer-events: none; z-index: 10; }
.quick-btn[data-tooltip]:hover::before { content: ''; position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); border: 4px solid transparent; border-top-color: rgba(212,175,55,0.25); pointer-events: none; z-index: 10; }

/* ===== File Chips ===== */
.file-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.file-chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.6rem; background: var(--gray-900); border: 1px solid var(--gray-700); border-radius: 6px; font-size: 0.7rem; color: var(--gray-300); }
.file-chip .remove { cursor: pointer; color: var(--gray-400); margin-left: 0.2rem; }
.file-chip .remove:hover { color: var(--red); }

/* Key input */
.key-wrap { position: relative; }
.key-wrap .lock { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--gray-400); font-family: 'JetBrains Mono', monospace; font-size: 0.6rem; font-weight: 600; pointer-events: none; letter-spacing: 0.05em; text-transform: uppercase; }

/* Test result */
.test-result { background: var(--gray-900); border: 1px solid var(--cyan); border-radius: 10px; padding: 1rem; margin-top: 0.75rem; font-size: 0.8rem; display: none; }
.test-result.visible { display: block; }

/* ===== Strategy Grid ===== */
.strategy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
.strategy-card { background: var(--gray-900); border: 2px solid var(--gray-700); border-radius: 10px; padding: 0.75rem; cursor: pointer; text-align: center; transition: border-color 0.2s, background 0.2s; }
.strategy-card:hover { border-color: var(--gray-400); }
.strategy-card.selected { border-color: var(--gold); background: rgba(212,175,55,0.08); }
.strategy-card .icon { width: 32px; height: 32px; border-radius: 50%; background: rgba(212,175,55,0.12); border: 1px solid rgba(212,175,55,0.25); display: flex; align-items: center; justify-content: center; font-family: 'Orbitron', sans-serif; font-size: 0.75rem; font-weight: 700; color: var(--gold); margin: 0 auto 0.4rem; }
.strategy-card .name { font-family: 'Orbitron', sans-serif; font-size: 0.7rem; font-weight: 700; }
.strategy-card .desc { font-size: 0.65rem; color: var(--gray-400); margin-top: 0.2rem; }

/* Config rows + sliders */
.config-row { display: flex; align-items: center; justify-content: space-between; padding: 0.65rem 0; gap: 1rem; }
.config-label { font-size: 0.82rem; color: var(--gray-300); white-space: nowrap; }
.config-value { font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; color: var(--gold); font-weight: 600; min-width: 60px; text-align: right; }
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; background: var(--gray-700); border-radius: 3px; outline: none; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); cursor: pointer; }
.slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--gold); cursor: pointer; border: none; }
.warning { background: rgba(234,179,8,0.08); border: 1px solid rgba(234,179,8,0.3); border-radius: 10px; padding: 0.75rem 1rem; font-size: 0.78rem; color: var(--yellow); display: none; }
.warning.visible { display: block; }

/* Advanced toggle */
.adv-toggle { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--gray-400); font-size: 0.75rem; cursor: pointer; user-select: none; }
.adv-toggle:hover { color: var(--gold); }
.adv-body { display: none; margin-top: 0.5rem; }
.adv-body.open { display: block; }

/* ===== Deploy Bar (fixed bottom) ===== */
.deploy-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(18, 18, 22, 0.97);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(212,175,55,0.25);
    padding: 0.65rem 1.5rem 0.85rem;
    display: none;
}
.deploy-bar.visible { display: block; }
.deploy-bar-inner { max-width: 920px; margin: 0 auto; text-align: center; }
.deploy-bankroll-row {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
}
.deploy-current { color: var(--gray-300); }
.deploy-current strong { color: var(--gold); font-family: 'JetBrains Mono', monospace; }
.deploy-arrow { color: var(--gray-500); margin: 0 0.1rem; }
.deploy-label { color: var(--gray-400); font-size: 0.78rem; }
.deploy-input {
    width: 80px;
    padding: 0.3rem 0.45rem;
    border-radius: 6px;
    border: 1px solid rgba(212,175,55,0.3);
    background: rgba(212,175,55,0.05);
    color: var(--gold);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    outline: none;
}
.deploy-input:focus { border-color: var(--gold); box-shadow: 0 0 8px rgba(212,175,55,0.15); }
.deploy-unit { color: var(--gray-400); font-size: 0.78rem; font-family: 'JetBrains Mono', monospace; }
.deploy-info { font-size: 0.72rem; color: var(--gray-500); margin-left: 0.25rem; }
.deploy-info.warn { color: var(--red); }
.deploy-btn { font-size: 0.95rem; padding: 0.8rem 3rem; border-radius: 14px; letter-spacing: 0.05em; box-shadow: 0 0 30px rgba(212,175,55,0.2); width: 100%; max-width: 460px; }
.deploy-btn:hover:not(:disabled) { box-shadow: 0 0 40px rgba(212,175,55,0.4); }
.deploy-meta { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 0.35rem; font-size: 0.68rem; }
.deploy-summary { color: var(--gray-400); }
.deploy-shortcut { color: var(--gray-600); }
#configContainer { padding-bottom: 140px; }

/* ===== Mission Control ===== */
.mission-control { display: none; }
.mission-control.active { display: block; }
.mc-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.mc-status { display: flex; align-items: center; gap: 0.6rem; font-family: 'Orbitron', sans-serif; font-size: 1rem; }
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 1.5s ease infinite; }
.pulse-dot.paused { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); animation: none; }
.pulse-dot.stopped { background: var(--red); box-shadow: none; animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* MC agent tabs */
.mc-agent-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; overflow-x: auto; }
.mc-tab-btn { padding: 0.4rem 0.8rem; border: 1px solid var(--gray-700); background: transparent; color: var(--gray-400); border-radius: 6px; cursor: pointer; font-family: 'Orbitron', sans-serif; font-size: 0.65rem; white-space: nowrap; transition: border-color 0.2s, color 0.2s; }
.mc-tab-btn.active { border-color: var(--gold); color: var(--gold); background: rgba(212,160,23,0.08); }
.mc-tab-btn:hover { border-color: var(--gold); color: var(--white); }

/* MC stats */
.mc-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.mc-stat { background: var(--gray-800); border: 1px solid var(--gray-700); border-radius: 10px; padding: 1rem; text-align: center; }
.mc-stat .val { font-family: 'Orbitron', sans-serif; font-size: 1.5rem; font-weight: 700; }
.mc-stat .lbl { font-size: 0.7rem; color: var(--gray-400); text-transform: uppercase; margin-top: 0.3rem; }
.val.positive { color: var(--green); }
.val.negative { color: var(--red); }
.val.neutral { color: var(--gold); }

/* Streak bar */
.streak-bar { display: flex; gap: 3px; margin-bottom: 1rem; flex-wrap: wrap; }
.streak-dot { width: 12px; height: 12px; border-radius: 50%; }
.streak-dot.win { background: var(--green); }
.streak-dot.loss { background: var(--red); }

/* Log panel */
.log-panel { background: var(--gray-900); border: 1px solid var(--gray-700); border-radius: 14px; padding: 1rem; max-height: 450px; overflow-y: auto; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; line-height: 1.8; }
.log-entry { padding: 0.3rem 0.6rem; border-bottom: 1px solid rgba(42,42,42,0.5); border-left: 3px solid transparent; }
.log-entry:nth-child(even) { background: rgba(255,255,255,0.015); }
.log-entry:last-child { border-bottom: none; }
.log-time { color: var(--gray-400); margin-right: 0.5rem; }
.log-win { color: var(--green); border-left-color: var(--green); }
.log-loss { color: var(--red); border-left-color: var(--red); }
.log-info { color: var(--cyan); }
.log-warn { color: var(--yellow); }
.log-thinking { color: var(--cyan); }
.log-reasoning { color: #c084fc; font-style: italic; }
.log-decision { color: var(--gold); font-weight: 600; }
.log-agent { color: var(--gold); margin-right: 0.5rem; }

/* Coin flip animation */
.coin-anim { display: inline-block; animation: coinFlip 0.6s ease-in-out; }
@keyframes coinFlip { 0% { transform: rotateY(0); } 50% { transform: rotateY(540deg); } 100% { transform: rotateY(1080deg); } }

/* Shutdown banner */
.shutdown-banner { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); border-radius: 14px; padding: 1.25rem; text-align: center; margin-bottom: 1.5rem; display: none; }
.shutdown-banner.visible { display: block; }
.shutdown-banner .reason { font-family: 'Orbitron', sans-serif; font-size: 0.9rem; margin-top: 0.3rem; }

/* Spinner + loading */
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--gray-600); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: fixed; inset: 0; z-index: 2000; background: var(--black); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.25rem; }
.loading-overlay.hidden { display: none; }
.loading-overlay .spinner-lg { width: 36px; height: 36px; border: 3px solid var(--gray-700); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; }
.loading-overlay .msg { font-family: 'Orbitron', sans-serif; font-size: 0.85rem; color: var(--gray-400); }

/* Footer */
.page-footer { border-top: 1px solid var(--gray-700); padding: 2rem; text-align: center; font-size: 0.75rem; color: var(--gray-400); }
.page-footer a { color: var(--gold); text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }

/* ===== Progress Indicator ===== */
.progress-bar { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 1.5rem; }
.progress-step { display: flex; align-items: center; gap: 0.4rem; font-family: 'Rajdhani', sans-serif; font-size: 0.75rem; font-weight: 600; color: var(--gray-400); cursor: pointer; transition: color 0.2s; padding: 0.3rem 0.6rem; white-space: nowrap; }
.progress-step:hover { color: var(--white); }
.progress-step .step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--gray-700); display: flex; align-items: center; justify-content: center; font-family: 'Orbitron', sans-serif; font-size: 0.6rem; font-weight: 700; flex-shrink: 0; transition: background 0.3s, color 0.3s; }
.progress-step.active .step-num { background: var(--gold); color: var(--black); box-shadow: 0 0 0 4px rgba(212,175,55,0.2); animation: step-pulse 2s ease-in-out infinite; }
.progress-step.done .step-num { background: var(--green); color: var(--black); }
.progress-step.done .step-num svg { width: 12px; height: 12px; }
.progress-step.done { color: var(--green); }
.progress-step.active { color: var(--gold); font-weight: 600; }
@keyframes step-pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(212,175,55,0.15); } 50% { box-shadow: 0 0 0 6px rgba(212,175,55,0.3); } }
.progress-connector { width: 32px; height: 2px; background: var(--gray-700); flex-shrink: 0; transition: background 0.3s; }
.progress-connector.done { background: linear-gradient(90deg, var(--green), var(--gold)); }

/* Edit button for collapsed sections */
.edit-btn { background: none; border: 1px solid var(--gray-600); color: var(--gray-400); cursor: pointer; font-size: 0.65rem; font-family: 'JetBrains Mono', monospace; padding: 0.15rem 0.5rem; border-radius: 4px; transition: color 0.2s, border-color 0.2s; margin-left: auto; }
.edit-btn:hover { color: var(--gold); border-color: var(--gold); }

/* ===== Entry Screen ===== */
.entry-screen { max-width: 720px; margin: 0 auto; padding: 2rem 1.5rem; }
.entry-screen h2 { font-family: 'Orbitron', sans-serif; font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; text-align: center; }
.entry-sub { color: var(--gray-400); font-size: 0.85rem; text-align: center; margin-bottom: 2rem; }
.entry-card { background: var(--gray-800); border: 2px solid var(--gray-700); border-radius: 16px; padding: 2.5rem 2rem; cursor: pointer; text-align: center; transition: border-color 0.3s, transform 0.2s; }
.entry-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.entry-icon { width: 56px; height: 56px; border-radius: 14px; background: rgba(212,175,55,0.1); border: 1px solid rgba(212,175,55,0.2); display: flex; align-items: center; justify-content: center; font-family: 'Orbitron', sans-serif; font-size: 1.3rem; font-weight: 700; color: var(--gold); margin: 0 auto 1rem; }
.entry-title { font-family: 'Orbitron', sans-serif; font-size: 0.95rem; font-weight: 700; margin-bottom: 0.5rem; }
.entry-desc { font-size: 0.78rem; color: var(--gray-400); line-height: 1.5; }

/* Dashboard extras (post-stop management) */
.dash-extras { background: var(--gray-800); border: 1px solid var(--gray-700); border-radius: 16px; padding: 1.5rem 2rem; margin-top: 1.5rem; }
.dash-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-ghost { background: none; border: none; color: var(--gray-400); font-size: 0.75rem; cursor: pointer; padding: 0.3rem 0.5rem; font-family: 'JetBrains Mono', monospace; }
.btn-ghost:hover { color: var(--gold); }

/* ===== Hub Auth Card ===== */
.hub-signin-prompt { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1rem; }
.hub-auth-card { max-width: 380px; width: 100%; text-align: center; padding: 2.5rem 2rem 2rem; background: rgba(0,212,255,0.02); border: 1px solid rgba(0,212,255,0.12); border-radius: 16px; position: relative; overflow: hidden; }
.hub-auth-card::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,212,255,0.015) 2px, rgba(0,212,255,0.015) 4px); pointer-events: none; }
.hub-auth-seal { color: rgba(0,212,255,0.35); margin-bottom: 1.25rem; transition: color 0.4s; }
.hub-auth-terminal { font-family: 'Orbitron', sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--cyan); letter-spacing: 0.1em; margin-bottom: 0.5rem; }
.hub-auth-sub { font-size: 0.82rem; color: var(--gray-400); margin-bottom: 1.75rem; line-height: 1.5; }
.hub-auth-buttons { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.25rem; }
.hub-auth-btn { display: flex; align-items: center; justify-content: center; gap: 0.6rem; width: 100%; padding: 0.75rem 1rem; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04); color: var(--white); font-family: 'Rajdhani', sans-serif; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: border-color 0.3s, background 0.3s, box-shadow 0.3s, transform 0.15s; }
.hub-auth-btn:hover { border-color: rgba(0,212,255,0.4); background: rgba(0,212,255,0.06); box-shadow: 0 0 16px rgba(0,212,255,0.08); transform: translateY(-1px); }
.hub-auth-btn:active { transform: scale(0.98); }
.hub-auth-btn-ii { border-color: rgba(0,212,255,0.2); color: var(--cyan); }
.hub-auth-btn-ii:hover { border-color: rgba(0,212,255,0.5); background: rgba(0,212,255,0.08); }
.hub-auth-hint { font-size: 0.68rem; color: var(--gray-500); line-height: 1.5; }

/* ===== Seal Dropdown: Agent Fund Section (launch-page specific) ===== */
.seal-dd-fund-divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(0,212,255,0.2), transparent); margin: 0.85rem 0; position: relative; z-index: 2; }
.seal-dd-fund-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.4rem; position: relative; z-index: 2; }
.seal-dd-fund-label { font-size: 0.6rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.08em; font-family: 'Rajdhani', sans-serif; font-weight: 600; }
.seal-dd-fund-name { font-family: 'Orbitron', sans-serif; font-size: 0.75rem; font-weight: 700; color: var(--gold); text-shadow: 0 0 6px rgba(212,175,55,0.2); }
.seal-dd-fund-bal-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; position: relative; z-index: 2; }
.seal-dd-fund-bal-label { font-size: 0.68rem; color: var(--gray-400); }
.seal-dd-fund-bal-val { font-family: 'Orbitron', sans-serif; font-size: 0.82rem; font-weight: 700; color: var(--gold); text-shadow: 0 0 6px rgba(212,175,55,0.2); }
.seal-dd-fund-row { display: flex; gap: 0.4rem; align-items: center; position: relative; z-index: 2; }
.seal-dd-fund-input { flex: 1; padding: 0.4rem 0.55rem; border-radius: 10px; border: 1px solid rgba(0,212,255,0.12); background: rgba(0,212,255,0.03); color: var(--white); font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; outline: none; min-width: 0; transition: border-color 0.3s, box-shadow 0.3s; }
.seal-dd-fund-input:focus { border-color: rgba(0,212,255,0.4); box-shadow: 0 0 8px rgba(0,212,255,0.1); }
.seal-dd-fund-btn { padding: 0.4rem 0.8rem; border-radius: 10px; border: 1px solid rgba(212,175,55,0.3); background: rgba(212,175,55,0.08); color: var(--gold); font-family: 'Orbitron', sans-serif; font-size: 0.65rem; font-weight: 700; cursor: pointer; transition: background 0.3s, box-shadow 0.3s, border-color 0.3s; white-space: nowrap; letter-spacing: 0.08em; }
.seal-dd-fund-btn:hover { background: rgba(212,175,55,0.15); border-color: rgba(212,175,55,0.5); box-shadow: 0 0 10px rgba(212,175,55,0.1); }

/* Withdraw section */
.seal-dd-withdraw { margin: 0.5rem 0; padding-top: 0.5rem; border-top: 1px solid rgba(0,240,255,0.08); position: relative; z-index: 2; }
.seal-dd-withdraw-row { display: flex; gap: 0.3rem; margin-top: 0.35rem; align-items: center; }
.seal-dd-withdraw-row input { flex: 1; }
.seal-dd-withdraw-max { background: rgba(212,175,55,0.1); border: 1px solid rgba(212,175,55,0.25); color: var(--gold); font-size: 0.6rem; padding: 0.3rem 0.5rem; border-radius: 6px; cursor: pointer; font-family: 'Rajdhani', sans-serif; font-weight: 600; transition: background 0.3s; }
.seal-dd-withdraw-max:hover { background: rgba(212,175,55,0.2); }
.seal-dd-withdraw-btn { background: rgba(220,50,50,0.12) !important; border-color: rgba(220,50,50,0.35) !important; color: #ff6b6b !important; }
.seal-dd-withdraw-btn:hover { background: rgba(220,50,50,0.22) !important; border-color: rgba(220,50,50,0.5) !important; }
.seal-dd-withdraw-dest { width: 100%; margin-top: 0.3rem; font-size: 0.58rem; box-sizing: border-box; }
.seal-dd-withdraw-fee { font-size: 0.55rem; color: var(--gray-500); margin-top: 0.25rem; text-align: center; }

/* Budget row (for coinflip guardrails) */
.budget-row { display: flex; align-items: center; gap: 0.5rem; }
.budget-row .input { max-width: 160px; }
.budget-unit { font-size: 0.8rem; color: var(--gray-400); font-family: 'JetBrains Mono', monospace; }

/* Recall panel */
.recall-panel { margin-top: 0.75rem; padding: 1rem; border: 1px solid rgba(255,215,0,0.2); border-radius: 10px; background: rgba(255,215,0,0.03); text-align: center; display: none; }
.recall-panel.visible { display: block; }
.recall-panel .recall-balance { font-family: 'Orbitron', sans-serif; font-size: 1rem; color: var(--gold); margin: 0.5rem 0; }
.recall-panel .recall-hint { font-size: 0.7rem; color: var(--gray-400); margin-bottom: 0.75rem; }

/* ===== Agent Grid & Cards ===== */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.agent-card { background: var(--gray-800); border: 1px solid var(--gray-700); border-radius: 14px; padding: 1rem 1.25rem; transition: border-color 0.3s, transform 0.2s; cursor: pointer; }
.agent-card:hover { border-color: rgba(212,175,55,0.4); transform: translateY(-2px); }
.agent-card:hover .agent-name { text-shadow: 0 0 8px rgba(212,175,55,0.3); }
.agent-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.agent-name { font-family: 'Orbitron', sans-serif; font-size: 1rem; font-weight: 700; color: var(--gold); }
.agent-principal { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; color: var(--gray-400); display: flex; align-items: center; gap: 0.4rem; }
.agent-badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.5rem; border-radius: 10px; font-size: 0.6rem; font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.badge-running { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.badge-idle { background: rgba(153,153,153,0.1); color: var(--gray-400); border: 1px solid var(--gray-700); }
.badge-ready { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.badge-no-key { background: rgba(234,179,8,0.15); color: var(--yellow); border: 1px solid rgba(234,179,8,0.3); }
.badge-playing { background: rgba(0,212,255,0.15); color: var(--cyan); border: 1px solid rgba(0,212,255,0.3); animation: turn-pulse 1.5s ease-in-out infinite; }
.badge-paused { background: rgba(234,179,8,0.15); color: var(--yellow); border: 1px solid rgba(234,179,8,0.3); }
.stat-row { display: flex; justify-content: space-between; padding: 0.4rem 0; border-bottom: 1px solid rgba(42,42,42,0.5); font-size: 0.85rem; }
.stat-row:last-child { border-bottom: none; }
.stat-row .label { color: var(--gray-400); }
.stat-row .value { font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.agent-stats-compact { display: flex; gap: 1rem; margin: 0.5rem 0; font-size: 0.78rem; }
.agent-stats-compact .stat { display: flex; flex-direction: column; }
.agent-stats-compact .stat-label { font-size: 0.6rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; }
.agent-stats-compact .stat-value { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 0.8rem; }
.pnl-bar { height: 6px; border-radius: 3px; margin-top: 0.75rem; }
.pnl-bar.positive { background: linear-gradient(90deg, var(--green), rgba(34,197,94,0.2)); }
.pnl-bar.negative { background: linear-gradient(90deg, var(--red), rgba(239,68,68,0.2)); }
.pnl-bar.zero { background: var(--gray-700); }
.agent-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }
.agent-card.create-card { border: 2px dashed var(--gray-600); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 200px; transition: border-color 0.3s, transform 0.2s; }
.agent-card.create-card:hover { border-color: var(--gold); transform: translateY(-2px); }

/* Aggregate stats */
.agg-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }

/* Saved agents */
.saved-agents { margin-top: 1rem; }
.saved-agent-item { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.75rem; background: var(--gray-900); border: 1px solid var(--gray-700); border-radius: 10px; margin-bottom: 0.5rem; font-size: 0.8rem; }
.saved-agent-item .name { font-weight: 600; color: var(--gold); }
.saved-agent-item .principal-text { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; color: var(--gray-400); margin-left: 0.75rem; }

/* Hub section */
.hub-section { background: var(--gray-800); border: 1px solid var(--gray-700); border-radius: 16px; padding: 1.5rem 2rem; margin-bottom: 1.5rem; }
.hub-section .section-title { font-family: 'Orbitron', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; }
.hub-section .section-sub { font-size: 0.78rem; color: var(--gray-400); margin-bottom: 1rem; }

/* MC edit panel */
.mc-edit-panel { display: none; background: var(--gray-900); border: 1px solid var(--gray-700); border-radius: 14px; padding: 1.25rem; margin-bottom: 1.5rem; }
.mc-edit-panel.visible { display: block; }

/* ===== Game Type Toggle ===== */
.game-toggle { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.game-toggle .tab-btn { flex: 1; text-align: center; padding: 0.6rem; }

/* ===== Ronin Dealer Sprite ===== */
.ronin-dealer-wrap {
    display: flex; justify-content: center; align-items: flex-end;
    position: relative;
    padding: 1.5rem 0 0.25rem; min-height: 152px;
}
.ronin-dealer-wrap::after {
    content: ''; position: absolute; bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 140px; height: 20px;
    background: radial-gradient(ellipse at center, rgba(212,175,55,0.15) 0%, transparent 70%);
    animation: ground-glow 3s ease-in-out infinite;
    pointer-events: none; z-index: 0;
}
@keyframes ground-glow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
.ronin-dealer {
    position: relative; width: 96px; height: 128px; /* 24x32 at 4x scale */
    image-rendering: pixelated;
}
.ronin-dealer .sprite-layer {
    position: absolute; top: 0; left: 0;
    width: 1px; height: 1px;
    background: transparent;
    transform: scale(4); transform-origin: top left;
}

/* Body — enhanced samurai silhouette */
.dealer-body {
    box-shadow:
        /* kabuto crest */
        10px 0 #b8860b, 11px 0 #ffd700, 12px 0 #ffe557, 13px 0 #b8860b,
        9px 1px #b8860b, 10px 1px #d4af37, 11px 1px #ffd700, 12px 1px #ffd700, 13px 1px #d4af37, 14px 1px #b8860b,
        /* helmet brim */
        7px 2px #3a3a4a, 8px 2px #4a4a5a, 9px 2px #4a4a5a, 10px 2px #4a4a5a, 11px 2px #5a5a6a,
        12px 2px #5a5a6a, 13px 2px #4a4a5a, 14px 2px #4a4a5a, 15px 2px #4a4a5a, 16px 2px #3a3a4a,
        7px 3px #4a4a5a, 8px 3px #5a5a6a, 9px 3px #5a5a6a, 10px 3px #5a5a6a, 11px 3px #6a6a7a,
        12px 3px #6a6a7a, 13px 3px #5a5a6a, 14px 3px #5a5a6a, 15px 3px #5a5a6a, 16px 3px #4a4a5a,
        /* helmet body */
        8px 4px #3a3a4a, 9px 4px #4a4a5a, 10px 4px #5a5a6a, 11px 4px #5a5a6a,
        12px 4px #5a5a6a, 13px 4px #5a5a6a, 14px 4px #4a4a5a, 15px 4px #3a3a4a,
        8px 5px #3a3a4a, 9px 5px #4a4a5a, 10px 5px #4a4a5a, 11px 5px #4a4a5a,
        12px 5px #4a4a5a, 13px 5px #4a4a5a, 14px 5px #4a4a5a, 15px 5px #3a3a4a,
        /* visor */
        8px 6px #2a2a3a, 9px 6px #3a3a4a, 14px 6px #3a3a4a, 15px 6px #2a2a3a,
        /* mempo */
        8px 7px #3a3a4a, 9px 7px #4a4a5a, 10px 7px #4a4a5a, 11px 7px #dc143c,
        12px 7px #dc143c, 13px 7px #4a4a5a, 14px 7px #4a4a5a, 15px 7px #3a3a4a,
        9px 8px #3a3a4a, 10px 8px #4a4a5a, 11px 8px #3a3a4a, 12px 8px #3a3a4a, 13px 8px #4a4a5a, 14px 8px #3a3a4a,
        /* neck */
        10px 9px #2a2a3a, 11px 9px #3a3a4a, 12px 9px #3a3a4a, 13px 9px #2a2a3a,
        /* shoulder armor + gold rivets */
        5px 10px #4a4a5a, 6px 10px #5a5a6a, 7px 10px #5a5a6a, 8px 10px #4a4a5a,
        9px 10px #3a3a4a, 10px 10px #3a3a4a, 11px 10px #4a4a5a, 12px 10px #4a4a5a,
        13px 10px #3a3a4a, 14px 10px #3a3a4a, 15px 10px #4a4a5a,
        16px 10px #5a5a6a, 17px 10px #5a5a6a, 18px 10px #4a4a5a,
        5px 11px #5a5a6a, 6px 11px #ffd700, 7px 11px #dc143c, 8px 11px #5a5a6a,
        15px 11px #5a5a6a, 16px 11px #dc143c, 17px 11px #ffd700, 18px 11px #5a5a6a,
        /* do (chestplate) */
        7px 12px #3a3a4a, 8px 12px #4a4a5a, 9px 12px #5a5a6a, 10px 12px #5a5a6a,
        11px 12px #6a6a7a, 12px 12px #6a6a7a, 13px 12px #5a5a6a, 14px 12px #5a5a6a,
        15px 12px #4a4a5a, 16px 12px #3a3a4a,
        7px 13px #3a3a4a, 8px 13px #4a4a5a, 9px 13px #5a5a6a, 10px 13px #dc143c,
        11px 13px #5a5a6a, 12px 13px #5a5a6a, 13px 13px #dc143c, 14px 13px #5a5a6a,
        15px 13px #4a4a5a, 16px 13px #3a3a4a,
        7px 14px #3a3a4a, 8px 14px #4a4a5a, 9px 14px #5a5a6a, 10px 14px #5a5a6a,
        11px 14px #6a6a7a, 12px 14px #6a6a7a, 13px 14px #5a5a6a, 14px 14px #5a5a6a,
        15px 14px #4a4a5a, 16px 14px #3a3a4a,
        /* obi belt */
        8px 15px #b8860b, 9px 15px #d4af37, 10px 15px #d4af37, 11px 15px #ffd700,
        12px 15px #ffd700, 13px 15px #d4af37, 14px 15px #d4af37, 15px 15px #b8860b,
        8px 16px #b8860b, 9px 16px #d4af37, 10px 16px #ffd700, 11px 16px #ffd700,
        12px 16px #ffd700, 13px 16px #ffd700, 14px 16px #d4af37, 15px 16px #b8860b,
        /* kusazuri */
        7px 17px #3a3a4a, 8px 17px #4a4a5a, 9px 17px #4a4a5a, 10px 17px #5a5a6a,
        11px 17px #4a4a5a, 12px 17px #4a4a5a, 13px 17px #5a5a6a, 14px 17px #4a4a5a,
        15px 17px #4a4a5a, 16px 17px #3a3a4a,
        7px 18px #3a3a4a, 8px 18px #4a4a5a, 9px 18px #3a3a4a, 10px 18px #4a4a5a,
        11px 18px #3a3a4a, 12px 18px #3a3a4a, 13px 18px #4a4a5a, 14px 18px #3a3a4a,
        15px 18px #4a4a5a, 16px 18px #3a3a4a,
        /* hakama */
        7px 19px #2a2a3a, 8px 19px #3a3a4a, 9px 19px #3a3a4a, 10px 19px #4a4a5a,
        11px 19px #3a3a4a, 12px 19px #3a3a4a, 13px 19px #4a4a5a, 14px 19px #3a3a4a,
        15px 19px #3a3a4a, 16px 19px #2a2a3a,
        7px 20px #2a2a3a, 8px 20px #3a3a4a, 9px 20px #3a3a4a, 10px 20px #3a3a4a,
        11px 20px #2a2a3a, 12px 20px #2a2a3a, 13px 20px #3a3a4a, 14px 20px #3a3a4a,
        15px 20px #3a3a4a, 16px 20px #2a2a3a,
        7px 21px #2a2a3a, 8px 21px #3a3a4a, 9px 21px #3a3a4a, 10px 21px #3a3a4a,
        11px 21px #2a2a3a, 12px 21px #2a2a3a, 13px 21px #3a3a4a, 14px 21px #3a3a4a,
        15px 21px #3a3a4a, 16px 21px #2a2a3a,
        7px 22px #2a2a3a, 8px 22px #3a3a4a, 9px 22px #3a3a4a, 10px 22px #3a3a4a,
        13px 22px #3a3a4a, 14px 22px #3a3a4a, 15px 22px #3a3a4a, 16px 22px #2a2a3a,
        7px 23px #2a2a3a, 8px 23px #3a3a4a, 9px 23px #3a3a4a, 10px 23px #3a3a4a,
        13px 23px #3a3a4a, 14px 23px #3a3a4a, 15px 23px #3a3a4a, 16px 23px #2a2a3a,
        /* suneate */
        8px 24px #4a4a5a, 9px 24px #5a5a6a, 10px 24px #4a4a5a,
        13px 24px #4a4a5a, 14px 24px #5a5a6a, 15px 24px #4a4a5a,
        8px 25px #4a4a5a, 9px 25px #5a5a6a, 10px 25px #4a4a5a,
        13px 25px #4a4a5a, 14px 25px #5a5a6a, 15px 25px #4a4a5a,
        8px 26px #3a3a4a, 9px 26px #4a4a5a, 10px 26px #3a3a4a,
        13px 26px #3a3a4a, 14px 26px #4a4a5a, 15px 26px #3a3a4a,
        /* waraji */
        7px 27px #5a4a3a, 8px 27px #6a5a4a, 9px 27px #6a5a4a, 10px 27px #5a4a3a,
        13px 27px #5a4a3a, 14px 27px #6a5a4a, 15px 27px #6a5a4a, 16px 27px #5a4a3a;
}

/* Visor eyes */
.dealer-eyes {
    box-shadow:
        10px 6px var(--dealer-eye, #00d4ff), 11px 6px var(--dealer-eye, #00d4ff),
        12px 6px var(--dealer-eye, #00d4ff), 13px 6px var(--dealer-eye, #00d4ff);
}

/* Right arm + gauntlet */
.dealer-arm {
    box-shadow:
        17px 12px #4a4a5a, 18px 12px #3a3a4a,
        17px 13px #5a5a6a, 18px 13px #4a4a5a,
        17px 14px #5a5a6a, 18px 14px #4a4a5a,
        17px 15px #4a4a5a, 18px 15px #3a3a4a,
        17px 16px #4a4a5a, 18px 16px #3a3a4a,
        17px 17px #3a3a4a, 18px 17px #d4af37;
    transition: transform 0.15s steps(2);
}

/* Katana — worn on back */
.dealer-katana {
    box-shadow:
        /* blade tip flash */
        17px 0 #e0e0ff,
        /* upper blade */
        17px 1px #d0d0f0, 18px 1px #c0c0e0,
        17px 2px #c0c0e0, 18px 2px #d0d0f0,
        /* mid blade */
        18px 3px #b0b0d0, 19px 3px #a0a0c0,
        18px 4px #a0a0c0, 19px 4px #b0b0d0,
        /* tsuba (gold handguard) */
        17px 5px #8B4513, 18px 5px #ffd700, 19px 5px #d4af37, 20px 5px #8B4513,
        /* tsuka-ito (handle wrap) */
        18px 6px #d4af37, 19px 6px #1a0a00,
        18px 7px #1a0a00, 19px 7px #d4af37,
        18px 8px #d4af37, 19px 8px #1a0a00,
        /* kashira (pommel) */
        18px 9px #b8860b, 19px 9px #996600;
    z-index: 1;
}

/* Coin — diamond shape */
.dealer-coin {
    box-shadow:
        20px 7px #d4af37,
        19px 8px #d4af37, 20px 8px #ffe557, 21px 8px #b8860b,
        20px 9px #b8860b;
    opacity: 0;
    transition: opacity 0.1s;
}

/* Crimson scarf — flowing from mempo */
.dealer-scarf {
    position: absolute; top: 0; left: 0;
    width: 1px; height: 1px;
    background: transparent;
    transform: scale(4); transform-origin: top left;
    z-index: 2;
    box-shadow:
        7px 8px #dc143c, 8px 8px #dc143c,
        6px 9px #dc143c, 7px 9px #b01030,
        5px 10px #dc143c, 6px 10px #b01030,
        4px 11px #b01030, 5px 11px #900820,
        3px 12px #b01030, 4px 12px #900820,
        2px 13px #900820, 3px 13px #700618,
        1px 14px #900820, 2px 14px #700618,
        0px 15px #700618, 1px 15px #500410,
        0px 16px #500410;
}

/* ===== Dealer Animation States ===== */

/* Idle: breathe + blink + scarf flutter + katana glint */
.dealer-idle .dealer-body { animation: dealer-breathe 3s ease-in-out infinite; }
.dealer-idle .dealer-eyes { animation: dealer-blink 4s ease-in-out infinite; }
.dealer-idle .dealer-scarf { animation: scarf-flutter 2.5s ease-in-out infinite; }
.dealer-idle .dealer-katana { animation: katana-glint 5s ease-in-out infinite; }
@keyframes dealer-breathe {
    0%, 100% { transform: scale(4) translateY(0); }
    50% { transform: scale(4) translateY(-0.25px); }
}
@keyframes dealer-blink {
    0%, 42%, 46%, 100% { opacity: 1; }
    44% { opacity: 0; }
}
@keyframes scarf-flutter {
    0%, 100% { transform: scale(4) translate(0, 0); }
    25% { transform: scale(4) translate(-0.3px, 0.15px); }
    50% { transform: scale(4) translate(0.1px, -0.1px); }
    75% { transform: scale(4) translate(-0.2px, 0.2px); }
}
@keyframes scarf-flutter-fast {
    0%, 100% { transform: scale(4) translate(0, 0); }
    20% { transform: scale(4) translate(-0.5px, 0.2px); }
    40% { transform: scale(4) translate(0.2px, -0.2px); }
    60% { transform: scale(4) translate(-0.4px, 0.3px); }
    80% { transform: scale(4) translate(0.1px, -0.1px); }
}
@keyframes katana-glint {
    0%, 90%, 100% { filter: brightness(1); }
    95% { filter: brightness(1.8) drop-shadow(0 0 2px rgba(224,224,255,0.6)); }
}
@keyframes katana-flash {
    0%, 100% { filter: brightness(1); }
    30% { filter: brightness(2.5) drop-shadow(0 0 4px rgba(255,215,0,0.8)); }
    60% { filter: brightness(1.5) drop-shadow(0 0 2px rgba(255,215,0,0.4)); }
}

/* Toss: dramatic arm raise, coin arc, sparkle trail */
.dealer-toss .dealer-arm { transform: scale(4) translate(-3px, -5px); }
.dealer-toss .dealer-coin { opacity: 1; animation: dealer-coin-arc 1.2s ease-out forwards; }
.dealer-toss .dealer-scarf { animation: scarf-flutter-fast 1s ease-in-out infinite; }
.dealer-toss::before {
    content: ''; position: absolute;
    top: 10px; right: -5px;
    width: 6px; height: 6px;
    background: radial-gradient(circle, #ffd700 0%, transparent 70%);
    border-radius: 50%;
    animation: sparkle-trail 1.2s ease-out forwards;
    pointer-events: none; z-index: 5;
}
@keyframes dealer-coin-arc {
    0% { transform: scale(4) translate(-2px, -2px); opacity: 1; }
    30% { transform: scale(4) translate(0, -10px); opacity: 1; }
    50% { transform: scale(4) translate(2px, -12px) rotate(180deg); opacity: 1; }
    70% { transform: scale(4) translate(4px, -8px) rotate(360deg); opacity: 1; }
    100% { transform: scale(4) translate(4px, 0) rotate(540deg); opacity: 0; }
}
@keyframes sparkle-trail {
    0% { opacity: 0; transform: translate(0, 0) scale(0.5); }
    15% { opacity: 1; }
    40% { opacity: 0.8; transform: translate(-10px, -35px) scale(1.2); }
    70% { opacity: 0.4; transform: translate(-5px, -50px) scale(0.8); }
    100% { opacity: 0; transform: translate(5px, -35px) scale(0.3); }
}

/* Win: EPIC — kanji + golden burst + katana flash */
.dealer-win { --dealer-eye: #ffd700; }
.dealer-win .dealer-body { animation: dealer-nod 0.6s ease-in-out 2; }
.dealer-win .dealer-scarf { animation: scarf-flutter-fast 0.8s ease-in-out infinite; }
.dealer-win .dealer-katana { animation: katana-flash 0.8s ease-out 2; }
.dealer-win::before {
    content: '\52DD'; /* 勝 victory */
    position: absolute; top: -10px; left: 50%;
    transform: translateX(-50%);
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1.5rem; font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255,215,0,0.8), 0 0 16px rgba(255,215,0,0.4);
    animation: kanji-rise 2s ease-out forwards;
    pointer-events: none; z-index: 10;
}
.dealer-win::after {
    content: ''; position: absolute; inset: -20px;
    background: radial-gradient(circle, rgba(255,215,0,0.35) 0%, rgba(212,175,55,0.15) 40%, transparent 70%);
    animation: golden-burst 2s ease-out forwards;
    border-radius: 50%; pointer-events: none;
}
@keyframes dealer-nod {
    0%, 100% { transform: scale(4) translateY(0); }
    40% { transform: scale(4) translateY(0.5px); }
}
@keyframes kanji-rise {
    0% { opacity: 0; transform: translateX(-50%) translateY(0) scale(0.5); }
    20% { opacity: 1; transform: translateX(-50%) translateY(-5px) scale(1.1); }
    50% { opacity: 1; transform: translateX(-50%) translateY(-15px) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(0.8); }
}
@keyframes golden-burst {
    0% { opacity: 0; transform: scale(0.3); }
    25% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.3); }
    100% { opacity: 0; transform: scale(1.8); }
}

/* Loss: red pulse + scarf limp + katana dim */
.dealer-loss { --dealer-eye: #dc143c; }
.dealer-loss .dealer-body { animation: dealer-shake 0.1s steps(1) 6; }
.dealer-loss .dealer-scarf { animation: none; transform: scale(4) translate(0.3px, 0.5px); opacity: 0.6; }
.dealer-loss .dealer-katana { filter: brightness(0.6); }
.dealer-loss::after {
    content: ''; position: absolute; inset: -15px;
    background: radial-gradient(circle, rgba(220,20,60,0.3) 0%, rgba(220,20,60,0.1) 40%, transparent 70%);
    animation: red-pulse 1s ease-out forwards;
    border-radius: 50%; pointer-events: none;
}
@keyframes dealer-shake {
    0%, 100% { transform: scale(4) translateX(0); }
    50% { transform: scale(4) translateX(0.5px); }
}
@keyframes red-pulse {
    0% { opacity: 0; transform: scale(0.5); }
    30% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.4); }
}

/* ===== MC Poker Table (Rich Visual) ===== */
.mc-poker-table-wrap { margin-bottom: 1rem; }
.mc-poker-header {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 0.5rem; font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
}
.mc-street-badge {
    font-family: 'Orbitron', sans-serif; font-size: 0.7rem; font-weight: 700;
    padding: 0.25rem 0.6rem; border-radius: 6px;
    border: 1px solid var(--gray-600); color: var(--gray-400);
    text-transform: uppercase; letter-spacing: 0.05em; flex-shrink: 0;
}
.mc-hand-num { color: var(--gray-500); font-size: 0.7rem; }
.mc-poker-turn {
    font-family: 'Orbitron', sans-serif; font-size: 0.7rem; font-weight: 700;
    padding: 0.25rem 0.75rem; border-radius: 6px; flex-shrink: 0; margin-left: auto;
    transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.mc-poker-turn.your-turn {
    color: var(--gold); border: 1px solid rgba(212,175,55,0.5);
    background: rgba(212,175,55,0.08); animation: mcTurnPulse 1.5s ease-in-out infinite;
}
.mc-poker-turn.waiting {
    color: var(--gray-400); border: 1px solid var(--gray-700); background: transparent;
}
@keyframes mcTurnPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,55,0); }
    50% { box-shadow: 0 0 8px 2px rgba(212,175,55,0.2); }
}

/* Table wrapper & felt */
.mc-table-wrapper {
    position: relative; width: 100%; aspect-ratio: 16 / 10; margin: 0 auto;
}
.mc-table {
    --felt: #0d4d2b; --felt-dark: #0a3d22;
    position: absolute; inset: 8%;
    background:
        repeating-linear-gradient(45deg, rgba(0,0,0,0.02) 0px, rgba(0,0,0,0.02) 2px, transparent 2px, transparent 8px),
        radial-gradient(ellipse at center, var(--felt) 0%, var(--felt-dark) 100%);
    border-radius: 50%;
    box-shadow:
        inset 0 0 80px rgba(0,0,0,0.4), inset 0 0 120px rgba(0,0,0,0.2),
        0 0 0 12px #2a1810, 0 0 0 16px #4a2c1a, 0 0 0 20px #1a0f08,
        0 0 0 21px rgba(212,175,55,0.15), 0 0 60px rgba(212,175,55,0.15), 0 0 100px rgba(0,0,0,0.5);
}
.mc-table::before {
    content: ''; position: absolute; inset: 16px;
    border: 2px solid rgba(212,175,55,0.25); border-radius: 50%; pointer-events: none;
}
.mc-table::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03; pointer-events: none;
}

/* Pot */
.mc-pot-display {
    position: absolute; top: 35%; left: 50%;
    transform: translate(-50%, -50%); text-align: center; z-index: 10;
}
.mc-pot-chips { display: flex; justify-content: center; margin-bottom: 0.3rem; }
.mc-pot-chip {
    width: 18px; height: 18px; border-radius: 50%;
    background: linear-gradient(135deg, var(--gold) 0%, #8B6914 100%);
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3), inset 0 1px 2px rgba(255,255,255,0.3);
    margin-left: -5px;
}
.mc-pot-chip:first-child { margin-left: 0; }
.mc-pot-amount {
    background: rgba(0,0,0,0.65); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    display: inline-block; padding: 0.35rem 0.9rem; border-radius: 12px;
    font-family: 'Orbitron', sans-serif; font-size: 0.85rem; font-weight: 700;
    color: var(--gold); border: 1px solid rgba(212,175,55,0.35);
}

/* Board cards */
.mc-board-area {
    position: absolute; top: 55%; left: 50%;
    transform: translate(-50%, -50%); display: flex; gap: 6px; z-index: 10;
}

/* Card styles */
.mc-card {
    width: 40px; height: 56px;
    background: linear-gradient(180deg, #fff 0%, #f0f0f0 100%);
    border: 2px solid #444; border-radius: 5px;
    display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    padding: 2px; font-weight: bold;
    box-shadow: 0 3px 10px rgba(0,0,0,0.4); position: relative;
}
.mc-card-rank { font-family: 'Georgia', serif; font-size: 0.8rem; line-height: 1; }
.mc-card-suit { font-size: 1rem; line-height: 1; }
.mc-card.hearts, .mc-card.diamonds { color: #cc0000; }
.mc-card.spades, .mc-card.clubs { color: #111; }

.mc-card.facedown {
    background: linear-gradient(135deg, #1a1a3a 0%, #2d1b4e 50%, #1a1a3a 100%);
    border: 2px solid #3d2a5c; justify-content: center; padding: 0; overflow: hidden;
}
.mc-card.facedown::before {
    content: ''; position: absolute; inset: 3px;
    border: 1px solid rgba(255,215,0,0.2); border-radius: 3px;
    background: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(255,215,0,0.03) 4px, rgba(255,215,0,0.03) 8px);
}
.mc-card.facedown::after {
    content: '\6D6A'; font-family: 'Noto Sans JP', sans-serif;
    font-size: 1.2rem; color: rgba(255,215,0,0.35);
    text-shadow: 0 0 8px rgba(255,215,0,0.2); z-index: 1;
}
.mc-board-area .mc-card { animation: mcBoardReveal 0.4s ease-out forwards; transform-style: preserve-3d; }

/* Seats (6-max) */
.mc-seat {
    position: absolute; text-align: center; z-index: 20;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.mc-seat-0 { bottom: -2%; left: 50%; transform: translateX(-50%); flex-direction: column-reverse; }
.mc-seat-1 { bottom: 8%; left: 4%; flex-direction: column-reverse; }
.mc-seat-2 { top: 8%; left: 4%; }
.mc-seat-3 { top: -2%; left: 50%; transform: translateX(-50%); }
.mc-seat-4 { top: 8%; right: 4%; left: auto; }
.mc-seat-5 { bottom: 8%; right: 4%; left: auto; flex-direction: column-reverse; }

/* Player cards */
.mc-player-cards { display: flex; gap: 3px; justify-content: center; transition: opacity 0.3s; }
.mc-player-cards .mc-card { width: 32px; height: 45px; }
.mc-player-cards .mc-card .mc-card-rank { font-size: 0.65rem; }
.mc-player-cards .mc-card .mc-card-suit { font-size: 0.8rem; }
.mc-player-cards .mc-card.dealing { animation: mcCardDeal 0.4s cubic-bezier(0.25,0.8,0.25,1) forwards; }

/* Player bet */
.mc-player-bet {
    font-family: 'JetBrains Mono', monospace; font-size: 0.65rem;
    color: var(--gold); background: rgba(0,0,0,0.7);
    padding: 0.1rem 0.35rem; border-radius: 4px; white-space: nowrap;
}
.mc-player-bet:empty { display: none; }

/* Player info pill */
.mc-player-info {
    background: linear-gradient(180deg, rgba(30,30,50,0.95) 0%, rgba(15,15,25,0.98) 100%);
    border-radius: 8px; padding: 0.4rem 0.5rem;
    border: 2px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(12px); position: relative;
    min-width: 80px; box-shadow: 0 3px 12px rgba(0,0,0,0.4);
    display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.mc-player-info::before {
    content: ''; position: absolute; inset: 0; border-radius: 8px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 50%); pointer-events: none;
}
.mc-player-info.you {
    border-color: rgba(212,175,55,0.5);
    box-shadow: 0 0 16px rgba(212,175,55,0.3), 0 3px 12px rgba(0,0,0,0.4);
}
.mc-agent-name {
    font-size: 0.6rem; color: var(--cyan); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 75px;
}
.mc-agent-stack {
    font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
    color: var(--green); font-weight: 600; transition: all 0.3s ease-out;
}

/* Dealer button */
.mc-dealer-button {
    position: absolute; width: 20px; height: 20px;
    background: linear-gradient(135deg, #fff 0%, #e8e8e8 50%, #d0d0d0 100%);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 0.5rem; font-weight: 800; color: #1a1a2e;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4), inset 0 1px 2px rgba(255,255,255,0.8);
    border: 2px solid var(--gold); z-index: 25;
    animation: mcDealerBtnPop 0.4s cubic-bezier(0.34,1.56,0.64,1);
    top: -6px; right: -6px;
}
.mc-dealer-button::after { content: 'D'; }

/* Seat states */
.mc-seat.folded .mc-player-info { opacity: 0.35; filter: grayscale(50%); }
.mc-seat.folded .mc-player-cards { opacity: 0.2; }
.mc-seat.to-act .mc-player-info {
    animation: mcToActPulse 1.5s ease-in-out infinite;
    border-color: #00f0ff; box-shadow: 0 0 20px rgba(0,240,255,0.4);
}
.mc-seat.winner .mc-player-info {
    animation: mcWinnerCelebrate 0.8s cubic-bezier(0.34,1.56,0.64,1);
    border-color: var(--gold);
    box-shadow: 0 0 30px rgba(212,175,55,0.8), 0 0 60px rgba(212,175,55,0.4);
}
.mc-seat.winner .mc-player-cards .mc-card {
    animation: mcWinnerCards 0.6s ease-out; box-shadow: 0 0 20px #ffd700;
}
.mc-seat.all-in .mc-player-info {
    box-shadow: 0 0 20px rgba(220,20,60,0.5), inset 0 0 10px rgba(220,20,60,0.15);
}

/* Badges */
.mc-thinking-indicator {
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, #00d4ff, #00f0ff);
    color: #0a0a0f; padding: 0.1rem 0.4rem; border-radius: 5px;
    font-size: 0.5rem; font-family: 'Orbitron', sans-serif; font-weight: 700;
    letter-spacing: 0.05em; box-shadow: 0 2px 8px rgba(0,240,255,0.5);
    animation: mcActionPulse 1.2s ease-in-out infinite; white-space: nowrap;
}
.mc-all-in-badge {
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    background: #dc143c; color: white;
    padding: 0.1rem 0.4rem; border-radius: 4px;
    font-size: 0.45rem; font-weight: 700; letter-spacing: 0.05em;
    animation: mcAllInPulse 1s ease-in-out infinite; white-space: nowrap;
}
.mc-action-badge {
    position: absolute; top: -22px; left: 50%;
    transform: translateX(-50%) scale(0);
    font-size: 0.55rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; padding: 2px 6px; border-radius: 4px;
    white-space: nowrap; pointer-events: none; z-index: 25;
    animation: mcBadgeIn 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.mc-action-badge.badge-out { animation: mcBadgeOut 0.3s ease forwards; }
.mc-action-badge.fold { background: var(--gray-700); color: var(--gray-400); }
.mc-action-badge.check { background: rgba(76,175,80,0.15); color: #4CAF50; border: 1px solid rgba(76,175,80,0.3); }
.mc-action-badge.call { background: rgba(33,150,243,0.15); color: #2196F3; border: 1px solid rgba(33,150,243,0.3); }
.mc-action-badge.bet, .mc-action-badge.raise { background: rgba(255,152,0,0.15); color: #FF9800; border: 1px solid rgba(255,152,0,0.3); }
.mc-action-badge.allin { background: rgba(244,67,54,0.2); color: #f44336; border: 1px solid rgba(244,67,54,0.4); font-weight: 800; }

/* Turn timer */
.mc-turn-timer {
    position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
    width: 60%; height: 3px; background: rgba(0,0,0,0.3); border-radius: 2px; overflow: hidden;
}
.mc-turn-timer-bar {
    height: 100%; background: linear-gradient(90deg, #00f0ff, #dc143c);
    transition: width 0.5s linear; border-radius: 2px;
}

/* Animations */
@keyframes mcToActPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0,240,255,0.3); }
    50% { box-shadow: 0 0 25px rgba(0,240,255,0.5), 0 0 40px rgba(0,240,255,0.2); }
}
@keyframes mcWinnerCelebrate {
    0% { transform: scale(1); } 25% { transform: scale(1.08); }
    50% { transform: scale(1.04); } 100% { transform: scale(1); }
}
@keyframes mcWinnerCards {
    0% { transform: scale(1); } 50% { transform: scale(1.1) translateY(-4px); } 100% { transform: scale(1); }
}
@keyframes mcCardDeal {
    from { transform: translateY(-80px) rotate(15deg) scale(0.5); opacity: 0; }
    to { transform: translateY(0) rotate(0) scale(1); opacity: 1; }
}
@keyframes mcBoardReveal {
    from { transform: rotateY(90deg) scale(0.8); opacity: 0.5; }
    to { transform: rotateY(0) scale(1); opacity: 1; }
}
@keyframes mcBadgeIn {
    from { transform: translateX(-50%) scale(0); opacity: 0; }
    to { transform: translateX(-50%) scale(1); opacity: 1; }
}
@keyframes mcBadgeOut {
    from { transform: translateX(-50%) scale(1); opacity: 1; }
    to { transform: translateX(-50%) scale(0.8); opacity: 0; }
}
@keyframes mcActionPulse {
    0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.85; transform: translateX(-50%) scale(1.05); }
}
@keyframes mcAllInPulse {
    0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.8; transform: translateX(-50%) scale(1.05); }
}
@keyframes mcDealerBtnPop {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .mc-action-badge { display: none; }
    .mc-player-info { min-width: 65px; padding: 0.3rem 0.4rem; }
    .mc-agent-name { display: none; }
}
@media (max-width: 480px) {
    .mc-poker-table-wrap .mc-table-wrapper { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .mc-card, .mc-player-info, .mc-player-cards, .mc-pot-amount,
    .mc-agent-stack, .mc-pot-chip, .mc-action-badge,
    .mc-thinking-indicator, .mc-all-in-badge, .mc-board-area .mc-card {
        animation: none !important; transition: none !important;
    }
}

/* ===== MC Blackjack Card Display ===== */
.mc-bj-table {
    background: linear-gradient(135deg, rgba(16,52,32,0.4), var(--gray-900));
    border: 1px solid rgba(34,197,94,0.25);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}
.bj-dealer-row, .bj-player-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0;
}
.bj-label {
    font-size: 0.65rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 3.5rem;
    flex-shrink: 0;
}
.bj-cards {
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
    min-width: 0;
}
.bj-cards .card-red { color: #ef4444; }
.bj-cards .card-black { color: #ccc; }
.bj-cards .card-hole { color: var(--gray-600); font-style: italic; }
.bj-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
    flex-shrink: 0;
    min-width: 1.5rem;
    text-align: right;
}
.bj-divider {
    border-top: 1px solid var(--gray-700);
    margin: 0.2rem 0;
}
.bj-phase {
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-500);
    padding-top: 0.4rem;
}
.bj-phase.active { color: var(--gold); }
.bj-phase.complete { color: var(--green); }

/* ===== Balance Polling Spinner ===== */
.balance-polling::after {
    content: ''; display: inline-block; width: 8px; height: 8px;
    border: 1.5px solid var(--gray-600); border-top-color: var(--gold);
    border-radius: 50%; margin-left: 6px; vertical-align: middle;
    animation: bp-spin 0.8s linear infinite;
}
@keyframes bp-spin { to { transform: rotate(360deg); } }

/* ===== Game Cards ===== */
.game-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.game-card { background: var(--gray-900); border: 3px solid var(--gray-700); border-radius: 16px; padding: 2rem 1.5rem; text-align: center; cursor: pointer; transition: all 0.25s; position: relative; }
.game-card:hover:not(.disabled) { border-color: rgba(212,175,55,0.5); transform: translateY(-6px); box-shadow: 0 12px 32px rgba(0,0,0,0.4); }
.game-card.selected { border-color: var(--gold); background: rgba(212,175,55,0.06); box-shadow: 0 0 28px rgba(212,175,55,0.2); }
.game-card.disabled { opacity: 0.4; cursor: not-allowed; }
.game-card-soon { position: absolute; top: 12px; right: 12px; background: var(--gray-700); color: var(--gray-400); font-size: 0.55rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 10px; letter-spacing: 0.08em; }
.game-card-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.game-card h3 { font-family: 'Orbitron', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 0.35rem; }
.game-tagline { font-size: 0.8rem; color: var(--gray-400); margin-bottom: 0.75rem; }
.game-attrs { display: flex; gap: 0.4rem; justify-content: center; flex-wrap: wrap; }
.game-attr { background: var(--gray-800); border: 1px solid var(--gray-700); padding: 0.2rem 0.5rem; border-radius: 10px; font-size: 0.65rem; color: var(--gray-300); }

/* ===== Personality Cards ===== */
.personality-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 1.25rem; }
.personality-card { background: var(--gray-900); border: 2px solid var(--gray-700); border-radius: 14px; padding: 1.1rem 0.85rem; text-align: center; cursor: pointer; transition: all 0.2s; }
.personality-card:hover { border-color: var(--gray-500); transform: translateY(-2px); }
.personality-card.selected { border-color: var(--gold); background: rgba(212,175,55,0.08); box-shadow: 0 0 16px rgba(212,175,55,0.15); }
.personality-icon { font-size: 1.75rem; margin-bottom: 0.4rem; }
.personality-card h4 { font-family: 'Orbitron', sans-serif; font-size: 0.75rem; font-weight: 700; margin-bottom: 0.15rem; }
.personality-card p { font-size: 0.65rem; color: var(--gray-400); line-height: 1.45; }

/* ===== Risk Slider ===== */
.risk-slider-wrap { background: var(--gray-900); border: 1px solid var(--gray-700); border-radius: 14px; padding: 1.25rem; margin-bottom: 1rem; }
.risk-labels { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; font-size: 0.75rem; color: var(--gray-400); }
.risk-value { font-family: 'Orbitron', sans-serif; font-size: 1.4rem; font-weight: 700; color: var(--gold); }
.risk-slider { width: 100%; height: 8px; background: linear-gradient(90deg, #22c55e 0%, var(--gold) 50%, var(--red) 100%); border-radius: 4px; outline: none; -webkit-appearance: none; appearance: none; margin-bottom: 0.6rem; }
.risk-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: white; border: 3px solid var(--gold); cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.risk-slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: white; border: 3px solid var(--gold); cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.risk-hint { font-size: 0.7rem; color: var(--gray-400); text-align: center; }

/* ===== Fund & Launch Section ===== */

/* Stack Picker */
.stack-picker { margin-bottom: 1.5rem; }
.stack-label { font-family: 'Rajdhani', sans-serif; font-size: 1rem; font-weight: 600; color: var(--gray-300); text-align: center; margin: 0 0 1rem; }
.stack-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 0.75rem; }
.stack-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem 0.5rem; border: 2px solid var(--gray-700); background: var(--gray-900); border-radius: 12px; cursor: pointer; transition: all 0.2s; }
.stack-btn:hover { border-color: rgba(212,175,55,0.5); background: rgba(212,175,55,0.04); transform: translateY(-2px); }
.stack-btn.selected { border-color: var(--gold); background: rgba(212,175,55,0.1); box-shadow: 0 0 16px rgba(212,175,55,0.15); }
.stack-val { font-family: 'Orbitron', sans-serif; font-size: 1.3rem; font-weight: 700; color: var(--gray-300); line-height: 1; }
.stack-btn.selected .stack-val { color: var(--gold); }
.stack-unit { font-size: 0.6rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.25rem; }
.stack-btn.selected .stack-unit { color: rgba(212,175,55,0.7); }

/* Custom amount (inline) */
.stack-custom { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.stack-custom-label { font-size: 0.75rem; color: var(--gray-500); }
.stack-custom .input { max-width: 100px; text-align: center; font-size: 1rem; font-family: 'JetBrains Mono', monospace; padding: 0.4rem 0.6rem; }
.stack-custom-unit { font-size: 0.8rem; color: var(--gray-500); font-weight: 600; }

/* Balance context */
.stack-context { text-align: center; font-size: 0.75rem; color: var(--gray-500); padding-top: 0.25rem; }
.stack-balance strong { color: var(--gray-300); font-family: 'JetBrains Mono', monospace; }
.stack-shortfall { color: #ff4444; font-weight: 600; }

/* Session Settings (collapsed) */
.fl-advanced { margin-bottom: 1.5rem; border: 1px solid var(--gray-700); border-radius: 10px; background: var(--gray-900); }
.fl-advanced summary { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; cursor: pointer; font-size: 0.8rem; font-weight: 600; color: var(--gray-300); list-style: none; }
.fl-advanced summary::-webkit-details-marker { display: none; }
.fl-advanced[open] .fl-adv-arrow { transform: rotate(90deg); }
.fl-adv-arrow { transition: transform 0.2s; display: inline-block; font-size: 0.7rem; }
.fl-adv-content { padding: 0 1rem 1rem; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 0.4rem 0; font-size: 0.8rem; }
.setting-row label { color: var(--gray-400); min-width: 90px; }
.setting-input { display: flex; align-items: center; gap: 0.3rem; }
.setting-input .input { max-width: 90px; text-align: right; }
.setting-input span { color: var(--gray-500); font-size: 0.75rem; }
.setting-row .select { max-width: 160px; }

/* Deploy Button */
.btn-deploy { width: 100%; padding: 1rem 2rem; font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; background: linear-gradient(135deg, var(--gold) 0%, #b8860b 100%); border: none; border-radius: 10px; color: #000; cursor: pointer; transition: all 0.2s; font-family: 'Rajdhani', sans-serif; }
.btn-deploy:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(212,175,55,0.4); }
.btn-deploy:disabled { background: var(--gray-700); color: var(--gray-500); cursor: not-allowed; transform: none; box-shadow: none; }
.deploy-blocker { text-align: center; color: #ff4444; font-size: 0.8rem; margin-top: 0.4rem; }

/* ===== AI Brain Gate (Step 0) ===== */
.ai-gate-container { max-width: 680px; margin: 2rem auto; padding: 2rem; }
.ai-gate-header { text-align: center; margin-bottom: 2rem; }
.ai-gate-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.ai-gate-header h2 { font-family: 'Orbitron', sans-serif; font-size: 1.4rem; font-weight: 700; margin-bottom: 0.5rem; }
.ai-gate-header p { color: var(--gray-400); font-size: 0.9rem; }
.ai-gate-providers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.ai-gate-provider-card { background: var(--gray-900); border: 2px solid var(--gray-700); border-radius: 14px; padding: 1.75rem 1.25rem; text-align: center; cursor: pointer; transition: all 0.25s; position: relative; }
.ai-gate-provider-card:hover { border-color: var(--gold); transform: translateY(-4px); box-shadow: 0 8px 24px rgba(212,175,55,0.15); }
.ai-gate-provider-card.selected { border-color: var(--gold); background: rgba(212,175,55,0.06); }
.ai-gate-badge { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); background: var(--gold); color: var(--black); font-size: 0.55rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 10px; letter-spacing: 0.05em; white-space: nowrap; }
.ai-gate-badge.free-badge { background: #22c55e; color: #000; font-weight: 800; letter-spacing: 0.08em; }
.ai-gate-provider-card.ronin-featured { border-color: var(--gold); background: linear-gradient(135deg, rgba(212,175,55,0.06), rgba(212,175,55,0.02)); padding: 1.5rem 1.25rem; display: flex; align-items: center; gap: 1rem; text-align: left; }
.ai-gate-provider-card.ronin-featured .ai-gate-provider-icon { font-size: 2.5rem; margin-bottom: 0; flex-shrink: 0; }
.ai-gate-provider-card.ronin-featured h3 { margin-bottom: 0.1rem; }
.ai-gate-provider-card.ronin-featured:hover { border-color: var(--gold); box-shadow: 0 0 24px rgba(212,175,55,0.25); }
.ai-gate-provider-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.ai-gate-provider-card h3 { font-family: 'Orbitron', sans-serif; font-size: 0.85rem; font-weight: 700; margin-bottom: 0.25rem; }
.ai-gate-provider-card p { font-size: 0.7rem; color: var(--gray-400); }
.ai-gate-key-section { max-width: 480px; margin: 0 auto; }
.ai-gate-key-section h3 { font-family: 'Orbitron', sans-serif; font-size: 1.1rem; margin-bottom: 1rem; }
.ai-gate-back { background: none; border: none; color: var(--gray-400); cursor: pointer; font-size: 0.8rem; margin-bottom: 1rem; padding: 0; }
.ai-gate-back:hover { color: var(--gold); }
.ai-gate-instructions { background: var(--gray-900); border: 1px solid var(--gray-700); border-radius: 10px; padding: 1rem; font-size: 0.78rem; color: var(--gray-300); margin-bottom: 1rem; line-height: 1.6; }
.ai-gate-instructions a { color: var(--cyan, #00f0ff); text-decoration: none; }
.ai-gate-instructions ol { padding-left: 1.25rem; margin: 0.5rem 0 0; }
.ai-gate-instructions li { margin-bottom: 0.3rem; }
.ai-gate-privacy { font-size: 0.7rem; color: var(--green, #22c55e); margin-top: 0.75rem; text-align: center; }
.ai-gate-success-box { text-align: center; background: rgba(34,197,94,0.06); border: 1px solid rgba(34,197,94,0.2); border-radius: 14px; padding: 1.5rem; }
.ai-gate-check { width: 56px; height: 56px; margin: 0 auto 0.75rem; background: var(--green, #22c55e); color: var(--black); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.75rem; font-weight: 700; }
.ai-gate-connected-detail { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-top: 0.75rem; font-size: 0.8rem; color: var(--gray-400); }

/* Deploy Hero Button */
.btn-deploy-hero { font-size: 1.1rem; padding: 1.1rem; border-radius: 14px; letter-spacing: 0.06em; box-shadow: 0 0 24px rgba(212,175,55,0.2); margin-top: 0.5rem; }
.btn-deploy-hero:hover:not(:disabled) { box-shadow: 0 0 40px rgba(212,175,55,0.35); transform: translateY(-2px); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .container { padding: 1.5rem 1rem; }
    .deploy-section { padding: 1.25rem; }
    .personality-card { padding: 1rem 0.75rem; }
    .hero-mini h1 { font-size: 1.5rem; }
    .identity-paths { grid-template-columns: 1fr; }
    .fund-grid { grid-template-columns: 1fr; }
    .strategy-grid { grid-template-columns: repeat(2, 1fr); }
    .mc-stats { grid-template-columns: 1fr 1fr; }
    .agent-grid { grid-template-columns: 1fr; }
    .agg-stats { grid-template-columns: 1fr 1fr; }
    .progress-step .step-label { display: none; }
    .progress-connector { width: 16px; }
    .row { flex-direction: column; }
    .deploy-bar { padding: 0.5rem 1rem 0.75rem; }
    .deploy-btn { padding: 0.7rem; font-size: 0.95rem; }
    .deploy-bankroll-row { font-size: 0.75rem; gap: 0.3rem; }
    .deploy-input { width: 65px; font-size: 0.8rem; }
    .budget-row { flex-direction: column; }
    .budget-row .input { width: 100%; max-width: none; }
    #configContainer { padding-bottom: 120px; }
    .game-cards-grid { grid-template-columns: 1fr; }
    .personality-grid { grid-template-columns: repeat(2, 1fr); }
    .stack-presets { grid-template-columns: repeat(2, 1fr); }
    .ai-gate-providers { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .ronin-dealer-wrap { display: none; }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .progress-step.active .step-num { animation: none !important; }
    .dealer-body, .dealer-eyes, .dealer-arm, .dealer-coin,
    .dealer-katana, .dealer-scarf,
    .dealer-win::before, .dealer-win::after,
    .dealer-loss::after, .dealer-toss::before,
    .ronin-dealer-wrap::after { animation: none !important; transition: none !important; }
    .dealer-toss .dealer-coin { opacity: 0; }
    .dealer-win::before { display: none; }
    .balance-polling::after { animation: none; border-top-color: var(--gray-600); }
}
