
#tv-debug {
  display: none;
}

/* ==========================================================
   WOLF APP — FULL WIDTH RESPONSIVE LAYOUT
   ========================================================== */

/* ---------- Variables ---------- */
:root {
    --bg-dark: #0d0d16;
    --bg-panel: #1a1a24;
    --text-light: #f5f5f5;
    --accent: #f3c623;
    --danger: #d33;
    --success: #3c3;
    --font-main: "Poppins", Arial, sans-serif;
}


/* ---------- Reset + Base ---------- */
html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-main);
    height: 100%;
   overflow: hidden; /* Do not scroll body, scroll main only */
   width: 100%;
}

#app {
  height: 100%;
}


* {
    box-sizing: border-box;
}


/* ==========================================================
   APP LAYOUT
   ========================================================== */

/* .app-layout {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100%;
    width: 100%;
    overflow: hidden;
} */


/* .app-layout {
    height: 100dvh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
} */

.app-layout {
    display: grid;
    grid-template-rows: auto 1fr auto; /* header | main | footer */
    height: 100%;
    width: 100%;
}


/* ---------- Header ---------- */
/* .app-header {
    width: 100%;
    background: #222;
    color: #fff;
    padding: 10px 14px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    flex-shrink: 0;
} */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* distributes left/center/right */
    padding: 10px 12px;
    background: #222;
    color: #fff;
    width: 100%;
    box-sizing: border-box;
}

.header-logo {
    height: 32px;
}

.header-left,
.header-center,
.header-right {
    display: flex;
    align-items: center;
    flex: 1;                 /* ⭐ ensures equal column widths */
}

/* Left content aligned left */
.header-left {
    justify-content: flex-start;
}

/* Center content perfectly centered */
.header-center {
    justify-content: center;
}

/* Right content aligned right */
.header-right {
    justify-content: flex-end;
}



/* ---------- Main Content (scrollable) ---------- */
/* .app-main {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch; 
    background: var(--bg-dark);
    border:1px solid #f00;
    min-height: 0;
    height: calc(100vh - 200px);
} */

.app-main {
    grid-row: 2;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    background: var(--bg-dark);
    min-height: 0; /* ⚠ Required for scrollability inside grid */
    border: 1px solid red; /* debug */
}


/* ---------- Collapsible Message Bar ---------- */
.app-message {
    width: 100%;
    background: #333;
    color: #fff;
    padding: 10px 12px;

    display: none;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

#appMessageClose {
    background: transparent;
    border: 0;
    font-size: 18px;
    color: #fff;
    cursor: pointer;
}


/* ---------- Footer Action Bar ---------- */
/* .app-footer {
    width: 100%;
    padding: 12px;
    background: #111;
    color: #fff;

    display: flex;
    justify-content: center;
    gap: 12px;

    flex-shrink: 0;
} */


.app-footer {
    grid-row: 3;
    padding: 12px;
    background: #111;
    color: #fff;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ==========================================================
   BUTTONS
   ========================================================== */

button {
    background: var(--accent);
    color: #000;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    font-size: 1rem;
}

button:hover {
    background: #ffd74d;
    transform: scale(1.05);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

button#restartGameBtn{
   left: 0;
    position: fixed;
    font-size: 80%;
    padding: 6px 10px;
}

.btn {
    padding: 10px 18px;
}

.btn.primary { background: var(--accent); color: #000; }
.btn.secondary { background: #444; color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 6px 12px; font-size: 0.9rem; }


/* ==========================================================
   INPUTS
   ========================================================== */

input, select {
    width: 100%;
    background: rgba(255,255,255,0.08);
    color: var(--text-light);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 1rem;
    margin-bottom: 10px;
}


/* ==========================================================
   COMMON VIEW ELEMENTS
   ========================================================== */

.view {
    width: 100%;
}

h1, h2, h3 {
    margin: 0 0 12px 0;
    font-weight: 600;
}

p {
    line-height: 1.4;
    font-size: 0.95rem;
}


/* ==========================================================
   PLAYER LIST (Lobby & other views)
   ========================================================== */

.player-list {
    list-style: none;
    padding: 0;
    margin: 20px auto;
    width: 100%;
    max-width: 850px;

    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.player-badge {
    background: #1b1b1d;
    border: 2px solid #333;
    border-radius: 10px;
    height: 56px;

    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 8px;
}

.player-badge.selected {
    opacity: 1;
    border-color: #ffd700;
    box-shadow: 0 0 8px rgba(255,215,0,0.6);
}

.player-badge.you {
    background: #333;
    border-color: darkgreen;
}

.player-badge .avatar {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: black;
}

.player-badge .name {
    color: #eee;
    font-size: 0.85rem;
    font-weight: 600;
}

.kick-btn {
    position: absolute;
    right: 4px;
    top: 4px;
    background: #b00000;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 10px;
    padding: 2px 4px;
}


/* ==========================================================
   ROLE REVEAL
   ========================================================== */

.role-reveal-page {
    text-align: center;
    padding: 20px;
}

.role-reveal-box {
    position: fixed;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: rgba(255,255,255,0.95);
    color: #000;
    padding: 25px 30px;
    border-radius: 12px;
    border: 2px solid #333;
    font-size: 1.5rem;
    text-align: center;
    max-width: 80vw;
}

.role-reveal-box.hide {
    display: none;
}


.role-hint-button {
    width: 54px;
    height: 54px;
    line-height: 54px;
    border-radius: 50%;
    background: #222;
    color: #fff;
    font-size: 2rem;
    margin: 10px auto;
    text-align: center;
    cursor: pointer;
}

.countdown-text {
    margin-top: 10px;
    font-size: 1.1rem;
    color: #444;
}



/* ==========================================================
   LOADER
   ========================================================== */
.loader {
    margin: 20px auto;
    width: 60px;
    height: 60px;
    border: 8px solid #ddd;
    border-top-color: #444;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    100% { transform: rotate(360deg); }
}


/* ==========================================================
   RESPONSIVENESS
   ========================================================== */

@media (max-width: 600px) {
    .app-header,
    .app-footer {
        padding: 8px;
    }

    button {
        font-size: 0.9rem;
        padding: 8px 14px;
    }
}


/* ============================
   GAME OPTIONS TABLE STYLING
   ============================ */


/* Table rows */
.role-table tbody tr {
    border-bottom: 1px solid #333;
}

.role-table tbody tr:last-child {
    border-bottom: none;
}

/* Zebra striping for readability */
.role-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

/* Table cells */
.role-table td {
    padding: 10px 8px;
    vertical-align: middle;
    font-size: 0.95rem;
}

/* Role name cell */
.role-table td:first-child {
    font-weight: 600;
}

/* Sliders */
.role-slider {
    width: 100%;
}

/* Value output */
.slider-value {
    display: inline-block;
    min-width: 24px;
    text-align: center;
}

/* Optional rows */
.role-row.optional td:first-child {
    color: #ccc;
}

/* Checkbox in role column */
.role-checkbox {
    margin-left: 6px;
}

/* For the whole page */
/* .game-options-page h2,
.game-options-page p {
    text-align: center;
} */





/* Center the table container */
#roleSetupContainer {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

/* Table styling */
.role-table {
    width: 100%;
    border-collapse: collapse;
    background: #1b1b1d;
    border: 1px solid #333;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 16px;
}

/* Headers */
.role-table thead th {
    background: #2c2c2f;
    padding: 10px;
    text-align: center;
    border-bottom: 2px solid #444;
}






/* Row zebra striping */
.role-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.03);
}

/* Cells */
.role-table td {
    padding: 6px 8px;
    text-align: center;
}

/* Role name left-align */
.role-table td.role-name {
    text-align: left;
    font-weight: 600;
}

/* Slider wrapper */
.slider-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}


/* Slider itself */
.role-slider {
    width: 100%;
}

/* Current value cell */
.role-current .slider-value {
    font-weight: bold;
    font-size: 1rem;
}


.intro-text.reveal-mode p {
    opacity: 0;                /* JS will fade them in */
}

.intro-text.full-mode p {
    opacity: 1;
}





.role-slider-cell {
    text-align: center;
}



.slider-min,
.slider-max {
    font-size: 0.9rem;
    opacity: 0.7;
    width: 20px;
    text-align: center;
}

.slider-wrapper input{
  padding: 0;
  margin-bottom: 0;
}



.your-role-card {
    margin-top: 20px;
    padding: 20px;
    background: #222;
    border-radius: 10px;
    color: #fff;
}

.avatar.big {
    width: 120px;
    height: 120px;
    border-radius: 50%;
}

.role-reveal-list {
    list-style: none;
    padding: 0;
}

.role-reveal-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1e1e1e;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
}


/* ROLE REVEAL PHASE */

.role-popup {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: bold;
    z-index: 10000;
}

.hidden {
    display: none !important;
}



.your-role-description {
    margin-top: 10px;
    font-size: 1.2rem;
}

.countdown-text {
    margin-top: 12px;
    font-size: 1.1rem;
    opacity: 0.8;
}

.your-role-popup {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 12px 16px;
    background: rgba(20,20,20,0.95);
    color: #fff;
    border-radius: 10px;
    font-size: 1.3rem;
    z-index: 9999;
    box-shadow: 0 0 10px #000;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #222;
    padding: 24px;
    border-radius: 10px;
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
/* First Night selection */
.night-badge.selected {
    outline: 2px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.04);
}



.night-badge.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.night-badge.me em {
    font-size: 0.85em;
    opacity: 0.7;
}

/* Wolf awareness */
.night-badge.wolf {
    box-shadow: inset 0 0 0 1px rgba(255,0,0,0.25);
}

/* Seer reveal */
.night-badge.seer-wolf {
    box-shadow: 0 0 10px rgba(255,0,0,0.4);
}

.night-badge.seer-not-wolf {
    box-shadow: 0 0 10px rgba(0,255,0,0.3);
}

.night-badge.seer-wolf::after {
    content: "🐺 Wolf";
    font-size: 0.8rem;
    opacity: 0.8;
}

.night-badge.seer-not-wolf::after {
    content: "Not Wolf";
    font-size: 0.8rem;
    opacity: 0.6;
}


/* ===== Player role overlay ===== */
.player-overlay {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.75);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0.85;
}

/* Wolf highlight (visible only to wolves) */
.night-badge.wolf-known {
    box-shadow: 0 0 0 2px rgba(255,0,0,0.4);
}


/* Player themselves */
.night-badge.self {
    opacity: 0.55;
    pointer-events: none;
}


