/* === General Body and Theme Styles === */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a2e; /* Dark space blue */
    color: #e0e0e0; /* Light gray text */
    margin: 0;
    padding: 20px;
    overflow-x: hidden; /* Prevent horizontal scrollbars from animations */
}

/* === ANIMATED BACKGROUND === */
.background-animation {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    background: #1a1a2e;
    overflow: hidden;
    z-index: -1;
}

.squares {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.squares li {
    position: absolute;
    display: block;
    list-style: none; /* This removes the bullet points */
    width: 20px;
    height: 20px;
    background: rgba(0, 255, 255, 0.15);
    animation: animate 25s linear infinite;
    bottom: -150px;
    border: 1px solid rgba(0, 255, 255, 0.3);
}

.squares li:nth-child(1){ left: 25%; width: 80px; height: 80px; animation-delay: 0s; }
.squares li:nth-child(2){ left: 10%; width: 20px; height: 20px; animation-delay: 2s; animation-duration: 12s; }
.squares li:nth-child(3){ left: 70%; width: 20px; height: 20px; animation-delay: 4s; }
.squares li:nth-child(4){ left: 40%; width: 60px; height: 60px; animation-delay: 0s; animation-duration: 18s; }
.squares li:nth-child(5){ left: 65%; width: 20px; height: 20px; animation-delay: 0s; }
.squares li:nth-child(6){ left: 75%; width: 110px; height: 110px; animation-delay: 3s; }
.squares li:nth-child(7){ left: 35%; width: 150px; height: 150px; animation-delay: 7s; }
.squares li:nth-child(8){ left: 50%; width: 25px; height: 25px; animation-delay: 15s; animation-duration: 45s; }
.squares li:nth-child(9){ left: 20%; width: 15px; height: 15px; animation-delay: 2s; animation-duration: 35s; }
.squares li:nth-child(10){ left: 85%; width: 150px; height: 150px; animation-delay: 0s; animation-duration: 11s; }

@keyframes animate {
    0%{ transform: translateY(0) rotate(0deg); opacity: 1; border-radius: 0; }
    100%{ transform: translateY(-1000px) rotate(720deg); opacity: 0; border-radius: 50%; }
}
/* === END BACKGROUND === */

.container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: rgba(44, 62, 80, 0.9);
    border-radius: 8px;
    border: 2px solid #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
    text-align: center;
    position: relative; /* Ensure container sits above the background */
    z-index: 1;
}

/* === BUTTON AND INPUT STYLES === */
button {
    background-color: rgba(44, 62, 80, 0.7);
    color: white;
    padding: 12px 24px;
    border: 2px solid #00ffff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin: 5px;
    transition: background-color 0.2s, box-shadow 0.2s;
}

button:hover {
    background-color: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 10px #00ffff;
}

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

button.selected {
    background-color: rgba(0, 255, 255, 0.25);
    box-shadow: 0 0 15px #00ffff, inset 0 0 5px rgba(0, 255, 255, 0.5);
    border-color: #99ffff;
}

input[type="text"] {
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 2px solid #00ffff;
    background-color: #1a1a2e;
    color: #e0e0e0;
    margin: 5px;
}

/* === PLAYER LIST STYLES === */
#player-list, #game-player-list {
    list-style-type: none;
    padding: 0;
    margin: 10px 0;
    text-align: left;
}

.player-list-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 1.1em;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 5px 10px;
    border-radius: 5px;
}

.player-list-icon {
    width: 28px;
    height: 28px;
    margin-right: 12px;
    flex-shrink: 0;
}

.player-list-icon-placeholder {
    width: 28px;
    height: 28px;
    margin-right: 12px;
    flex-shrink: 0;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}
/* === END PLAYER LIST STYLES === */

/* === GAME BOARD AND PAWN STYLES === */
#host-game-view {
    max-width: 95%;
    margin: 20px auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.game-content {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    flex-wrap: wrap;
}

#info-container {
    flex: 1;
    min-width: 320px;
    max-width: 400px;
}

#board-container {
    flex: 2;
    max-width: 90vh;
    aspect-ratio: 1 / 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr 1fr;
    grid-template-areas: 
        "r1  r2  r3  r4"
        "p1 start start r5"
        "r6 start start r7"
        "r8  r9  r10 r11";
    gap: 5px;
    background-color: rgba(0,0,0,0.2);
    border: 2px solid #00ffff;
    position: relative;
    padding: 5px;
}

.square {
    border: 1px solid #00ffff66;
    background-color: rgba(44, 62, 80, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    font-size: 1.1em;
}

.square.start-square .square-name {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
}

.square-name {
    background-color: transparent;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px black;
    font-size: clamp(0.7rem, 1.5vw, 1.2rem);
}

.pawn {
    width: clamp(45px, 7vh, 90px); 
    height: clamp(45px, 7vh, 90px); 
    position: absolute;
    transition: transform 1s ease-in-out;
    z-index: 10;
}

.tracker-value {
    font-weight: bold;
    margin-top: 10px;
    text-shadow: 0 0 5px black;
    font-size: clamp(1.5rem, 4vw, 3rem);
}

/* === CARD STYLES === */
.card {
    width: 70px;
    height: 100px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin: 5px;
    border-radius: 8px;
    font-size: 2.5em;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.4);
}

.card-suit-yellow {
    background-color: #f1c40f;
    border: 2px solid #f39c12;
}
.card-suit-pink {
    background-color: #F472B6;
    border: 2px solid #F9A8D4;
}
.card-suit-neutral {
    background-color: #95a5a6;
    border: 2px solid #bdc3c7;
}

.card.clickable:hover {
    cursor: pointer;
    transform: scale(1.05);
    filter: brightness(1.2);
}
.card-checkbox {
    display: none;
}
.card-checkbox:checked + .card {
    box-shadow: 0 0 15px 5px #00ffff;
    border-radius: 8px;
}

/* === MISC STYLES === */
.trap-info {
    font-weight: bold;
    position: absolute;
    bottom: 5px;
    background-color: rgba(0,0,0,0.7);
    padding: 2px 6px;
    border-radius: 3px;
    color: #ff4d4d;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: clamp(0.6rem, 1.2vw, 1rem);
}

.trap-suit {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 3px;
}
.trap-suit-yellow { background-color: #f1c40f; }
.trap-suit-pink { background-color: #F472B6; }
.trap-suit-both { background: linear-gradient(45deg, #f1c40f 50%, #F472B6 50%); }


.voted-check {
    color: #27ae60;
    font-weight: bold;
    margin-left: 8px;
}

#proposal-display, #player-info, #conspiracy-plot-info, #conspiracy-team-info {
    background: rgba(0, 255, 255, 0.1);
    border-left: 6px solid #00ffff;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

#conspiracy-team-list { list-style-type: none; padding: 0; margin: 0; text-align: left; }
.scout-highlight { font-weight: bold; color: #00ffff; border: 2px solid #00ffff; border-radius: 5px; padding: 2px 5px; background-color: #34495e; }
#clue-board { margin: 20px 0; }
.clue-card {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #444;
    background-color: #2c3e50;
    margin-bottom: 10px;
}
.clue-card h4 {
    margin-top: 0;
    margin-bottom: 5px;
    color: #00ffff;
}
.clue-card p { margin: 0; font-size: 16px; }
#public-clue-card { background-color: rgba(39, 174, 96, 0.2); border-color: #27ae60; }
#declarations-container { background-color: rgba(243, 156, 18, 0.2); border-color: #f39c12; }
#declarations-list { list-style-type: none; padding: 0; margin: 0; }
#declarations-list li { padding: 4px 0; font-size: 14px; border-bottom: 1px solid rgba(243, 156, 18, 0.5); }
#declarations-list li:last-child { border-bottom: none; }

#game-log-container { margin-top: 20px; text-align: left; max-height: 200px; overflow-y: auto; border: 1px solid #00ffff; padding: 10px; background-color: rgba(0,0,0,0.2); border-radius: 5px; }
#game-log { list-style-type: none; padding: 0; margin: 0; font-size: 14px; }
#game-log li { padding: 4px 0; border-bottom: 1px solid #444; }

/* --- OVERLAY STYLES --- */
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.9); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.overlay-content { 
    background-color: #1a1a2e; 
    padding: 20px 40px; 
    border-radius: 10px; 
    text-align: center; 
    width: 90%; 
    max-width: 600px; 
    border: 3px solid #00ffff; 
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.5); 
    color: #e0e0e0;
    max-height: 90vh;
    overflow-y: auto;
}
#win-title { font-size: 3em; margin-bottom: 10px; font-weight: bold; }
#win-title.friends-win { color: #27ae60; }
#win-title.conspiracy-win { color: #c0392b; }
#reveal-container { margin-top: 30px; background-color: rgba(0,0,0,.2); padding: 20px; border-radius: 5px; }
#player-roles-list { list-style-type: none; padding: 0; margin-top: 15px; display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; }
#player-roles-list li { padding: 10px; border-radius: 5px; font-size: 1.1em; }
#player-roles-list li.Conspiracy { color: #c0392b; font-weight: bold; }
.pawn-reveal { display: inline-block; width: 20px; height: 20px; border-radius: 50%; border: 1px solid white; margin-right: 8px; vertical-align: middle; }

#role-guide-btn {
    margin-bottom: 15px;
}
.role-guide-content { border: 2px solid #00ffff; }
.role-guide-content h3 { text-align: center; }

#accusation-timer { font-size: 2.5em; font-weight: bold; color: #e67e22; }
#final-vote-container { display: flex; justify-content: space-around; gap: 15px; margin-top: 20px; text-align: left; color: #e0e0e0;}
.vote-category { flex: 1; background-color: rgba(0, 255, 255, 0.1); padding: 10px; border-radius: 5px; }
.vote-category h4 { margin-top: 0; text-align: center; }
.vote-category div label { display: block; margin-bottom: 5px; }
#tie-breaker-container { text-align: left; }

#character-selection-container { margin-top: 20px; padding-top: 20px; border-top: 1px solid #00ffff; }
.character-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 10px; }
.character-option { border: 2px solid #444; border-radius: 8px; padding: 10px; cursor: pointer; transition: background-color .2s,border-color .2s; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.character-option:hover { background-color: rgba(0, 255, 255, 0.2); border-color: #00ffff; }
.character-option .pawn { position: static; transform: none; }
.character-option.taken { cursor: not-allowed; background-color: #333; opacity: .5; border-color: #555; }
.character-option.selected { border-color: #27ae60; background-color: rgba(39, 174, 96, 0.3); font-weight: 700; }

/* Media query for smaller screens */
@media (max-width: 900px) {
    .game-content {
        flex-direction: column;
        align-items: center;
    }
    #board-container {
        width: 100%;
        max-width: 625px;
        flex: auto;
    }
}

@media (max-width: 600px) {
    #final-vote-container {
        flex-direction: column;
        gap: 20px;
    }
}

/* === STYLES FOR WELCOME PAGE === */
#donate-btn {
    position: fixed;
    bottom: 10px;
    left: 15px;
    display: inline-block;
    background-color: transparent;
    color: #f1c40f;
    padding: 8px 12px;
    border: 1px solid #f1c40f;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.2s, box-shadow 0.2s, color 0.2s;
    text-decoration: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    z-index: 10;
}

#donate-btn:hover {
    background-color: rgba(241, 196, 15, 0.2);
    box-shadow: 0 0 10px #f1c40f;
    color: #f1c40f;
}

.watermark {
    position: fixed;
    bottom: 10px;
    right: 15px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    font-family: sans-serif;
    z-index: 10;
}

.how-to-play {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 255, 255, 0.3);
}

.how-to-play h3 {
    color: #00ffff;
}

/* === INTERACTIVE TUTORIAL STYLES === */
.tutorial-content {
    padding: 20px;
    max-width: 500px;
}

#tutorial-container {
    min-height: 300px; /* This keeps the overall modal size consistent */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tutorial-step {
    display: none;
}
.tutorial-step.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}
.tutorial-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}
.team-card {
    padding: 20px;
    border-radius: 8px;
    width: 150px;
}
.team-card.friends {
    background-color: rgba(39, 174, 96, 0.3);
    border: 2px solid #27ae60;
}
.team-card.conspiracy {
    background-color: rgba(192, 57, 43, 0.3);
    border: 2px solid #c0392b;
}
.team-title { font-weight: bold; font-size: 1.2em; margin-bottom: 5px; }
.team-goal { font-size: 0.9em; }

.tutorial-player {
    padding: 8px 12px;
    border: 1px solid #00ffff;
    border-radius: 20px;
}
.tutorial-player.scout {
    background-color: #34495e;
    font-weight: bold;
}
.tutorial-player.selected {
    background-color: rgba(0, 255, 255, 0.2);
}
.vote-yes { color: #27ae60; font-weight: bold; }
.vote-no { color: #c0392b; font-weight: bold; }
.friends-text { color: #27ae60; font-weight: bold; }
.conspiracy-text { color: #c0392b; font-weight: bold; }

.tutorial-card {
    width: 60px;
    height: 90px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px black;
}
.tutorial-card.card-yellow {
    background-color: #f1c40f;
    border: 2px solid #f39c12;
}
.tutorial-card.card-pink {
    background-color: #F472B6;
    border: 2px solid #F9A8D4;
}
.tutorial-card.card-neutral {
    background-color: #95a5a6;
    border: 2px solid #bdc3c7;
}

.clue-box {
    padding: 15px;
    background-color: rgba(0,0,0,0.3);
    border: 1px solid #00ffff88;
    border-radius: 5px;
    text-align: left;
    line-height: 1.5;
}

.tutorial-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    border-top: 1px solid rgba(0, 255, 255, 0.3);
    padding-top: 15px;
}
#tutorial-progress {
    display: flex;
    gap: 8px;
}
.dot {
    width: 12px;
    height: 12px;
    background-color: #444;
    border-radius: 50%;
    transition: all 0.3s;
}
.dot.active {
    background-color: #00ffff;
    transform: scale(1.2); /* Make the active dot slightly bigger */
}
#tutorial-close {
    margin-top: 15px;
    width: 100%;
    background-color: rgba(0,0,0,0.2);
}