/* === SHOGUNATE - Sengoku Strategy Map === */
/* === Base Reset & Theme === */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;600;700&display=swap');

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

:root {
    --bg-primary: #1a1a14;
    --bg-secondary: #252518;
    --bg-panel: #2a2a1e;
    --bg-card: #333328;
    --border: #4a4a38;
    --border-light: #5a5a48;
    --text-primary: #e8d5b0;
    --text-secondary: #b8a880;
    --text-muted: #8a7d68;
    --accent-gold: #c8a84e;
    --accent-red: #cc3333;
    --accent-green: #40c060;
    --accent-blue: #4488cc;
    --planning-color: #4488cc;
    --battle-color: #cc3333;
    --shadow: rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* === Top Bar === */
#top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 16px;
    background: linear-gradient(180deg, #2a2a1e, #1a1a14);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    position: relative;
}

#top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

#game-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-gold);
    letter-spacing: 2px;
}

#week-display {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 2px 8px;
    background: var(--bg-card);
    border-radius: 4px;
}

.phase-planning {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--planning-color);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.phase-battle {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--battle-color);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulse 1.5s ease-in-out infinite;
}

#top-bar-center {
    display: flex;
    align-items: center;
}

#countdown-timer {
    display: flex;
    align-items: center;
    gap: 8px;
}

#countdown-label {
    font-size: 11px;
    color: var(--text-muted);
}

#countdown-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-gold);
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

#top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === Auth (Discord Login) === */
#auth-container {
    display: flex;
    align-items: center;
}

.auth-user {
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--accent-gold);
}

.auth-username {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-clan {
    font-size: 10px;
    color: var(--accent-gold);
    padding: 1px 6px;
    background: rgba(200, 168, 78, 0.15);
    border-radius: 8px;
}

.auth-btn {
    padding: 4px 10px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.auth-login {
    background: #5865F2;
    color: #fff;
    border-color: #4752C4;
}

.auth-login:hover {
    background: #4752C4;
}

.auth-logout {
    background: var(--bg-card);
    color: var(--text-muted);
    border-color: var(--border);
}

.auth-logout:hover {
    background: var(--accent-red);
    color: #fff;
    border-color: var(--accent-red);
}

.auth-user {
    cursor: pointer;
    position: relative;
}

#auth-container {
    position: relative;
}

.auth-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    z-index: 200;
    min-width: 100px;
    box-shadow: 0 4px 12px var(--shadow);
}

.auth-menu.hidden {
    display: none;
}

.auth-menu-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    text-align: left;
}

.auth-menu-item:hover {
    background: var(--accent-red);
    color: #fff;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

#clan-selector {
    padding: 4px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 4px;
    font-family: inherit;
    font-size: 12px;
}

.top-btn {
    width: 32px;
    height: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.top-btn:hover {
    background: var(--border);
}

.discord-btn {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discord-btn:hover svg path {
    fill: #5865F2;
}

/* === Main Content === */
#main-content {
    display: flex;
    height: calc(100vh - 48px);
    position: relative;
}

/* === Map Container === */
#map-container {
    flex: 1;
    overflow: hidden;
    background: #0d1b2a;
    cursor: default;
    position: relative;
}

#game-map {
    width: 100%;
    height: 100%;
}

/* === Province Styles === */
.province-path {
    cursor: pointer;
    transition: fill-opacity 0.2s, stroke-width 0.2s;
    paint-order: stroke fill;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.province-path:hover {
    fill-opacity: 0.8 !important;
}

.province-path.highlighted {
    stroke: var(--accent-gold);
    stroke-width: 2.5;
    filter: url(#glow);
}

.province-path.move-target {
    stroke: var(--accent-green);
    stroke-width: 2;
    stroke-dasharray: 4,2;
    animation: target-pulse 1s ease-in-out infinite;
}

@keyframes target-pulse {
    0%, 100% { stroke-opacity: 0.5; }
    50% { stroke-opacity: 1; }
}

/* === Order Arrows === */
.order-arrow {
    pointer-events: none;
}

/* === Notifications === */
#notifications {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    max-width: 380px;
}

.notification {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    font-size: 13px;
}

.notification.show {
    transform: translateX(0);
}

.notif-success { border-left: 3px solid var(--accent-green); }
.notif-error { border-left: 3px solid var(--accent-red); }
.notif-warning { border-left: 3px solid #ff9900; }
.notif-info { border-left: 3px solid var(--accent-blue); }
.notif-diplomacy { border-left: 3px solid #aa44cc; }
.notif-battle { border-left: 3px solid var(--accent-red); }

.notif-icon { font-size: 16px; flex-shrink: 0; }
.notif-message { flex: 1; }
.notif-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
}

/* === Animations === */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}
