/* ── Reset & Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    background: #060e06;
    color: #7fff7f;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

.lf-root { min-height: 100vh; }

/* ── Auth Page ──────────────────────────────────────────────────────── */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 1rem;
}

.logo-moon { font-size: 52px; display: block; margin-bottom: 8px; }

.auth-logo h1 {
    font-size: 22px;
    font-weight: 700;
    color: #aaffaa;
    letter-spacing: 4px;
}

.logo-sub {
    font-size: 10px;
    color: #3a7a3a;
    letter-spacing: 2px;
    margin-top: 4px;
}

/* ── Tabs ───────────────────────────────────────────────────────────── */
.tab-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 4px;
}

.tab-btn {
    background: transparent;
    border: 1px solid #1a3a1a;
    color: #3a7a3a;
    padding: 8px 4px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 1px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.tab-btn:hover { background: #0d1e0d; border-color: #2a5a2a; color: #6adf6a; }

.tab-active {
    background: #0d2a0d !important;
    border-color: #2a6a2a !important;
    color: #7fff7f !important;
}

/* ── Form Fields ────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 4px; }

.field-label {
    font-size: 10px;
    color: #3a7a3a;
    letter-spacing: 1px;
}

.field-input {
    background: #0d1e0d;
    border: 1px solid #1a4a1a;
    border-radius: 6px;
    color: #aaffaa;
    font-family: inherit;
    font-size: 14px;
    padding: 10px 12px;
    outline: none;
    transition: border-color 0.15s;
}

.field-input::placeholder { color: #2a4a2a; }
.field-input:focus { border-color: #2a7a2a; }

.form-error {
    color: #ff5555;
    font-size: 12px;
    text-align: center;
    padding: 4px 0;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.action-btn {
    width: 100%;
    background: transparent;
    border: 1px solid #1a5a1a;
    border-radius: 8px;
    color: #7fff7f;
    font-family: inherit;
    font-size: 14px;
    letter-spacing: 1px;
    padding: 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-align: center;
}

.action-btn:hover:not(:disabled) { background: #0d2a0d; border-color: #2a6a2a; }
.action-btn:active:not(:disabled) { transform: scale(0.98); }
.action-btn:disabled { color: #2a4a2a; border-color: #0f1f0f; cursor: not-allowed; }

.small-btn {
    background: transparent;
    border: 1px solid #1a5a1a;
    border-radius: 6px;
    color: #7fff7f;
    font-family: inherit;
    font-size: 12px;
    padding: 8px 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
}

.small-btn:hover { background: #0d2a0d; }

.raid-btn {
    background: #0d1a0d;
    border: 1px solid #3a1a1a;
    border-radius: 6px;
    color: #ff6644;
    font-family: inherit;
    font-size: 12px;
    padding: 8px 14px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s;
}

.raid-btn:hover { background: #1a0d0d; border-color: #6a2a2a; }

/* ── Game Layout ────────────────────────────────────────────────────── */
.game-wrap {
    max-width: 740px;
    margin: 0 auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 100vh;
    position: relative;
}

/* ── Game Header ────────────────────────────────────────────────────── */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #050c05;
    border: 1px solid #1a3a1a;
    border-radius: 8px;
}

.header-name { font-size: 14px; font-weight: 700; color: #aaffaa; letter-spacing: 2px; }
.header-sub  { font-size: 11px; color: #3a7a3a; letter-spacing: 1px; margin-top: 2px; }

.header-btns { display: flex; gap: 8px; align-items: center; }

.hdr-btn {
    background: transparent;
    border: 1px solid #1a5a1a;
    border-radius: 6px;
    color: #aaffaa;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 1px;
    padding: 7px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.hdr-btn:hover { background: #0d2a0d; }

.hdr-btn-danger { border-color: #3a1a1a; color: #884444; padding: 7px 12px; }
.hdr-btn-danger:hover { background: #1a0a0a; border-color: #6a2a2a; }

/* ── Resource Bar ───────────────────────────────────────────────────── */
.res-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 10px 14px;
    background: #050c05;
    border: 1px solid #1a3a1a;
    border-radius: 8px;
}

.res-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.res-label { font-size: 10px; color: #3a7a3a; letter-spacing: 1px; }
.res-val   { font-size: 18px; font-weight: 700; color: #aaffaa; }

/* ── Tab Content ────────────────────────────────────────────────────── */
.tab-content {
    background: #050c05;
    border: 1px solid #1a3a1a;
    border-radius: 8px;
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-label {
    font-size: 10px;
    color: #3a7a3a;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

/* ── Build Cards ────────────────────────────────────────────────────── */
.build-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #0d1e0d;
    border: 1px solid #1a4a1a;
    border-radius: 8px;
}

.build-info { display: flex; flex-direction: column; gap: 2px; }
.build-name { font-size: 14px; color: #7fff7f; }
.build-stats { font-size: 11px; color: #3a7a3a; }

/* ── Fleet Bar ──────────────────────────────────────────────────────── */
.fleet-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 10px 14px;
    background: #0d1e0d;
    border: 1px solid #1a3a1a;
    border-radius: 8px;
}

.fleet-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }

/* ── Base Cards ─────────────────────────────────────────────────────── */
.base-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #0d1e0d;
    border: 1px solid #1a4a1a;
    border-radius: 8px;
}

.base-dead { border-color: #0f1f0f; opacity: 0.45; }

.base-info { display: flex; flex-direction: column; gap: 2px; }
.base-name { font-size: 13px; color: #7fff7f; font-weight: 600; }
.base-lore { font-size: 10px; color: #3a6a3a; }
.base-stats { font-size: 11px; color: #3a7a3a; margin-top: 2px; }
.dead-tag  { color: #3a5a3a; margin-left: 6px; font-size: 11px; }

/* ── Log Panel ──────────────────────────────────────────────────────── */
.log-panel {
    max-height: 340px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.log-line { font-size: 12px; line-height: 1.6; }
.log-info    { color: #4a8a4a; }
.log-success { color: #7fff7f; }
.log-warning { color: #ffcc44; }
.log-danger  { color: #ff5555; }
.log-system  { color: #3a7a3a; }

/* ── Footer Stats ───────────────────────────────────────────────────── */
.footer-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 10px 14px;
    background: #050c05;
    border: 1px solid #1a3a1a;
    border-radius: 8px;
}

.footer-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }

/* ── Victory Overlay ────────────────────────────────────────────────── */
.victory-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.victory-card {
    background: #0d1e0d;
    border: 1px solid #2a6a2a;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 360px;
    width: 90%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.victory-icon  { font-size: 52px; }
.victory-title { font-size: 24px; font-weight: 700; color: #aaffaa; letter-spacing: 4px; }
.victory-msg   { font-size: 13px; color: #3a7a3a; }

/* ── Scrollbar ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #060e06; }
::-webkit-scrollbar-thumb { background: #1a4a1a; border-radius: 3px; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .res-val  { font-size: 15px; }
    .res-label { font-size: 9px; }
    .auth-logo h1 { font-size: 18px; letter-spacing: 2px; }
    .game-wrap { padding: 8px; }
}

/* ── Map ────────────────────────────────────────────────────────────── */
.map-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.moon-map {
    width: 100%;
    height: auto;
    border: 1px solid #1a3a1a;
    border-radius: 6px;
    display: block;
    background: #060e06;
}

.map-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 10px;
    color: #3a7a3a;
    letter-spacing: 1px;
}

.legend-item { display: flex; align-items: center; gap: 4px; }

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* ── Raid panel (shown on base click) ───────────────────────────────── */
.raid-panel {
    background: #0d1a0d;
    border: 1px solid #3a1a1a;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.raid-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #ff6644;
    font-weight: 600;
}

.raid-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 11px;
    color: #5a5a3a;
}

.raid-fleet {
    font-size: 11px;
    color: #3a7a3a;
    padding: 6px 0;
    border-top: 1px solid #1a2a1a;
}

.raid-launch-btn {
    border-color: #5a1a1a;
    color: #ff6644;
}
.raid-launch-btn:hover:not(:disabled) { background: #1a0d0d; border-color: #8a2a2a; }

.icon-btn {
    background: transparent;
    border: none;
    color: #5a5a5a;
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
}

/* ── Missions ───────────────────────────────────────────────────────── */
.mission-badge {
    background: #ff4422;
    color: #fff;
    border-radius: 10px;
    font-size: 10px;
    padding: 1px 5px;
    margin-left: 4px;
    vertical-align: middle;
}

.mission-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mission-card {
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid;
}

.mission-out {
    background: #0d1a0d;
    border-color: #1a4a1a;
}

.mission-in {
    background: #1a0d0d;
    border-color: #4a1a1a;
}

.mission-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.mission-icon { font-size: 14px; }

.mission-title {
    flex: 1;
    color: #aaffaa;
    font-weight: 500;
}

.mission-phase {
    font-size: 10px;
    letter-spacing: 1px;
    padding: 2px 6px;
    border-radius: 4px;
}

.phase-travel { background: #0d2a0d; color: #5a9a5a; }
.phase-raid   { background: #2a1a0d; color: #cc7744; }
.phase-return { background: #0d1a2a; color: #4488cc; }

.mission-body {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 11px;
    color: #3a7a3a;
}

.mission-eta {
    color: #aaffaa;
    font-weight: 500;
    margin-left: auto;
}

.raiding-pulse { color: #ff6644; animation: pulse 1s ease-in-out infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.mission-loot {
    font-size: 11px;
    color: #4a8a4a;
    padding-top: 4px;
    border-top: 1px solid #1a3a1a;
}

.no-missions {
    font-size: 12px;
    color: #2a4a2a;
    padding: 8px 0;
    text-align: center;
}

/* ── Notification badge ─────────────────────────────────────────────── */
.notif-badge {
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 6px;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    animation: fadeIn 0.3s ease;
}

.notif-success { background: #0d2a0d; color: #7fff7f; border: 1px solid #1a5a1a; }
.notif-danger  { background: #2a0d0d; color: #ff5555; border: 1px solid #5a1a1a; }

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

.muted-hint {
    font-size: 11px;
    color: #2a4a2a;
    line-height: 1.6;
    padding: 4px 0 8px;
}
