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

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

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

body {
    font-family: 'Space Mono', monospace;
    line-height: 1.6;
    color: #111;
    background-color: #f0f0f0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background-color 0.5s ease;
}

.container {
    max-width: 800px;
    width: 100%;
    background-color: #fff;
    padding: 40px;
    border-radius: 0;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.5s ease, border 0.3s ease;
    position: relative;
    animation: fadeIn 0.8s ease-out;
}

.header {
    border-bottom: 1px solid #ddd;
    margin-bottom: 30px;
    padding-bottom: 20px;
    position: relative;
}

.header-bar {
    height: 4px;
    width: 100px;
    background-color: #000;
    position: absolute;
    bottom: -2px;
    left: 0;
    animation: slideIn 0.8s ease-out;
}

h1 {
    text-align: left;
    margin-bottom: 10px;
    color: #000;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.1;
    font-family: 'Space Mono', monospace;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.section {
    margin-bottom: 30px;
    animation: fadeIn 0.5s ease-out;
}

.section p {
    margin-bottom: 25px;
    font-size: 1.1rem;
}

button {
    background-color: #000;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    display: block;
    margin: 25px 0;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    font-family: 'Space Mono', monospace;
}

.btn-animated:after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}

.btn-animated:hover:after {
    left: 100%;
}

button:hover {
    background-color: #333;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

textarea {
    width: 100%;
    height: 120px;
    padding: 15px;
    margin: 15px 0;
    border-radius: 0;
    border: 1px solid #ddd;
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    resize: vertical;
    transition: border 0.3s ease;
}

textarea:focus {
    border-color: #000;
    outline: none;
}

.hidden {
    display: none;
}

#story-content, #ending-content {
    background-color: #f9f9f9;
    border-left: 4px solid #000;
    padding: 25px;
    border-radius: 0;
    margin-bottom: 25px;
    min-height: 100px;
    animation: fadeIn 0.5s ease-out;
    transition: all 0.3s ease;
}

#excuse-prompt p {
    font-weight: 600;
    color: #000;
    font-size: 1.2rem;
}

#user-excuse {
    background-color: #f2f2f2;
    padding: 20px;
    border-radius: 0;
    margin-bottom: 25px;
    border-left: 4px solid #555;
    animation: fadeIn 0.5s ease-out;
}

.user-excuse-text {
    font-style: italic;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto;
}

.spinner svg {
    animation: rotate 2s linear infinite;
    width: 50px;
    height: 50px;
}

.spinner .path {
    stroke: #000;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

#loading p {
    text-align: center;
    margin-top: 15px;
    color: #000;
    font-weight: 500;
    letter-spacing: 1px;
}

.difficulty-selector {
    margin: 20px 0;
    padding: 15px;
    background-color: #f5f5f5;
    border-left: 3px solid #000;
    animation: fadeIn 0.8s ease-out;
}

.difficulty-selector p {
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.1rem;
}

.difficulty-buttons {
    display: flex;
    gap: 10px;
}

.difficulty-btn {
    flex: 1;
    padding: 10px;
    background: #eee;
    color: #333;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-family: 'Space Mono', monospace;
}

.difficulty-btn:hover {
    background: #ddd;
    transform: translateY(-2px);
}

.difficulty-btn.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

.story-options {
    margin: 20px 0;
    padding: 15px;
    background-color: #f5f5f5;
    border-left: 3px solid #000;
    animation: fadeIn 0.8s ease-out;
}

.story-options p {
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.1rem;
}

.custom-story-input {
    margin-top: 15px;
    display: none;
}

.custom-story-input.visible {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

.story-type-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.story-type-btn {
    flex: 1;
    padding: 10px;
    background: #eee;
    color: #333;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-family: 'Space Mono', monospace;
}

.story-type-btn:hover {
    background: #ddd;
    transform: translateY(-2px);
}

.story-type-btn.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

.ending-buttons {
    display: flex;
    gap: 15px;
    margin: 25px 0;
}

.ending-buttons button {
    flex: 1;
    margin: 0;
}

/* Outcome styling */
.score-display {
    display: block;
    margin-top: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 5px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.success-outcome {
    transition: border 0.5s ease !important;
    border: 4px solid #2ecc71 !important;
    animation: pulse 0.5s ease-in-out;
}

.barely-outcome {
    transition: border 0.5s ease !important;
    border: 4px solid #f39c12 !important;
    animation: pulse 0.5s ease-in-out;
}

.fail-outcome {
    transition: border 0.5s ease !important;
    border: 4px solid #e74c3c !important;
    animation: pulse 0.5s ease-in-out;
}

#outcome-message {
    text-align: center;
    font-size: 1.5rem;
    padding: 20px;
    margin-top: 25px;
    border-radius: 0;
    font-weight: 700;
    letter-spacing: -0.3px;
    animation: fadeIn 0.8s ease-out, pulse 1s ease-in-out;
    transition: all 0.3s ease;
}

#outcome-message.success-outcome {
    background-color: rgba(46, 204, 113, 0.1);
    color: #27ae60;
}

#outcome-message.barely-outcome {
    background-color: rgba(243, 156, 18, 0.1);
    color: #d35400;
}

#outcome-message.fail-outcome {
    background-color: rgba(231, 76, 60, 0.1);
    color: #c0392b;
}

/* Notification styling */
#notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    z-index: 1100; 
}

.notification {
    background-color: #fff;
    color: #111;
    padding: 15px 20px;
    border-radius: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    animation: slideInRight 0.3s ease-out;
    opacity: 0;
    transform: translateX(20px);
    animation-fill-mode: forwards;
    z-index: 1100; 
}

@keyframes slideInRight {
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(10px); }
}

/* Multiplayer Button */
.multiplayer-btn {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #000;
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1px;
    font-family: 'Space Mono', monospace;
    transition: all 0.3s;
}

.multiplayer-btn:hover {
    background-color: #333;
    transform: translateY(-2px);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; 
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background-color: #fff;
    width: 90%;
    max-width: 600px;
    padding: 30px;
    position: relative;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.5s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

.game-room-content {
    max-width: 100%;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    padding: 40px;
    margin: 0;
    box-sizing: border-box;
}

.close-btn, .close-room-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s;
}

.close-btn:hover, .close-room-btn:hover {
    color: #555;
}

/* Multiplayer Options */
.multiplayer-options {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.option-section {
    background-color: #f9f9f9;
    padding: 20px;
    border-left: 4px solid #000;
    transition: background-color 0.3s ease;
}

.option-section:hover {
    background-color: #f0f0f0;
}

.option-section h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.mode-buttons, .difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mode-btn, .mp-difficulty-btn {
    padding: 12px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background-color: #fff;
    border: 1px solid #ddd;
    color: #666;
}

.mode-btn:hover, .mp-difficulty-btn:hover {
    background-color: #f5f5f5;
    border-color: #999;
}

.mode-btn.active, .mp-difficulty-btn.active {
    background-color: #000;
    color: #fff;
    border-color: #000;
}

#create-room-btn {
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    font-size: 1rem;
}

#join-room-section {
    margin-top: 20px;
    text-align: center;
}

.room-link-container {
    display: flex;
    margin-top: 15px;
}

.room-link-container input {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid #ddd;
    font-size: 0.9rem;
}

.room-link-container button {
    padding: 12px 20px;
    margin-left: -1px;
    font-size: 0.9rem;
}

#players-count-section {
    text-align: center;
}

#players-count {
    width: 100%;
    margin: 15px 0;
}

#multiplayer-modal .modal-content {
    max-width: 700px;
    width: 90%;
    padding: 40px;
}

#multiplayer-modal h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    letter-spacing: -1px;
}

@media (max-width: 600px) {
    .mode-buttons, .difficulty-buttons {
        grid-template-columns: 1fr 1fr;
    }
    
    #multiplayer-modal .modal-content {
        padding: 20px;
    }
}

/* Game Room Styling */
.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.timer {
    background-color: #000;
    color: #fff;
    padding: 8px 15px;
    font-weight: bold;
    letter-spacing: 1px;
    animation: pulse 1s infinite;
}

.timer.warning {
    background-color: #f39c12;
}

.timer.critical {
    background-color: #e74c3c;
    animation: timerWarning 0.5s infinite;
}

.timer.story-timer {
    background-color: #3498db; 
    color: #fff;
}

@keyframes timerWarning {
    0% { background-color: #e74c3c; }
    50% { background-color: #c0392b; }
    100% { background-color: #e74c3c; }
}

.rule {
    background-color: #f39c12;
    color: #fff;
    padding: 8px 15px;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: -40px;
}

.waiting-players {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.player-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
    position: relative;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-name {
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-link-container {
    display: flex;
    margin: 15px 0;
    height: 48px;
}

.room-link-container input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    font-family: 'Space Mono', monospace;
    height: 100%;
    margin-right: 0;
    vertical-align: top;
}

.room-link-container button {
    padding: 10px 15px;
    background: #000;
    color: #fff;
    border: 1px solid #000;
    cursor: pointer;
    font-family: 'Space Mono', monospace;
    height: 100%;
    margin-left: 0;
    vertical-align: top;
}

/* Players Container */
#players-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.player-card {
    flex: 1;
    min-width: 200px;
    border: 1px solid #ddd;
    padding: 15px;
    position: relative;
}

.player-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.small-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
}

.small-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-excuse {
    background-color: #f9f9f9;
    padding: 10px;
    margin-top: 10px;
    border-left: 3px solid #000;
    font-style: italic;
}

.player-score {
    margin-top: 10px;
    font-weight: bold;
    text-align: right;
}

/* Leaderboard */
#leaderboard-content {
    margin: 20px 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.3s;
}

.leaderboard-item:hover {
    background-color: #f9f9f9;
}

.leaderboard-rank {
    font-size: 1.5rem;
    font-weight: bold;
    width: 40px;
}

.leaderboard-player {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.leaderboard-score {
    font-size: 1.2rem;
    font-weight: bold;
}

.expanded-content {
    padding: 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #eee;
    display: none;
}

.expanded-content.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* Animation for timer */
@keyframes timerWarning {
    0% { background-color: #e74c3c; }
    50% { background-color: #c0392b; }
    100% { background-color: #e74c3c; }
}

.timer.critical {
    animation: timerWarning 0.5s infinite;
}

.critical-question {
    color: #e74c3c;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    background-color: rgba(231, 76, 60, 0.1);
    display: inline-block;
    margin-top: 10px;
}

#ending-content {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 0;
    margin-bottom: 25px;
    border-left: 4px solid #000;
    min-height: 100px;
    animation: fadeIn 0.5s ease-out;
    transition: all 0.3s ease;
}

#mp-excuse-input-container {
    margin: 20px 0;
}

#mp-excuse-input {
    width: 100%;
    height: 120px;
    padding: 15px;
    margin: 15px 0;
    border-radius: 0;
    border: 1px solid #ddd;
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    resize: vertical;
    transition: border 0.3s ease;
}

#story-creator-container {
    margin: 20px 0;
    padding: 20px;
    background-color: #f5f5f5;
    border-left: 3px solid #3498db;
}

#creator-story-input {
    width: 100%;
    height: 150px;
    padding: 15px;
    margin: 15px 0;
    border-radius: 0;
    border: 1px solid #ddd;
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    resize: vertical;
}

.story-ending {
    background-color: #f9f9f9;
    padding: 15px;
    margin: 15px 0;
    border-left: 4px solid #000;
}

.story-ending h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.story-ending-content {
    font-style: italic;
}

/* Media Queries */
@media (max-width: 768px) {
    .mode-buttons, .difficulty-buttons {
        flex-direction: column;
    }
    
    .player-card {
        min-width: 100%;
    }
}

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

.leave-room-waiting-btn {
    margin-top: 15px;
    width: 100%;
    padding: 12px;
    background-color: #e74c3c;
    transition: background-color 0.3s ease;
}

.leave-room-waiting-btn:hover {
    background-color: #c0392b;
}

.leave-room-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1px;
    font-family: 'Space Mono', monospace;
    transition: all 0.3s;
    position: absolute;
    top: 15px;
    right: 20px;
}

.leave-room-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

.mode-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.mode-description {
    font-size: 0.7rem;
    color: #666;
    margin-top: 5px;
    max-width: 100%;
    opacity: 0.7;
    line-height: 1.3;
    text-align: center;
}

.mode-btn.active .mode-description {
    color: #fff;
    opacity: 0.8;
}

@media (max-width: 600px) {
    .mode-description {
        font-size: 0.6rem;
    }
}

/* Multiplayer Lobby Improvements */
.lobby-container {
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 0;
    margin: 15px 0;
}

.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.lobby-settings {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.setting-item {
    background-color: #f5f5f5;
    padding: 12px;
    border-left: 3px solid #000;
}

.setting-label {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.setting-value {
    font-size: 1.1rem;
}

.setting-edit {
    cursor: pointer;
    color: #3498db;
    font-size: 0.8rem;
    margin-left: 5px;
}

.setting-edit:hover {
    text-decoration: underline;
}

.setting-options {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.setting-option-btn {
    flex: 1;
    padding: 5px;
    font-size: 0.8rem;
    background: #fff;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #000;
}

.setting-option-btn:hover {
    background: #f0f0f0;
}

.setting-option-btn.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

.timer-input-container {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.timer-input {
    width: 60px;
    padding: 5px;
    text-align: center;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.player-card-lobby {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 0;
    transition: transform 0.2s ease;
}

.player-card-lobby:hover {
    transform: translateY(-5px);
}

.player-avatar-lobby {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 10px;
    border: 2px solid #000;
}

.player-avatar-lobby img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-name-lobby {
    font-weight: bold;
    text-align: center;
    margin-bottom: 5px;
}

.host-badge {
    background-color: #000;
    color: #fff;
    padding: 3px 6px;
    font-size: 0.7rem;
    border-radius: 3px;
    margin-top: 5px;
}

/* Chat system styles */
.chat-container {
    height: 300px;
    background-color: #fff;
    border: 1px solid #ddd;
    margin: 15px 0;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.chat-message {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 0;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

.chat-message.own {
    background-color: #f0f0f0;
    margin-left: auto;
    border-left: 3px solid #000;
}

.chat-message.other {
    background-color: #f9f9f9;
    margin-right: auto;
    border-right: 3px solid #000;
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.message-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 5px;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-username {
    font-weight: bold;
    font-size: 0.8rem;
}

.message-time {
    font-size: 0.7rem;
    margin-left: 5px;
    color: #666;
}

.message-content {
    font-size: 0.9rem;
    word-break: break-word;
}

.chat-input-container {
    display: flex;
    border-top: 1px solid #ddd;
    padding: 5px 10px;
    height: 40px;
}

.chat-input {
    flex: 1;
    padding: 5px;
    border: 1px solid #ddd;
    border-right: none;
    height: 28px;
    font-size: 0.8rem;
    align-self: center;
}

.chat-send-btn {
    padding: 5px 10px;
    background: #000;
    color: #fff;
    border: 1px solid #000;
    cursor: pointer;
    height: 28px;
    font-size: 0.8rem;
    align-self: center;
    margin-left: 5px;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .lobby-settings {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .lobby-settings {
        grid-template-columns: 1fr;
    }
}

#join-room-btn {
    transition: none;
    margin: 0;
    padding: 8px 15px;
    height: 100%;
}

#join-room-btn:hover {
    transform: none;
}

.story-timer {
    background-color: #3498db; 
    color: #fff;
    padding: 8px 15px;
    font-weight: bold;
    letter-spacing: 1px;
    animation: pulse 1s infinite;
}

.story-timer-warning {
    background-color: #2980b9; 
}

@keyframes storyTimerWarning {
    0% { background-color: #3498db; }
    50% { background-color: #2980b9; }
    100% { background-color: #3498db; }
}

.story-timer.story-timer-critical {
    animation: storyTimerWarning 0.5s infinite;
}

/* Room privacy styling */
.privacy-selector {
    margin-top: 15px;
}

.privacy-selector h4 {
    margin-bottom: 10px;
    font-weight: 600;
}

.privacy-buttons {
    display: flex;
    gap: 10px;
}

.privacy-btn {
    flex: 1;
    padding: 10px;
    background: #eee;
    color: #333;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-family: 'Space Mono', monospace;
}

.privacy-btn:hover {
    background: #ddd;
    transform: translateY(-2px);
}

.privacy-btn.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

.password-input {
    margin-top: 10px;
    display: none;
}

.password-input.visible {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

.password-input input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    font-family: 'Space Mono', monospace;
}

/* Room explore styling */
.explore-btn {
    width: 100%;
    margin: 15px 0;
    padding: 12px;
}

.rooms-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 15px 0;
}

.room-search {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    font-family: 'Space Mono', monospace;
}

.room-card {
    padding: 15px;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.room-card:hover {
    background-color: #f9f9f9;
    transform: translateY(-2px);
}

.room-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.room-avatars {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
}

.room-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
}

.room-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.room-details {
    font-size: 0.9rem;
    color: #555;
}

.room-details span {
    margin-right: 10px;
}

.password-required {
    float: right;
    background-color: #f0f0f0;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8rem;
}

.password-prompt {
    padding: 20px;
    background: #f5f5f5;
    margin: 15px 0;
}

.password-prompt h4 {
    margin-bottom: 10px;
}

.password-prompt input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
}

.password-prompt button {
    width: 100%;
    margin-top: 10px;
}

.btn-secondary {
    background-color: #555;
}

.btn-secondary:hover {
    background-color: #333;
}

.explore-container {
    display: none;
}

.explore-container.visible {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

.back-to-menu {
    background-color: #555;
    margin-bottom: 20px;
}

.back-to-menu:hover {
    background-color: #333;
}

.modal-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.modal-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    background: #f5f5f5;
    transition: all 0.3s ease;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.modal-tab:hover {
    background: #f0f0f0;
}

.modal-tab.active {
    background: #000;
    color: #fff;
}

.create-container,
.explore-container {
    min-height: 500px; 
}

.explore-container {
    display: none;
}

.explore-container.visible {
    display: block;
    animation: fadeIn 0.5s ease-out;
}