/* ============================================
    양호후환 전투 시스템 - 기본 스타일
    ============================================ */

/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --team-hero: #2563eb;
    --team-gov: #16a34a;
    --team-villain: #dc2626;

    --team-hero-soft: #dbeafe;
    --team-gov-soft: #dcfce7;
    --team-villain-soft: #fee2e2;

    /* 헤더 상단 티커 높이(고정) */
    --ticker-height: 26px;
    /* 헤더 상단 티커 속도(초) */
    --ticker-duration: 26s;
    /* 전투 화면 sticky 요소가 헤더/티커 아래로 내려가도록 보정 */
    --combat-sticky-top: calc(var(--ticker-height) + 74px);
}

body {
    font-family: 'Noto Sans KR', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    background:
        radial-gradient(520px 520px at 78% 16%, rgba(255, 78, 78, 0.38) 0%, rgba(255, 78, 78, 0.22) 18%, rgba(255, 78, 78, 0.00) 45%),
        radial-gradient(900px 560px at 55% -10%, rgba(180, 16, 16, 0.18) 0%, rgba(180, 16, 16, 0.00) 60%),
        radial-gradient(900px 720px at 18% 88%, rgba(88, 28, 28, 0.22) 0%, rgba(88, 28, 28, 0.00) 58%),
        linear-gradient(135deg, #0b1020 0%, #2a0a10 45%, #0b1020 100%);
    background-attachment: fixed;
    color: #2c3e50;
    min-height: 100vh;
    font-weight: 600;
    line-height: 1.4;
}

/* 컨테이너 */
.container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 12px 18px 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 헤더 상단 뉴스 티커 */
.header-ticker {
    position: sticky;
    top: 0;
    z-index: 11;
    height: var(--ticker-height);
    margin-bottom: 10px;
    border-radius: 14px;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.92) 0%, rgba(88, 28, 28, 0.92) 60%, rgba(15, 23, 42, 0.92) 100%);
    border: 1px solid rgba(15, 23, 42, 0.18);
    box-shadow: 0 6px 18px rgba(0,0,0,0.10);
    overflow: hidden;
}

.ticker-viewport {
    height: 100%;
    display: flex;
    align-items: center;
}

.ticker-track {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding-left: 100%;
    white-space: nowrap;
    will-change: transform;
    animation: headerTickerScroll var(--ticker-duration) linear infinite;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.92);
    letter-spacing: -0.2px;
}

.header-ticker:hover .ticker-track {
    animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
    .ticker-track {
        animation: none;
        padding-left: 0;
    }
}

.ticker-item {
    opacity: 0.95;
}

.ticker-sep {
    opacity: 0.65;
}

@keyframes headerTickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* 헤더 */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    color: #1f2937;
    padding: 12px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    position: sticky;
    top: var(--ticker-height);
    z-index: 10;
}

.app-header h1 {
    margin: 0;
    font-size: 1.4em;
    color: inherit;
}

.header-left { display: flex; flex-direction: column; gap: 4px; }
.header-right { display: flex; align-items: center; gap: 10px; }
.nav-buttons { display: flex; gap: 8px; }

.nav-btn {
    background: #e2e8f0;
    color: #1f2937;
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
}
.nav-btn:hover { background: #d9e2ec; }

.btn-icon {
    background: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.btn-icon:hover { background: #f1f5f9; }

header h1 {
    font-size: 2.4em;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

header .subtitle {
    font-size: 0.95em;
    opacity: 0.95;
    font-weight: 400;
}

/* 메인 콘텐츠 */
main {
    flex: 1;
    background: white;
    border-radius: 24px;
    padding: 32px;
    margin-bottom: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* 화면 전환 */
.screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.screen-active {
    display: block;
}

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