/* ═══════════════════════════════════════════════════════════════════════════
   BOTS IN THE FAST LANE — Electric Playground
   A game site that actually looks like a game.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Fonts ──────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;500;600;700;800&display=swap');

/* ─── Reset & Base ───────────────────────────────────────────────────────── */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Backgrounds — warm purple-black */
    --bg: #0F0B1E;
    --bg-surface: #1A1530;
    --bg-elevated: #241E3E;
    --bg-hover: #2F2750;

    /* Borders — visible, plummy */
    --border: #3D3460;
    --border-focus: #5B4F8A;

    /* Primary — bubblegum pink */
    --primary: #F471B5;
    --primary-light: #F9A8D4;
    --primary-dark: #DB2777;
    --primary-glow: rgba(244, 113, 181, 0.2);
    --gradient-primary: linear-gradient(135deg, #F471B5, #A78BFA, #22D3EE);
    --gradient-btn: linear-gradient(135deg, #F471B5, #C084FC);

    /* Secondary & Status — all vivid, all fun */
    --secondary: #FBBF24;
    --cyan: #22D3EE;
    --success: #34D399;
    --warning: #FBBF24;
    --danger: #FB7185;
    --purple: #A78BFA;
    --lime: #A3E635;

    /* Text — warm purple-tinted whites */
    --text: #F1E8FF;
    --text-secondary: #B0A4CC;
    --text-tertiary: #7A6FA0;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(15, 11, 30, 0.4);
    --shadow-md: 0 4px 20px rgba(15, 11, 30, 0.5);
    --shadow-lg: 0 8px 40px rgba(15, 11, 30, 0.6);
    --shadow-glow: 0 0 24px var(--primary-glow);
    --shadow-glow-cyan: 0 0 20px rgba(34, 211, 238, 0.15);

    /* Typography */
    --font-display: 'Fredoka', 'Nunito', sans-serif;
    --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

    /* Layout */
    --header-height: 60px;
    --footer-height: 42px;
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

html {
    font-size: 15px;
    scrollbar-color: var(--border-focus) var(--bg);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary);
}

::selection {
    background: rgba(244, 113, 181, 0.3);
    color: var(--text);
}

/* ─── Header ─────────────────────────────────────────────────────────────── */

header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 11, 30, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s ease, transform 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--text);
    transform: translateY(-1px);
}

.nav-link.active {
    color: var(--text);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px 3px 0 0;
}

.nav-icon {
    margin-right: 0.35rem;
    font-size: 0.85em;
    --fa-secondary-opacity: 0.35;
}

.nav-link:hover .nav-icon {
    --fa-primary-color: var(--primary-light);
    --fa-secondary-opacity: 0.5;
}

.nav-link.active .nav-icon {
    --fa-primary-color: var(--primary);
    --fa-secondary-color: var(--cyan);
    --fa-secondary-opacity: 0.6;
}

.nav-pill {
    background: linear-gradient(135deg, rgba(244, 113, 181, 0.08), rgba(167, 139, 250, 0.08));
    border: 1.5px solid var(--border-focus);
    padding: 0.3rem 0.85rem;
    border-radius: 100px;
    color: var(--text);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-pill:hover {
    background: linear-gradient(135deg, rgba(244, 113, 181, 0.15), rgba(167, 139, 250, 0.15));
    border-color: var(--primary);
    color: var(--text);
    box-shadow: 0 0 14px rgba(244, 113, 181, 0.2);
}

.nav-pill.active {
    background: linear-gradient(135deg, rgba(244, 113, 181, 0.18), rgba(167, 139, 250, 0.18));
    border-color: var(--primary);
    color: var(--text);
    box-shadow: 0 0 16px rgba(244, 113, 181, 0.25);
}

.nav-pill .nav-icon {
    --fa-primary-color: var(--primary);
    --fa-secondary-color: var(--purple);
    --fa-secondary-opacity: 0.5;
}

/* ─── Main Content ───────────────────────────────────────────────────────── */

main {
    flex: 1;
    padding: 2rem 1.5rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */

footer {
    height: var(--footer-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}


.footer-legal {
    margin-left: 1.5rem;
}
.footer-legal a {
    color: var(--text-tertiary);
    text-decoration: none;
    margin-right: 1rem;
    transition: color 0.2s;
}
.footer-legal a:hover {
    color: var(--primary);
}

.status-online { color: var(--success); }
.status-offline { color: var(--danger); }
.status-online::before,
.status-offline::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.status-online::before { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-offline::before { background: var(--danger); }

/* ─── Panels & Cards ────────────────────────────────────────────────────── */

.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.panel-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transform: translateY(-3px);
}

/* ─── Forms & Inputs ─────────────────────────────────────────────────────── */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
}

input, select, textarea {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    padding: 0.65rem 0.9rem;
    width: 100%;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

input::placeholder {
    color: var(--text-tertiary);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23B0A4CC' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */

.btn {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.6rem 1.35rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-focus);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--gradient-btn);
    border: none;
    color: #fff;
    box-shadow: var(--shadow-sm);
    padding: 0.65rem 1.5rem;
}

.btn-primary:hover {
    filter: brightness(1.15);
    box-shadow: var(--shadow-glow), var(--shadow-md);
    transform: translateY(-2px);
}

.btn-danger {
    border-color: rgba(251, 113, 133, 0.4);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(251, 113, 133, 0.12);
    border-color: var(--danger);
}

.btn-small {
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ─── Tables ─────────────────────────────────────────────────────────────── */

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

tr {
    transition: background 0.15s ease;
}

tr:hover td {
    background: var(--bg-hover);
}

/* ─── Stats & Meters ─────────────────────────────────────────────────────── */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.3rem;
}

.meter {
    width: 100%;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    margin-top: 0.4rem;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--success);
    transition: width 0.5s ease;
}

.meter-fill.warning {
    background: var(--warning);
}

.meter-fill.danger {
    background: var(--danger);
}

/* ─── Game Board ─────────────────────────────────────────────────────────── */

.board-container {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    aspect-ratio: 3 / 2;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 20% 80%, rgba(244, 113, 181, 0.06) 0%, transparent 50%),
        var(--bg);
}

/* Layer 0: SVG connection lines */
.board-svg-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.board-edge {
    stroke: var(--border-focus);
    stroke-width: 2;
    stroke-dasharray: 8 5;
    opacity: 0.5;
    transition: stroke 0.3s ease, opacity 0.3s ease;
}

.board-edge-active {
    stroke: var(--cyan);
    opacity: 0.7;
    stroke-dasharray: none;
    filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.3));
}

.board-edge-label {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    fill: var(--secondary);
    text-anchor: middle;
}

.board-edge-pill {
    fill: var(--bg);
    stroke: var(--border);
    stroke-width: 1;
}

/* Layer 1: Location tiles */
.board-tile {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 17%;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.25s ease, filter 0.25s ease;
    text-align: center;
}

.board-tile-img-wrap {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: rgba(26, 21, 48, 0.5);
}

.board-tile-img {
    width: 100%;
    height: auto;
    display: block;
    filter: brightness(0.9) saturate(0.9);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.board-tile:hover {
    transform: translate(-50%, -50%) scale(1.08);
    z-index: 5;
}

.board-tile:hover .board-tile-img {
    filter: brightness(1.1) saturate(1.15);
}

.board-tile:hover .board-tile-img-wrap {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-md);
}

.board-tile-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-top: 0.25rem;
    text-shadow: 0 1px 6px rgba(15, 11, 30, 0.9);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

/* Current location highlight */
.board-tile--current .board-tile-img-wrap {
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px var(--cyan), 0 0 24px rgba(34, 211, 238, 0.35);
}

.board-tile--current .board-tile-img {
    filter: brightness(1.15) saturate(1.2);
}

.board-tile--current .board-tile-label {
    color: var(--cyan);
}

@keyframes locationPulse {
    0%, 100% { box-shadow: 0 0 0 2px var(--cyan), 0 0 20px rgba(34, 211, 238, 0.3); }
    50%      { box-shadow: 0 0 0 2px var(--cyan), 0 0 32px rgba(34, 211, 238, 0.5); }
}

.board-tile--current .board-tile-img-wrap {
    animation: locationPulse 2.5s ease-in-out infinite;
}

/* Reachable locations (can move here) */
.board-tile--reachable .board-tile-img-wrap {
    border-color: rgba(244, 113, 181, 0.5);
    border-style: dashed;
}

.board-tile--reachable:hover .board-tile-img-wrap {
    border-color: var(--primary);
    border-style: solid;
    box-shadow: 0 0 16px rgba(244, 113, 181, 0.3);
}

/* Layer 2: Player tokens */
.board-token {
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--bg);
    z-index: 10;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: left 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                top 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: tokenAppear 0.4s ease backwards;
}

@keyframes tokenAppear {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.board-token--self {
    background: var(--cyan);
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.6);
    width: 26px;
    height: 26px;
    z-index: 11;
}

.board-token--other {
    background: var(--secondary);
    opacity: 0.85;
}

.board-token--inactive {
    background: var(--text-tertiary);
    opacity: 0.4;
}

/* Responsive board */
@media (max-width: 768px) {
    .board-tile { width: 20%; }
    .board-tile-label { font-size: 0.6rem; }
    .board-edge-label { font-size: 11px; }
    .board-token { width: 18px; height: 18px; }
    .board-token--self { width: 22px; height: 22px; }
}

@media (max-width: 480px) {
    .board-tile { width: 23%; }
    .board-tile-label { font-size: 0.55rem; }
    .board-edge-label { display: none; }
    .board-edge-pill { display: none; }
}

/* ─── Action List ────────────────────────────────────────────────────────── */

.action-list {
    list-style: none;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-item:hover {
    border-color: var(--border);
    background: var(--bg-hover);
    transform: translateX(4px);
}

.action-item .cost {
    color: var(--secondary);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.action-queue {
    list-style: none;
    counter-reset: action-counter;
}

.action-queue li {
    counter-increment: action-counter;
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.action-queue li::before {
    content: counter(action-counter) ".";
    color: var(--text-tertiary);
    margin-right: 0.5rem;
    font-weight: 700;
}

.action-queue li .remove-action {
    color: var(--danger);
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}

.action-queue li .remove-action:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* ─── Turn Log ───────────────────────────────────────────────────────────── */

.log-entry {
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(61, 52, 96, 0.5);
    font-size: 0.85rem;
}

.log-entry .timestamp {
    color: var(--text-tertiary);
    margin-right: 0.5rem;
}

.log-entry.success { color: var(--success); }
.log-entry.failure { color: var(--danger); }
.log-entry.event { color: var(--secondary); }
.log-entry.info { color: var(--cyan); }

/* ─── Landing Page ───────────────────────────────────────────────────────── */

.landing {
    text-align: center;
}

/* Hero section — image background with overlaid content */
.hero-section {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 2rem;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-section-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    z-index: 0;
}

.hero-section-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(15, 11, 30, 0.55) 0%,
        rgba(15, 11, 30, 0.7) 50%,
        rgba(15, 11, 30, 0.85) 100%
    );
    z-index: 1;
}

.hero-section-content {
    position: relative;
    z-index: 2;
    padding: 3.5rem 2rem;
    max-width: 700px;
}

.landing-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.01em;
    margin-bottom: 0.6em;
    line-height: 1.15;
    text-shadow: none;
}

.landing-subtitle {
    font-size: 1.15rem;
    color: rgba(241, 232, 255, 0.92);
    margin-bottom: 2rem;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.75;
}

/* Buttons on hero get a frosted-glass look */
.btn-hero {
    background: rgba(36, 30, 62, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(91, 79, 138, 0.6);
}

.btn-hero:hover {
    background: rgba(47, 39, 80, 0.8);
    border-color: var(--border-focus);
}

/* Feature cards — horizontal layout with icon on left */
.landing-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
    text-align: left;
}

.feature-card {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--bg-surface);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
    padding: 0;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-focus);
    box-shadow: var(--shadow-md);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 110px;
    min-height: 100%;
    display: block;
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
    object-fit: cover;
    flex-shrink: 0;
    filter: brightness(0.9) saturate(1.1);
    transition: filter 0.3s ease;
}

.feature-card:hover .feature-icon {
    filter: brightness(1.05) saturate(1.2);
}

/* FA icon replacement for feature cards */
.feature-fa-icon,
i.feature-fa-icon {
    width: 110px;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
    flex-shrink: 0;
    font-size: 2.5rem;
    background: var(--bg-elevated);
    --fa-primary-color: #F471B5;
    --fa-secondary-color: #A78BFA;
    --fa-secondary-opacity: 0.45;
    transition: all 0.3s ease;
}

.feature-card:hover .feature-fa-icon {
    --fa-primary-color: #F9A8D4;
    --fa-secondary-color: #22D3EE;
    --fa-secondary-opacity: 0.6;
    background: var(--bg-hover);
}

.feature-text {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

.feature-card h3 {
    font-family: var(--font-display);
    color: var(--text);
    margin-bottom: 0.35rem;
    font-size: 1rem;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.65;
}

/* Board preview — same width as feature grid */
.board-preview {
    text-align: center;
}

/* ─── Lobby ──────────────────────────────────────────────────────────────── */

.lobby-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.lobby-filter-chips {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lobby-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    user-select: none;
}

.lobby-filter-toggle .toggle-switch { flex-shrink: 0; }

.lobby-search-wrap {
    flex-shrink: 0;
}

.lobby-search {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    padding: 0.4rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    width: 180px;
    transition: border-color 0.2s;
}

.lobby-search:focus {
    outline: none;
    border-color: var(--border-focus);
}

.lobby-search::placeholder {
    color: var(--text-tertiary);
}

.lobby-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.lobby-count {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}


.lobby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.game-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    padding: 1.35rem;
    transition: all 0.25s ease;
    cursor: pointer;
}

.game-card:hover {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.game-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.game-card-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
}

.game-card-pace {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 2px solid;
}

.pace-blitz {
    color: var(--danger);
    border-color: rgba(251, 113, 133, 0.4);
    background: rgba(251, 113, 133, 0.1);
}

.pace-standard {
    color: var(--secondary);
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.1);
}

.pace-marathon {
    color: var(--cyan);
    border-color: rgba(34, 211, 238, 0.4);
    background: rgba(34, 211, 238, 0.1);
}

.game-card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ─── Seed Display ───────────────────────────────────────────────────────── */

.seed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

.seed-param {
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
}

.seed-param-label {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.seed-param-value {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 0.2rem;
}

/* ─── Toast Notifications ────────────────────────────────────────────────── */

#toast-container {
    position: fixed;
    bottom: 3.5rem;
    right: 1.5rem;
    z-index: 999;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.6rem;
}

.toast {
    padding: 0.85rem 1.35rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    font-size: 0.875rem;
    font-weight: 600;
    max-width: 400px;
    animation: slideIn 0.3s ease;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(8px);
}

.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.info { border-color: var(--cyan); color: var(--cyan); }
.toast.warning { border-color: var(--secondary); color: var(--secondary); }

/* ─── Illustration Assets ────────────────────────────────────────────────── */

.hero-illustration {
    width: 100%;
    max-width: none;
    margin: 2rem auto;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.hero-illustration img {
    width: 100%;
    height: auto;
    display: block;
}

.mascot-illustration {
    max-width: 200px;
    margin: 0 auto 1rem;
}

.mascot-illustration img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(15, 11, 30, 0.5));
}

/* Legacy placeholder support */
.placeholder-graphic {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    color: var(--text-tertiary);
    font-size: 0.85rem;
    min-height: 100px;
}

.placeholder-graphic::before {
    content: "[placeholder: " attr(data-graphic) "]";
}

.placeholder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    font-size: 1.5rem;
}

/* ─── Two-Column Layout (Game View) ─────────────────────────────────────── */

.game-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 1.25rem;
}

@media (max-width: 900px) {
    .game-layout {
        grid-template-columns: 1fr;
    }
}

/* ─── Tab Bar ────────────────────────────────────────────────────────────── */

.tab-bar {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.25rem;
    gap: 0.25rem;
}

.tab {
    padding: 0.65rem 1.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 700;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    margin-bottom: -2px;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab.tab-accent {
    color: var(--secondary);
}
.tab.tab-accent.active {
    color: var(--secondary);
    border-bottom-color: var(--secondary);
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-success {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
}
.badge-dim {
    background: rgba(176, 164, 204, 0.1);
    color: var(--text-tertiary);
}

/* ─── Code Block (for bot docs) ──────────────────────────────────────────── */

.code-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.7;
    margin: 0.85rem 0;
    color: var(--text-secondary);
}

/* ─── Modal ──────────────────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 11, 30, 0.7);
    backdrop-filter: blur(6px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    html { font-size: 14px; }

    header {
        flex-direction: column;
        height: auto;
        padding: 0.65rem 1rem;
        gap: 0.5rem;
    }

    .header-right {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    main { padding: 1.25rem 1rem; }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .landing-title {
        font-size: 2rem;
    }

    .hero-section {
        min-height: 360px;
    }

    .hero-section-content {
        padding: 2.5rem 1.25rem;
    }

    .landing-features {
        grid-template-columns: 1fr;
    }

    .feature-icon {
        width: 90px;
    }
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .seed-grid {
        grid-template-columns: 1fr 1fr;
    }

    .lobby-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Animations ─────────────────────────────────────────────────────────── */

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ─── Seed Grid & Economy Panel ──────────────────────────────────────────── */

.seed-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.seed-param {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    text-align: center;
    transition: border-color 0.3s;
}

.seed-param--changed {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(244, 113, 181, 0.15);
}

.seed-param-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

.seed-param-value {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.seed-change {
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.15rem;
}

.seed-change--up { color: var(--success); }
.seed-change--down { color: var(--danger); }
.seed-change--flat { color: var(--text-secondary); }

/* ─── News Banner ────────────────────────────────────────────────────────── */

.news-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    border-left: 4px solid;
    animation: newsSlideIn 0.4s ease-out;
}

.news-banner--up {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.08), rgba(52, 211, 153, 0.02));
    border-left-color: var(--success);
}

.news-banner--down {
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.08), rgba(251, 113, 133, 0.02));
    border-left-color: var(--danger);
}

.news-banner-icon {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    padding-top: 0.1rem;
}

.news-banner--up .news-banner-icon { color: var(--success); }
.news-banner--down .news-banner-icon { color: var(--danger); }

.news-banner-content {
    flex: 1;
}

.news-banner-headline {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.news-banner-body {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.news-banner-tag {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-elevated);
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    white-space: nowrap;
}

@keyframes newsSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── News Archive ───────────────────────────────────────────────────────── */

.news-archive-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.news-archive-item {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.news-archive-item:last-child {
    border-bottom: none;
}

.news-archive-turn {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    white-space: nowrap;
    flex-shrink: 0;
}

.news-archive-headline {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.news-archive-detail {
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Seed Timeline (parameter evolution summary) */

.seed-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.seed-timeline-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.seed-timeline-label {
    width: 120px;
    flex-shrink: 0;
    color: var(--text-secondary);
    font-weight: 600;
}

.seed-timeline-points {
    flex: 1;
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.seed-timeline-net {
    font-weight: 700;
    flex-shrink: 0;
    font-size: 0.7rem;
}

/* ─── Economy Summary ────────────────────────────────────────────────────── */

.economy-summary {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

/* ─── Indicator Cards ────────────────────────────────────────────────────── */

.indicator-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.indicator-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.7rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.indicator-card:hover {
    border-color: var(--border-focus);
}

.indicator-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.indicator-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.indicator-icon {
    margin-right: 0.15rem;
}

.indicator-value {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.indicator-trend {
    font-size: 0.65rem;
    font-weight: 700;
    margin-left: 0.2rem;
}

.indicator-trend--rising { color: var(--success); }
.indicator-trend--falling { color: var(--danger); }

.indicator-gauge {
    display: block;
    width: 100%;
    height: 22px;
    margin: 0.3rem 0 0;
}

.indicator-chart {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0.15rem 0 0.25rem;
}

.indicator-comment {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.indicator-trend-label {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.05rem 0.35rem;
    border-radius: 99px;
    margin-left: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.indicator-trend-label--rising {
    color: var(--success);
    background: rgba(52, 211, 153, 0.12);
}

.indicator-trend-label--falling {
    color: var(--danger);
    background: rgba(251, 113, 133, 0.12);
}

/* ─── Responsive: Economy ────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .seed-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .news-archive-item {
        flex-wrap: wrap;
    }

    .seed-timeline-label {
        width: 90px;
    }

    .indicator-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Utility ────────────────────────────────────────────────────────────── */

.text-dim, .text-secondary { color: var(--text-secondary); }
.text-amber, .text-warning { color: var(--secondary); }
.text-red, .text-danger { color: var(--danger); }
.text-cyan { color: var(--cyan); }
.text-success { color: var(--success); }
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 1rem; }
.hidden { display: none !important; }

/* ─── Rules Page ─────────────────────────────────────────────────────────── */

.rules-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.6em;
}

.rules-page h2.panel-title {
    font-size: 1.15rem;
}

/* Table of Contents — numbered list */
.rules-toc-list {
    list-style: none;
    counter-reset: toc;
    padding: 0;
    columns: 2;
    column-gap: 2rem;
}

.rules-toc-list li {
    counter-increment: toc;
    padding: 0.4rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    break-inside: avoid;
    border-bottom: 1px solid rgba(61, 52, 96, 0.3);
}

.rules-toc-list li::before {
    content: counter(toc) ".";
    color: var(--primary);
    font-weight: 700;
    margin-right: 0.5rem;
    font-family: var(--font-display);
}

.rules-toc-list li a {
    font-weight: 700;
    color: var(--text);
}

.rules-toc-list li a:hover {
    color: var(--primary);
}

/* Unordered lists inside rules panels */
.rules-list {
    list-style: none;
    padding: 0;
    margin-top: 0.5rem;
}

.rules-list li {
    position: relative;
    padding: 0.35rem 0 0.35rem 1.3rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.rules-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.75rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

/* Ordered steps list */
.rules-numbered-steps {
    list-style: none;
    counter-reset: steps;
    padding: 0;
}

.rules-numbered-steps li {
    counter-increment: steps;
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 0.85rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.rules-numbered-steps li::before {
    content: counter(steps);
    min-width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gradient-btn);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.rules-numbered-steps li strong {
    color: var(--text);
}

/* Inline hint badges (used in track table and events table) */
.rules-hint {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
    white-space: nowrap;
}

.rules-hint.up {
    background: rgba(52, 211, 153, 0.12);
    color: var(--success);
}

.rules-hint.up::before {
    content: "\25B2 ";
    font-size: 0.6rem;
}

.rules-hint.down {
    background: rgba(251, 113, 133, 0.12);
    color: var(--danger);
}

.rules-hint.down::before {
    content: "\25BC ";
    font-size: 0.6rem;
}

/* Callout */
.rules-callout {
    padding: 0.85rem 1rem;
    border-left: 3px solid var(--secondary);
    background: rgba(251, 191, 36, 0.06);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Board Locations — image + text cards */
.rules-locations-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.rules-location-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.rules-location-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-focus);
}

.rules-location-img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.rules-location-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.15rem;
}

.rules-location-actions {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}

.rules-location-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Pace badges (reused in table rows) */
.rules-pace-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 2px solid;
}

/* Definition list (matchmaking, etc.) */
.rules-dl {
    margin: 0;
    padding: 0;
}

.rules-dl dt {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    padding-top: 0.85rem;
    margin-top: 0.85rem;
    border-top: 1px solid var(--border);
}

.rules-dl dt:first-child {
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}

.rules-dl dd {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* Rules page responsive */
@media (max-width: 768px) {
    .rules-toc-list {
        columns: 1;
    }

    .rules-locations-grid {
        grid-template-columns: 1fr;
    }

    .rules-location-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .rules-location-img {
        width: 100px;
        height: 100px;
    }

    .rules-location-actions {
        justify-content: center;
    }
}

/* ─── Inventory Grid ────────────────────────────────────────────────────── */
.inventory-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.inventory-item { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; padding: 0.3rem 0.6rem; font-size: 0.75rem; display: flex; align-items: center; gap: 0.3rem; }
.inventory-name { color: var(--text); }
.inventory-count { color: var(--cyan); font-weight: 700; }

/* ─── Action Sections ───────────────────────────────────────────────────── */
.action-section-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); margin-bottom: 0.3rem; padding-left: 0.25rem; }
.action-item--dimmed { opacity: 0.4; pointer-events: none; }

/* ─── Action Log ────────────────────────────────────────────────────────── */
.action-log { display: flex; flex-direction: column; gap: 0.3rem; }
.log-entry { display: flex; align-items: baseline; gap: 0.4rem; font-size: 0.8rem; padding: 0.3rem 0.5rem; border-radius: 6px; background: var(--bg-elevated); }
.log-entry.log-success { border-left: 3px solid var(--success); }
.log-entry.log-fail { border-left: 3px solid var(--danger); }
.log-entry.event { border-left: 3px solid var(--secondary); }
.log-index { color: var(--text-tertiary); font-weight: 700; min-width: 1.5em; }
.log-message { flex: 1; color: var(--text); }
.log-cost { color: var(--text-secondary); font-size: 0.7rem; flex-shrink: 0; }

/* ─── Browse Panel ──────────────────────────────────────────────────────── */
.browse-panel { border: 1px solid var(--cyan); border-radius: 16px; }
.browse-section { margin-bottom: 0.75rem; font-size: 0.85rem; }
.browse-section ul { margin: 0.25rem 0 0 1.2rem; padding: 0; }
.browse-section li { margin-bottom: 0.2rem; color: var(--text-secondary); }
.browse-section strong { color: var(--primary-light); }

/* ─── Bot Picker ────────────────────────────────────────────────────────── */

.bot-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}

.bot-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-elevated, #241E3E);
    border: 2px solid var(--border, #3D3460);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    color: var(--text, #F1E8FF);
    font-family: inherit;
    font-size: 0.85rem;
}

.bot-card:hover {
    border-color: var(--bot-color, var(--primary, #F471B5));
    background: var(--bg-hover, #2F2750);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.bot-card:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.bot-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--bot-color, var(--border, #3D3460));
    background: var(--bg-surface, #1A1530);
}

.bot-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bot-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.bot-card-info strong {
    color: var(--bot-color, var(--text, #F1E8FF));
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.bot-card-style {
    color: var(--text-secondary, #B0A4CC);
    font-size: 0.75rem;
    text-transform: capitalize;
}

/* ─── Waiting Room Player Cards ─────────────────────────────────────────── */

.waiting-players {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.waiting-player-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-elevated, #241E3E);
    border: 2px solid var(--border, #3D3460);
    border-radius: 12px;
    position: relative;
}

.waiting-player-card--me {
    border-color: var(--cyan, #22D3EE);
    background: rgba(34, 211, 238, 0.08);
}

.waiting-player-card--bot {
    border-style: dashed;
    border-color: var(--bot-color, var(--border, #3D3460));
}

.waiting-player-card--empty {
    opacity: 0.3;
    border-style: dashed;
}

.waiting-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-surface, #1A1530);
    border: 2px solid var(--border, #3D3460);
}

.waiting-avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-secondary, #B0A4CC);
    font-size: 1rem;
}

.waiting-player-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
}

.waiting-player-info strong {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.waiting-player-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: var(--bg-hover, #2F2750);
    color: var(--text-secondary, #B0A4CC);
    width: fit-content;
}

.waiting-player-badge--you {
    background: rgba(34, 211, 238, 0.15);
    color: var(--cyan, #22D3EE);
}

.remove-player-btn {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    padding: 0.15rem 0.4rem !important;
    font-size: 0.75rem !important;
    line-height: 1;
    min-width: 0;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.waiting-player-card:hover .remove-player-btn {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORUM STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

.forum-container {
    max-width: 1000px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.forum-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.forum-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.forum-breadcrumb {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}
.forum-breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}
.forum-breadcrumb a:hover {
    text-decoration: underline;
}

/* ─── Board Cards ─────────────────────────────────────────────────── */

.forum-group {
    margin-bottom: 1.5rem;
}

.forum-group-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.forum-board-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 0.5rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
}
.forum-board-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-focus);
    transform: translateY(-1px);
}

.forum-board-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 2.5rem;
    text-align: center;
}

.forum-board-info {
    flex: 1;
    min-width: 0;
}

.forum-board-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
}

.forum-board-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.forum-board-meta {
    flex-shrink: 0;
    text-align: right;
    font-size: 0.8rem;
}

.forum-board-stat {
    color: var(--text-secondary);
    font-weight: 600;
}

/* ─── Thread Rows ─────────────────────────────────────────────────── */

.forum-thread-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.4rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s ease;
}
.forum-thread-row:hover {
    background: var(--bg-hover);
    border-color: var(--border-focus);
}

.forum-thread-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.forum-thread-avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    vertical-align: middle;
}

.forum-thread-info {
    flex: 1;
    min-width: 0;
}

.forum-thread-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.forum-thread-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.forum-thread-stats {
    flex-shrink: 0;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.forum-thread-replies {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.forum-dot {
    color: var(--text-tertiary);
}

.forum-pin, .forum-lock {
    font-size: 0.85rem;
}

/* ─── Badges ──────────────────────────────────────────────────────── */

.forum-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    vertical-align: middle;
}

.forum-badge-bot {
    background: var(--cyan);
    color: #000;
}

.forum-badge-op {
    background: var(--purple);
    color: #fff;
}

.forum-badge-implemented {
    background: var(--success);
    color: #000;
}

.forum-badge-rejected {
    background: var(--danger);
    color: #fff;
}

.forum-badge-locked {
    background: var(--text-tertiary);
    color: var(--bg);
}

/* ─── Vote Controls ───────────────────────────────────────────────── */

.forum-vote-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    min-width: 2.5rem;
}

.forum-vote-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.2rem;
    border-radius: 4px;
    transition: all 0.15s;
    line-height: 1;
}
.forum-vote-btn:hover {
    color: var(--primary);
    background: var(--bg-elevated);
}
.forum-vote-btn.forum-vote-active.forum-vote-up {
    color: var(--success);
}
.forum-vote-btn.forum-vote-active.forum-vote-down {
    color: var(--danger);
}

.forum-vote-count {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
}

.forum-vote-score {
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    background: var(--bg-elevated);
}
.forum-vote-positive { color: var(--success); }
.forum-vote-negative { color: var(--danger); }

/* ─── Thread Detail ───────────────────────────────────────────────── */

.forum-thread-header {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.forum-thread-detail-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.forum-resolution {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.forum-admin-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* ─── Posts ────────────────────────────────────────────────────────── */

.forum-post {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.5rem;
}
.forum-post-op {
    border-left: 3px solid var(--primary);
}

.forum-post-sidebar {
    flex-shrink: 0;
}

.forum-post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.forum-post-content {
    flex: 1;
    min-width: 0;
}

.forum-post-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.forum-post-author {
    font-weight: 600;
    color: var(--text);
}

.forum-post-body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
    word-wrap: break-word;
}
.forum-post-body code {
    background: var(--bg-elevated);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.85em;
}
.forum-post-body a {
    color: var(--primary);
}
.forum-post-body h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0.75rem 0 0.25rem;
    color: var(--text);
    background: linear-gradient(135deg, var(--primary), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.forum-post-body h3:first-child {
    margin-top: 0;
}
.forum-post-body h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0.75rem 0 0.25rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.forum-post-body ul {
    margin: 0.25rem 0 0.5rem;
    padding-left: 0;
    list-style: none;
}
.forum-post-body ul li {
    position: relative;
    padding: 0.3rem 0 0.3rem 1.25rem;
    border-left: 2px solid var(--border);
    margin-bottom: 0.15rem;
    transition: border-color 0.2s;
}
.forum-post-body ul li:hover {
    border-left-color: var(--primary);
}
.forum-post-body ul li::before {
    content: '';
}
.forum-post-body p {
    margin: 0.2rem 0;
}
.forum-post-body strong {
    color: var(--text);
}

/* ─── Reply Panel ─────────────────────────────────────────────────── */

.forum-reply-panel {
    margin-top: 1rem;
}

/* ─── Loading ─────────────────────────────────────────────────────── */

.loading-pulse {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ─── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .forum-board-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .forum-board-meta {
        text-align: left;
        display: flex;
        gap: 0.75rem;
    }
    .forum-thread-stats {
        flex-direction: column;
        gap: 0.25rem;
    }
    .forum-thread-detail-title {
        font-size: 1.15rem;
    }
}

/* ─── Post Edit/Delete Actions ────────────────────────────────────── */

.forum-post-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.forum-post-action-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-family: var(--font-body);
    transition: color 0.15s;
}
.forum-post-action-btn:hover {
    color: var(--primary);
    background: var(--bg-elevated);
}
.forum-post-action-delete:hover {
    color: var(--danger);
}

.forum-edit-textarea {
    width: 100%;
    min-height: 80px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-focus);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 0.75rem;
    resize: vertical;
    margin-bottom: 0.5rem;
}
.forum-edit-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.forum-edit-actions {
    display: flex;
    gap: 0.4rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORUM EDITOR & RICH CONTENT
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Editor Toolbar ──────────────────────────────────────────────── */

.fe-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    padding: 0.4rem 0.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    align-items: center;
}

.fe-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: var(--font-body);
    transition: all 0.15s;
    white-space: nowrap;
}
.fe-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
    border-color: var(--border);
}
.fe-btn b, .fe-btn i, .fe-btn u, .fe-btn s {
    pointer-events: none;
}

.fe-sep {
    width: 1px;
    height: 1.2rem;
    background: var(--border);
    margin: 0 0.15rem;
}

.fe-color-picker {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 0.2rem 0.3rem;
    font-size: 0.75rem;
    font-family: var(--font-body);
    cursor: pointer;
}
.fe-color-picker:focus {
    border-color: var(--border-focus);
    outline: none;
}

/* ─── Editor Area ─────────────────────────────────────────────────── */

.fe-editor {
    min-height: 120px;
    max-height: 500px;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 0 0 10px 10px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    outline: none;
}
.fe-editor:focus {
    border-color: var(--border-focus);
}
.fe-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--text-tertiary);
    pointer-events: none;
}
.fe-editor img {
    max-width: 100%;
    border-radius: 8px;
    margin: 0.5rem 0;
}
.fe-editor a {
    color: var(--primary);
}
.fe-editor blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 0.75rem;
    margin: 0.5rem 0;
    color: var(--text-secondary);
}
.fe-editor pre, .fe-editor code {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}
.fe-editor code {
    background: var(--bg-elevated);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
}
.fe-editor pre {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    margin: 0.5rem 0;
}
.fe-editor pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

/* ─── Code Block in rendered posts ────────────────────────────────── */

.fe-code-block, .forum-post-body pre {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    margin: 0.5rem 0;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}
.fe-code-block code, .forum-post-body pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

/* ─── Link Previews ───────────────────────────────────────────────── */

.forum-link-preview {
    display: block;
    margin: 0.5rem 0;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s;
}
.forum-link-preview:hover {
    border-color: var(--border-focus);
}
.forum-link-preview a {
    display: block;
    padding: 0.6rem 0.85rem;
    text-decoration: none;
    color: var(--text);
}
.forum-link-domain {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.15rem;
}
.forum-link-url {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Rendered Post Images ────────────────────────────────────────── */

.forum-post-body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 0.5rem 0;
    display: block;
}

.forum-post-body blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 0.75rem;
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

/* ─── Attachment Upload UI ────────────────────────────────────────── */

.fe-attachment {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
}

.fe-attachment-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}

.fe-attachment-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.fe-attachment-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}

.fe-attachment-size {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.fe-attachment-remove {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 0.3rem;
    border-radius: 4px;
    transition: color 0.15s;
}
.fe-attachment-remove:hover {
    color: var(--danger);
}

/* ─── Rendered Attachments in Posts ────────────────────────────────── */

.forum-attachments {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.forum-attachment-img {
    max-width: 300px;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: transform 0.15s;
}
.forum-attachment-img:hover {
    transform: scale(1.02);
}

.forum-attachment-file {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    transition: border-color 0.15s;
}
.forum-attachment-file:hover {
    border-color: var(--primary);
}

/* ─── Editor Responsive ───────────────────────────────────────────── */

@media (max-width: 640px) {
    .fe-toolbar {
        gap: 0.1rem;
        padding: 0.3rem;
    }
    .fe-btn {
        padding: 0.2rem 0.35rem;
        font-size: 0.7rem;
    }
    .fe-editor {
        min-height: 100px;
    }
}

/* ─── Styled Prompt Input ─────────────────────────────────────────── */

.prompt-input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-focus);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 0.6rem 0.75rem;
    margin: 0.75rem 0;
    outline: none;
    resize: vertical;
}
.prompt-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}
textarea.prompt-input {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.85rem;
    min-height: 80px;
}

/* ─── Profile Badges ─────────────────────────────────────────────────────── */

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.profile-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--badge-color, var(--border));
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 12px color-mix(in srgb, var(--badge-color, var(--primary)) 30%, transparent);
}

.profile-badge-icon {
    font-size: 1rem;
    line-height: 1;
}

.profile-badge-name {
    font-weight: 600;
    color: var(--badge-color, var(--text));
    font-size: 0.75rem;
}

.profile-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--badge-color, var(--border));
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--badge-color, var(--text));
    white-space: nowrap;
}

/* ─── Profile Links ──────────────────────────────────────────────────────── */

.profile-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.profile-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-light);
    transition: border-color 0.2s, background 0.2s;
}

.profile-link:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
    color: var(--primary);
}

/* ─── Profile Modal ──────────────────────────────────────────────────────── */

.profile-modal {
    max-width: 440px;
    position: relative;
}

.profile-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    transition: color 0.2s;
}

.profile-modal-close:hover {
    color: var(--text);
}

.profile-modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.profile-modal-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    background: var(--bg-elevated);
    flex-shrink: 0;
}

.profile-modal-info {
    min-width: 0;
}

.profile-modal-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.profile-modal-bio {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    max-height: 4.5em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-modal-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.profile-modal-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.profile-modal-stat {
    text-align: center;
}

.profile-modal-stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-modal-stat-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-tertiary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-modal-bots {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.profile-modal-bot {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-light);
    margin-right: 0.4rem;
    margin-bottom: 0.3rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.profile-modal-bot:hover {
    border-color: var(--primary);
}

/* ─── Forum Clickable Authors ────────────────────────────────────────────── */

.forum-clickable-author {
    cursor: pointer;
    transition: color 0.15s;
}

.forum-post-avatar.forum-clickable-author:hover {
    box-shadow: 0 0 0 2px var(--primary-glow);
}

span.forum-clickable-author:hover,
.forum-post-author.forum-clickable-author:hover {
    color: var(--primary-light);
}

/* ─── Profile Bots Grid (player profile page) ───────────────────────────── */

.profile-bots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
}

.profile-bot-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color 0.2s, transform 0.2s;
}

.profile-bot-card:hover {
    border-color: var(--border-focus);
    transform: translateY(-1px);
}

.profile-bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

/* ─── Create Game: Sliders & Win Conditions ────────────────────────────────── */

.create-game-panel .form-group { margin-bottom: 1.25rem; }

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #241E3E;
    outline: none;
    margin: 0.5rem 0;
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F471B5, #C084FC);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(244,113,181,0.4);
    transition: transform 0.15s;
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F471B5, #C084FC);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(244,113,181,0.4);
}

.slider-value {
    float: right;
    font-weight: 700;
    color: #22D3EE;
    font-size: 0.95rem;
}

.pace-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 8px;
    border-radius: 6px;
    margin-left: 8px;
    background: #241E3E;
    color: #B0A4CC;
    vertical-align: middle;
}
.pace-badge--blitz { background: rgba(251,113,133,0.2); color: #FB7185; }
.pace-badge--standard { background: rgba(251,191,36,0.2); color: #FBBF24; }
.pace-badge--marathon { background: rgba(34,211,238,0.2); color: #22D3EE; }

.form-help {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: #7A6FA0;
    line-height: 1.4;
}

/* Win conditions */
.win-conditions { display: flex; flex-direction: column; gap: 0.75rem; }

.win-condition {
    background: #1A1530;
    border: 1px solid #3D3460;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s;
}
.win-condition:has(input:checked) {
    border-color: #5B4F8A;
}

.win-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    color: #F1E8FF;
    font-size: 0.95rem;
}
.win-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #F471B5;
}
.win-check i {
    font-size: 1.1rem;
}

.win-slider-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding-left: 2rem;
}
.win-slider-wrap .slider { flex: 1; }
.win-slider-wrap .slider-value {
    float: none;
    min-width: 50px;
    text-align: right;
    font-size: 0.9rem;
}

.icon-credits { color: #FBBF24; }
.icon-skills { color: #A78BFA; }
.icon-rep { color: #F471B5; }
.icon-health { color: #34D399; }

/* Toggle switch */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}
.toggle-switch {
    display: inline-flex;
    cursor: pointer;
}
.toggle-track {
    display: block;
    width: 44px;
    height: 24px;
    background: #241E3E;
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
    border: 1px solid #3D3460;
}
.toggle-thumb {
    display: block;
    width: 18px;
    height: 18px;
    background: #7A6FA0;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s, background 0.2s;
}
.toggle-switch.active .toggle-track {
    background: rgba(244,113,181,0.2);
    border-color: #F471B5;
}
.toggle-switch.active .toggle-thumb {
    transform: translateX(20px);
    background: #F471B5;
}

/* ─── HUD Notification Bell ───────────────────────────────────────────────── */

/* hud-notify-btn styles moved to game-hud.css as .hud-tool-btn */

/* ─── Victory Screen ──────────────────────────────────────────────────────── */

.victory-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15,11,30,0.92);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.4s ease;
    padding: 2rem 1rem;
}
.victory-overlay--visible { opacity: 1; }

.victory-screen {
    position: relative;
    max-width: 600px;
    width: 100%;
    padding-bottom: 2rem;
}

.victory-close {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(26,21,48,0.8);
    border: 1px solid #3D3460;
    color: #B0A4CC;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.victory-close:hover { background: #241E3E; color: #F1E8FF; border-color: #5B4F8A; }

/* Confetti */
.victory-confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 10002;
}
.confetti-piece {
    position: absolute;
    top: -20px;
    border-radius: 2px;
    animation: confettiFall linear forwards;
    opacity: 0.85;
}
@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 0.9; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Hero */
.victory-hero {
    text-align: center;
    margin-bottom: 2rem;
    padding-top: 1rem;
}
.victory-trophy {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: trophyPulse 2s ease-in-out infinite;
}
.victory-trophy i { color: #FBBF24; filter: drop-shadow(0 0 20px rgba(251,191,36,0.5)); }
@keyframes trophyPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
.victory-title {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #F471B5, #A78BFA, #22D3EE);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 0.5rem;
    line-height: 1.2;
}
.victory-subtitle {
    color: #B0A4CC;
    font-size: 1.05rem;
    margin: 0;
}

/* Diploma */
.victory-diploma {
    margin: 0 auto 2rem;
    max-width: 460px;
}
.victory-diploma-border {
    background: linear-gradient(135deg, #F471B5, #A78BFA, #22D3EE);
    padding: 3px;
    border-radius: 16px;
}
.victory-diploma-inner {
    background: #1A1530;
    border-radius: 14px;
    padding: 2rem;
    text-align: center;
}
.victory-diploma-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #A78BFA;
    margin: 0 0 0.75rem;
}
.victory-diploma-name {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #F1E8FF;
    margin: 0 0 0.25rem;
}
.victory-diploma-sub {
    color: #7A6FA0;
    font-size: 0.85rem;
    margin: 0 0 0.25rem;
}
.victory-diploma-game {
    color: #F471B5;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0 0 0.25rem;
}
.victory-diploma-detail {
    color: #7A6FA0;
    font-size: 0.85rem;
    margin: 0 0 0.75rem;
}
.victory-diploma-ach {
    color: #22D3EE;
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
}
.victory-diploma-ach i { margin-right: 0.3em; }

/* Rankings */
.victory-section { margin-bottom: 2rem; }
.victory-section h3 {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: 1.1rem;
    color: #F1E8FF;
    margin: 0 0 0.75rem;
}
.victory-rankings { display: flex; flex-direction: column; gap: 0.5rem; }

.victory-rank {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #1A1530;
    border: 1px solid #3D3460;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s;
}
.victory-rank--winner { border-color: #FBBF24; background: rgba(251,191,36,0.05); }
.victory-rank--me { border-left: 3px solid #22D3EE; }
.victory-rank-medal { font-size: 1.4rem; min-width: 32px; text-align: center; }
.rank-num { color: #7A6FA0; font-weight: 700; font-size: 0.9rem; }
.victory-rank-info { flex: 1; }
.victory-rank-info strong { color: #F1E8FF; font-size: 0.95rem; }
.victory-rank-stats {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #B0A4CC;
}
.victory-rank-stats i { margin-right: 0.2em; font-size: 0.75rem; }
.victory-rank-score {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #22D3EE;
}

/* Achievements */
.victory-achievements { display: flex; flex-direction: column; gap: 0.5rem; }
.victory-achievement {
    display: flex;
    gap: 0.75rem;
    background: #1A1530;
    border: 1px solid #3D3460;
    border-radius: 12px;
    padding: 0.75rem 1rem;
}
.victory-ach-icon {
    font-size: 1.5rem;
    min-width: 36px;
    text-align: center;
    color: #A78BFA;
    padding-top: 0.1rem;
}
.victory-ach-info { flex: 1; }
.victory-ach-info strong {
    color: #F1E8FF;
    font-size: 0.95rem;
    display: block;
}
.victory-ach-player {
    font-size: 0.8rem;
    color: #F471B5;
    display: block;
    margin-bottom: 0.25rem;
}
.victory-ach-info p {
    margin: 0;
    font-size: 0.85rem;
    color: #B0A4CC;
    line-height: 1.4;
}

.victory-footer {
    text-align: center;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .victory-title { font-size: 1.8rem; }
    .victory-diploma-name { font-size: 1.4rem; }
    .victory-rank-stats { flex-wrap: wrap; gap: 0.4rem; }
    .victory-overlay { padding: 1rem 0.5rem; }
}

/* ─── Game Card Chips ─────────────────────────────────────────────────────── */

.game-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.game-card-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #B0A4CC;
    background: #241E3E;
    border-radius: 6px;
    padding: 2px 8px;
    white-space: nowrap;
}
.game-card-chip i { font-size: 0.7rem; color: #7A6FA0; }
.game-card-chip--win { color: #FBBF24; }
.game-card-chip--win i { color: #FBBF24; }
.game-card-chip--code {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: #22D3EE;
    letter-spacing: 0.05em;
}
.game-card-deadline {
    margin-top: 6px;
    font-size: 0.75rem;
    color: #7A6FA0;
}
.game-card-deadline i { margin-right: 4px; }

/* ─── Language Selector ──────────────────────────────────────────── */
.lang-selector {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.lang-selector-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm, 8px);
    transition: color 0.2s, background 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.lang-selector-btn:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.lang-globe-icon {
    font-size: 1rem;
    color: var(--text-tertiary);
}

.lang-current {
    font-weight: 600;
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 12px);
    padding: 0.4rem;
    min-width: 160px;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.lang-dropdown--open {
    display: flex;
    flex-direction: column;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm, 8px);
    font-size: 0.85rem;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
    text-align: left;
    width: 100%;
}

.lang-option:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.lang-option--active {
    color: var(--primary);
    font-weight: 600;
    background: rgba(244, 113, 181, 0.08);
}

.lang-flag {
    font-size: 1.1rem;
    line-height: 1;
}

.lang-name {
    flex: 1;
}

/* Mobile: hide label, show only globe */
@media (max-width: 768px) {
    .lang-current {
        display: none;
    }
    .lang-selector-btn {
        padding: 0.35rem;
    }
    .lang-dropdown {
        right: -0.5rem;
    }
}

/* ─── Share / Copy Link Buttons ─── */

/* Lobby game card share button (icon only) */
.share-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.share-btn:hover {
    color: var(--primary);
    background: var(--bg-hover);
}

/* Game view waiting room share button (icon + text) */
.share-btn-text {
    font-size: 0.85rem;
    gap: 0.35rem;
}
.share-btn-text i {
    font-size: 0.8rem;
}

/* hud-share-btn styles moved to game-hud.css as .hud-tool-btn */


/* ─── Invite Panel ─────────────────────────────────────────────────────────── */

.invite-search-wrap {
    position: relative;
}

.invite-search {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    font-family: 'Nunito', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.invite-search:focus {
    border-color: var(--border-focus);
}

.invite-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 200px;
    overflow-y: auto;
}

.invite-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: background 0.15s;
}

.invite-result-item:hover {
    background: var(--bg-hover);
}

.invite-result-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.invite-result-avatar--placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.invite-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.invite-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: var(--bg-elevated);
    border-radius: 8px;
    font-size: 13px;
}

.invite-username {
    flex: 1;
    color: var(--text);
    font-weight: 600;
}

.invite-status {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.invite-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
