/* ── Full-page background ───────────────────────────────────────────── */
body {
    background: linear-gradient(rgba(248,250,252,0.88), rgba(248,250,252,0.88)),
                url(/bg.jpeg) center top / cover fixed;
}

/* ── Hero ──────────────────────────────────────────────────────────── */
.bg-hero {
    background: linear-gradient(135deg, rgba(15,23,42,0.55) 0%, rgba(30,58,30,0.55) 100%),
                url(/bg.jpeg) center / cover no-repeat;
    color: #f1f5f9;
    text-align: center;
    padding: 3rem 1rem 2.5rem;
}
.hero-title { font-size: 2.2rem; font-weight: 800; margin-bottom: 0.5rem; }
.hero-subtitle { font-size: 1.1rem; color: #a3e8a3; margin-bottom: 0; }

/* ── Currency badges ───────────────────────────────────────────────── */
.currency-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15em 0.5em;
    border-radius: 4px;
    vertical-align: middle;
}
.currency-badge.ban { background: #fb923c; color: #fff; }
.currency-badge.xno { background: #38bdf8; color: #0f172a; }

.prize-amount { font-weight: 700; color: #22c55e; font-size: 0.95rem; }

/* ── Clickable table rows ───────────────────────────────────────────── */
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: #f1f5f9; }

/* ── Players list ──────────────────────────────────────────────────── */
.players-list { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.player-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 2px solid #ccc;
    border-radius: 20px;
    padding: 2px 10px 2px 6px;
    font-size: 0.82rem;
    background: #fff;
}
.player-chip .dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.player-chip .muted { color: #94a3b8; font-size: 0.75rem; }

/* ── Player row (game panel) ───────────────────────────────────────── */
.player-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #f1f5f9;
}
.player-row .dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.player-row .player-name { flex: 1; font-weight: 500; }
.player-row .player-pos  { font-size: 0.82rem; color: #64748b; }

/* ── Board card header — three-column layout ───────────────────────── */
.header-col-left,
.header-col-center,
.header-col-right {
    flex: 1;
}
.header-col-center { text-align: center; }
.header-col-right  { text-align: right; white-space: nowrap; }

.balance-label  { font-size: 0.82rem; color: #94a3b8; }
.balance-amount { font-weight: 700; color: #38bdf8; font-size: 0.95rem; }

/* ── Kingdom board ─────────────────────────────────────────────────── */
.kingdom-board-wrap {
    overflow-x: auto;
}

.kingdom-board {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
}

/* ── Kingdom tiles ─────────────────────────────────────────────────── */
.k-tile {
    border: 1px solid #cbd5e1;
    position: relative;
    width: 10%;
    min-width: 44px;
    height: 60px;
    vertical-align: top;
    padding: 2px 3px;
    font-size: 0.6rem;
    background: #f8fafc;
    cursor: pointer;
}

.k-tile:hover {
    background: #e2e8f0;
    transition: background 0.15s;
}

.k-tile.selected {
    outline: 3px solid #f59e0b;
    outline-offset: -2px;
    z-index: 2;
}

.k-tile.neutral {
    background: #f8fafc;
}

/* Kingdom-owned tiles use inline style for the king's color */

.k-tile-num {
    display: block;
    font-size: 0.55rem;
    color: #94a3b8;
    line-height: 1;
}

.k-tile-troops {
    display: block;
    font-size: 0.58rem;
    font-weight: 600;
    color: #475569;
    line-height: 1;
    margin-top: 2px;
}

.k-tile-tokens {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 2px;
}

.k-token {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.25);
}

.k-crown {
    font-size: 0.7rem;
    line-height: 1;
}

/* ── Kingdom info panel ────────────────────────────────────────────── */
.kingdom-info-panel {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.kingdom-info-panel h5 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* ── Command form ──────────────────────────────────────────────────── */
.command-form {
    display: inline-block;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ── Troop row ─────────────────────────────────────────────────────── */
.troop-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

/* ── Stat row / items ──────────────────────────────────────────────── */
.stat-row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.stat-item {
    font-size: 0.85rem;
}

.stat-item strong {
    color: #1e293b;
}

.stat-label {
    font-size: 0.75rem;
    color: #94a3b8;
    display: block;
}

/* ── Kingdom legend ────────────────────────────────────────────────── */
.k-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.k-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
}

.k-legend-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid #cbd5e1;
}

/* ── Cooldown bar ──────────────────────────────────────────────────── */
.cooldown-bar {
    background: #e2e8f0;
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
    margin-top: 4px;
}

.cooldown-bar-fill {
    height: 100%;
    background: #22c55e;
    transition: width 0.5s;
}

/* ── Combat result panels ──────────────────────────────────────────── */
.combat-result {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.combat-result.victory {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.combat-result.defeat {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.combat-result.ongoing {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde047;
}

/* ── Gold / training amounts ───────────────────────────────────────── */
.gold-amount     { color: #d97706; font-weight: 700; }
.training-amount { color: #7c3aed; font-weight: 700; }

/* ── Stat / troop icons ────────────────────────────────────────────── */
.stat-icon {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
    margin-bottom: 1px;
}

.cmd-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 3px;
}

.troop-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 4px;
}

/* ── MonKey avatar on kingdom board tile ───────────────────────────── */
.k-token-avatar {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.7);
    object-fit: cover;
    flex-shrink: 0;
}

/* ── Adjacent / current tile highlights ────────────────────────────── */
.k-tile.my-tile {
    outline: 3px solid #22c55e;
    outline-offset: -2px;
}
.k-tile.adjacent-tile {
    outline: 2px dashed #94a3b8;
    outline-offset: -2px;
}
.k-tile.my-tile.selected,
.k-tile.adjacent-tile.selected {
    outline: 3px solid #f59e0b;
    outline-offset: -2px;
}

/* ── Player action strip ────────────────────────────────────────────── */
.player-action-strip {
    border-top: 1px solid #e2e8f0;
    padding: 0.75rem 0.5rem;
}

/* ── Command row ────────────────────────────────────────────────────── */
.command-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* ── gap-2 utility (Bootstrap 4 doesn't include gap) ───────────────── */
.gap-2 { gap: 0.5rem !important; }
