/* assets/css/werewolf.css - Werewolf (คืนหอนหลอนหมาป่า) Ultimate Board Game Theme */
:root {
    --bg-dark: #070913;
    --bg-panel: rgba(15, 20, 36, 0.92);
    --bg-card: #131a2e;
    --border-gold: rgba(234, 179, 8, 0.4);
    --border-red: rgba(220, 38, 38, 0.5);
    --color-wolf: #ef4444;
    --color-villager: #38bdf8;
    --color-neutral: #f59e0b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font-sans: 'Kanit', 'DM Sans', -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 50% 15%, rgba(30, 58, 138, 0.25) 0%, transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(127, 29, 29, 0.15) 0%, transparent 50%);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(245, 158, 11, 0.3); border-radius: 4px; }

/* Navbar */
.ww-navbar {
    height: 64px;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-gold);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 50;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.ww-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Phase Banner */
.phase-banner {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s;
}
.phase-banner.night {
    background: linear-gradient(90deg, #1e1b4b, #0f172a);
    border-color: #4338ca;
}
.phase-banner.day {
    background: linear-gradient(90deg, #78350f, #1c1917);
    border-color: #d97706;
}
.phase-banner.voting {
    background: linear-gradient(90deg, #7f1d1d, #1c1917);
    border-color: #ef4444;
}

.phase-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.phase-timer {
    font-size: 18px;
    font-weight: 800;
    color: #f59e0b;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-gold);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
    outline: none;
    font-family: var(--font-sans);
}
.btn-gold {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fff;
    border-color: #f59e0b;
}
.btn-gold:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}
.btn-red {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: #fff;
    border-color: #ef4444;
}
.btn-red:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}
.btn-dark {
    background: rgba(30, 41, 59, 0.8);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.12);
}
.btn-dark:hover {
    background: rgba(51, 65, 85, 0.9);
    border-color: var(--border-gold);
}
.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* Main Layout */
.ww-main {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1fr 340px;
    overflow: hidden;
    position: relative;
}

/* Village Table Area */
.village-area {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-y: auto;
}

/* Campfire center */
.village-campfire {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.4) 0%, rgba(185, 28, 28, 0.1) 60%, transparent 80%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    box-shadow: 0 0 50px rgba(234, 88, 12, 0.3);
    animation: flamePulse 2s infinite ease-in-out;
}
@keyframes flamePulse {
    0%, 100% { transform: scale(0.98); opacity: 0.85; }
    50% { transform: scale(1.05); opacity: 1; }
}

/* Players Grid in Village */
.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
    width: 100%;
    max-width: 900px;
}

.player-seat {
    background: rgba(17, 24, 39, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 12px 8px;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}
.player-seat:hover {
    transform: translateY(-3px);
    border-color: var(--border-gold);
}
.player-seat.selected-target {
    border-color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
    background: rgba(127, 29, 29, 0.3);
}
.player-seat.dead {
    opacity: 0.45;
    filter: grayscale(80%);
    border-color: #4b5563;
}
.seat-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #1e293b;
    border: 2px solid var(--border-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 0 auto 6px auto;
}
.seat-name {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.seat-status-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    display: inline-block;
}
.seat-status-badge.alive {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.seat-status-badge.dead {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.seat-votes-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    border: 2px solid #fff;
}

/* Card Presentation (The Cards) */
.role-card-container {
    perspective: 1000px;
    width: 200px;
    height: 300px;
    cursor: pointer;
    margin: 0 auto;
}
.role-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}
.role-card-container.flipped .role-card-inner {
    transform: rotateY(180deg);
}

.role-card-front, .role-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    border: 2px solid var(--border-gold);
}

.role-card-back {
    background: linear-gradient(135deg, #1e1b4b, #0f172a);
    align-items: center;
    justify-content: center;
}
.role-card-front {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #1e293b, #0f172a);
}

/* Card Gallery in Modal */
.cards-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    max-height: 65vh;
    overflow-y: auto;
    padding: 10px;
}
.gallery-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s;
}
.gallery-card:hover {
    border-color: var(--border-gold);
    transform: translateY(-2px);
    background: rgba(30, 41, 59, 0.9);
}
.card-team-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    align-self: flex-start;
}
.card-team-tag.werewolf { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid #ef4444; }
.card-team-tag.villager { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid #0ea5e9; }
.card-team-tag.neutral { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid #f59e0b; }

/* Right Chat & Logs Sidebar */
.ww-sidebar {
    background: rgba(15, 20, 36, 0.98);
    border-left: 1px solid var(--border-gold);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}
.sidebar-header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
    font-weight: 700;
    color: #fbbf24;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chat-messages {
    flex-grow: 1;
    padding: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chat-scroll-bottom-btn {
    position: absolute;
    bottom: 58px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0f172a;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    z-index: 20;
    display: none;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
}
.chat-scroll-bottom-btn:hover {
    transform: translateX(-50%) scale(1.05);
    background: #fbbf24;
}
.chat-msg {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    background: rgba(30, 41, 59, 0.4);
    border-left: 3px solid rgba(255, 255, 255, 0.1);
}
.chat-msg.system { border-left-color: #38bdf8; background: rgba(56, 189, 248, 0.08); }
.chat-msg.night { border-left-color: #818cf8; background: rgba(129, 140, 248, 0.08); }
.chat-msg.vote { border-left-color: #fbbf24; background: rgba(251, 191, 36, 0.08); }
.chat-msg.death { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.15); }

.chat-input-row {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 8px;
}
.chat-input-text {
    flex-grow: 1;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    font-family: var(--font-sans);
}
.chat-input-text:focus { border-color: #f59e0b; }

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: #111827;
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    width: 90%;
    max-width: 680px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-size: 18px; font-weight: 700; color: #fbbf24; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; }
.modal-body { padding: 20px; overflow-y: auto; }

/* Responsive */
@media (max-width: 860px) {
    .ww-main { grid-template-columns: 1fr; }
    .ww-sidebar { height: 260px; border-left: none; border-top: 1px solid var(--border-gold); }
}

/* Center Game Control Hub */
.village-center-hub {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    padding: 16px 24px;
    margin: 12px 0 20px 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    text-align: center;
    max-width: 580px;
    width: 90%;
    z-index: 20;
}
.hub-title {
    font-size: 16px;
    font-weight: 800;
    color: #fbbf24;
    margin-bottom: 6px;
}
.hub-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.hub-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

/* Bottom Player Dock */
.bottom-dock {
    height: 60px;
    background: rgba(10, 14, 26, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-gold);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 45;
}
.dock-card-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 16px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
}
.dock-card-preview:hover {
    border-color: var(--border-gold);
    background: rgba(30, 41, 59, 0.95);
    transform: translateY(-2px);
}

.seat-action-btn {
    margin-top: 6px;
    width: 100%;
    padding: 3px 6px;
    font-size: 11px;
    border-radius: 6px;
    font-weight: 700;
}
