:root {
    --sherlock-blue: #3a5a9e;
    --moriarty-red: #8b2635;
    --dark-bg: #1a1a2e;
    --light-bg: #16213e;
    --card-bg: #0f3460;
    --text-light: #e8e8e8;
    --text-dark: #0a0a0a;
    --safe-cable: #4a4a4a;
    --defuse-cable: #2ecc71;
    --bomb-cable: #e74c3c;
    --border-radius: 12px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--light-bg) 100%);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Screens */
.screen {
    display: none;
    min-height: 100vh;
    padding: 10px;
}

.screen.active {
    display: block;
}

#welcomeScreen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Typography */
.title {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    background: linear-gradient(45deg, #ffd700, #ff8c00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.logo-img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.logo-img-small {
    height: 24px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
    vertical-align: middle;
    margin-right: 8px;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    opacity: 0.8;
}

.title-small {
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 15px;
    color: #ffd700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.version-info {
    text-align: center;
    margin-top: 20px;
    font-size: 0.75rem;
    opacity: 0.6;
    color: var(--text-light);
}

.welcome-layout {
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.welcome-left {
    flex: 0 0 400px;
    display: flex;
}

.welcome-right {
    flex: 0 0 500px;
    display: flex;
}

.welcome-left .card {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin: 0;
    max-width: none;
    padding: 30px 25px;
}

.welcome-left .card h2 {
    margin-bottom: 20px;
}

.welcome-left .card input {
    margin-bottom: 15px;
}

.changelog {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 300px);
    min-height: 300px;
}

.changelog h3 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: #ffd700;
    text-align: center;
    flex-shrink: 0;
}

.changelog-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    min-height: 0;
}

.changelog-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.changelog-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.changelog-version {
    font-size: 0.95rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.changelog-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.changelog-list {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.changelog-list li {
    font-size: 0.8rem;
    line-height: 1.6;
    margin-bottom: 5px;
    position: relative;
    color: rgba(255, 255, 255, 0.85);
}

.changelog-list li::before {
    content: "•";
    position: absolute;
    left: -15px;
    color: #667eea;
    font-weight: bold;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    margin: 0 auto;
}

.card h2 {
    margin-bottom: 15px;
    text-align: center;
    font-size: 1rem;
}

/* Buttons */
.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(58, 123, 213, 0.4);
}

.btn-secondary {
    background: #444;
    color: white;
}

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

.btn-large {
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-help {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #3498db;
    color: white;
    text-decoration: none;
    display: inline-block;
}

.btn-help:hover {
    background: #2980b9;
}

/* Input fields */
input[type="text"],
select {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: var(--light-bg);
    color: var(--text-light);
    font-size: 0.85rem;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
}

/* User info */
.user-info {
    text-align: center;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

/* Lobby */
.lobby-actions {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.lobby-actions .btn {
    flex: 0 0 auto;
}

.search-bar {
    flex: 1;
    min-width: 250px;
}

.search-bar input {
    margin-bottom: 0;
}

.room-list-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
}

.room-list-container h2 {
    margin-bottom: 20px;
}

.room-list {
    display: grid;
    gap: 15px;
}

.room-item {
    background: var(--light-bg);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s;
    cursor: pointer;
}

.room-item:hover {
    transform: translateX(5px);
    background: #1e2f50;
}

.room-item-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    flex: 1;
    min-width: 0;
}

.room-code {
    color: #ffd700;
    font-weight: bold;
    font-size: 0.9rem;
}

.room-separator {
    opacity: 0.4;
    font-size: 0.7rem;
}

.room-host {
    font-weight: 600;
}

.room-players-count {
    font-weight: 600;
}

.room-players-list {
    opacity: 0.7;
    font-size: 0.75rem;
}

.room-item .btn {
    padding: 6px 12px;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.empty-message {
    text-align: center;
    opacity: 0.6;
    padding: 40px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 1rem;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.85rem;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions .btn {
    flex: 1;
}

/* Room Screen */
.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.room-code {
    color: #ffd700;
    font-weight: bold;
    font-size: 1rem;
    letter-spacing: 2px;
}

.room-info {
    background: var(--card-bg);
    padding: 12px 15px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.room-info p {
    margin: 0;
    font-size: 0.75rem;
}

.room-info .composition-info {
    display: block;
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: 400;
    margin: 0;
    align-items: flex-start;
    gap: 0;
}

.players-waiting {
    background: var(--card-bg);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
}

.players-waiting h3 {
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.players-waiting ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.players-waiting li {
    padding: 6px 10px;
    background: var(--light-bg);
    border-radius: 6px;
    font-size: 0.8rem;
}

.player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.player-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.btn-kick, .btn-ban {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.btn-ban {
    background: #8b2635;
}

.btn-kick:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.btn-ban:hover {
    background: #6b1a28;
    transform: scale(1.1);
}

#startGameContainer {
    text-align: center;
    padding: 20px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
}

.info-text {
    margin-top: 10px;
    opacity: 0.7;
    font-size: 0.75rem;
}

/* Room Screen Layout (same as Game Screen) */
.room-container {
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    gap: 15px;
    height: calc(100vh - 20px);
    max-width: 1400px;
}

.room-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Game Screen */
.game-container {
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    gap: 15px;
    height: calc(100vh - 20px);
}

.game-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.game-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.announce-alerts {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
}

.announce-alert {
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

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

.announce-alert.too-many-defuse {
    background: rgba(231, 76, 60, 0.3);
    border: 1px solid #e74c3c;
    color: #ff6b6b;
}

.announce-alert.too-few-defuse {
    background: rgba(241, 196, 15, 0.3);
    border: 1px solid #f1c40f;
    color: #f39c12;
}

.announce-alert.correct-defuse {
    background: rgba(46, 204, 113, 0.3);
    border: 1px solid #2ecc71;
    color: #27ae60;
}

.announce-alert.no-bomb {
    background: rgba(155, 89, 182, 0.3);
    border: 1px solid #9b59b6;
    color: #c39bd3;
}

.announce-alert.too-many-bombs {
    background: rgba(231, 76, 60, 0.3);
    border: 1px solid #e74c3c;
    color: #ff6b6b;
}

.announce-alert.correct-bomb {
    background: rgba(46, 204, 113, 0.3);
    border: 1px solid #2ecc71;
    color: #27ae60;
}

.game-info {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.round-info,
.defuse-info,
.announce-info,
.composition-info {
    background: var(--card-bg);
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.announce-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}

/* Turn Indicator */
.turn-indicator {
    text-align: center;
    padding: 8px;
    background: var(--card-bg);
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.turn-indicator.your-turn {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    animation: pulse 1.5s infinite;
}

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

/* Game Board */
.game-board {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    background: rgba(15, 52, 96, 0.3);
    border-radius: var(--border-radius);
    padding: 10px;
}

.cable-image {
    border-radius: 4px;
    transition: transform 0.2s;
}

.cable-image.clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.role-card {
    display: inline-block;
    padding: 10px 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.role-card.sherlock {
    background: linear-gradient(135deg, var(--sherlock-blue) 0%, #2c4570 100%);
}

.role-card.moriarty {
    background: linear-gradient(135deg, var(--moriarty-red) 0%, #5a1a22 100%);
}

.role-title {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.role-team {
    font-size: 1.3rem;
    font-weight: bold;
    text-transform: uppercase;
}

/* Players Grid */
.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.player-card {
    background: var(--card-bg);
    padding: 8px;
    border-radius: var(--border-radius);
    text-align: center;
}

.player-card.current-turn {
    border: 3px solid #f39c12;
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.3);
}

.player-card.is-you {
    border: 2px solid #667eea;
}

.player-card.can-cut {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border: 3px solid #f39c12;
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.5);
    animation: pulse 1.5s infinite;
    transition: all 0.3s ease;
}

.player-card.can-cut:hover {
    box-shadow: 0 0 30px rgba(243, 156, 18, 0.8);
    transform: translateY(-2px);
}

.player-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    gap: 8px;
}

.player-name {
    font-size: 0.9rem;
    font-weight: bold;
    text-align: left;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.defuse-found-badge {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    box-shadow: 0 2px 6px rgba(46, 204, 113, 0.4);
    flex-shrink: 0;
}

.player-announcements {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.defuse-announce {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.85rem;
    font-weight: 600;
}

.announce-svg {
    width: 16px;
    height: 16px;
}

.bomb-svg {
    width: 20px;
    height: 20px;
}

.player-cables {
    display: flex;
    gap: 3px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 5px;
}

.cable-back {
    width: 40px;
    height: 60px;
    background: linear-gradient(135deg, #8b4513 0%, #654321 100%);
    border: 2px solid #4a2f1a;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
}

.cable-back::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 44px;
    background: linear-gradient(to bottom, #2ecc71 0%, #27ae60 100%);
    border-radius: 2px;
}

.cable-back:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.cable-back.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.cable-back.disabled:hover {
    transform: none;
}

/* Your Hand */
.your-hand {
    display: flex;
    gap: 15px;
    align-items: center;
    background: var(--card-bg);
    padding: 12px;
    border-radius: var(--border-radius);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
}

.hand-role {
    flex-shrink: 0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.hand-composition {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
}

.hand-composition .composition-line {
    background: var(--card-bg);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.hand-cables {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hand-announcements {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex-shrink: 0;
}

.announcement-section.needs-announcement {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.6);
    animation: pulse 1.5s infinite;
}

@keyframes defusePulse {
    0%, 100% {
        background: linear-gradient(135deg, rgba(243, 156, 18, 0.3) 0%, rgba(230, 126, 34, 0.3) 100%);
        box-shadow: 0 0 10px rgba(243, 156, 18, 0.3);
    }
    50% {
        background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
        box-shadow: 0 0 20px rgba(243, 156, 18, 0.6);
    }
}

.announcement-section {
    background: var(--light-bg);
    padding: 8px 12px;
    border-radius: 6px;
}

.announcement-section label {
    display: block;
    font-size: 0.75rem;
    margin-bottom: 5px;
    opacity: 0.8;
    font-weight: 600;
}

.announcement-buttons {
    display: flex;
    gap: 4px;
}

.btn-announce {
    padding: 4px 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: var(--card-bg);
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-announce:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.btn-announce.active {
    background: #667eea;
    border-color: #667eea;
}

.btn-announce.btn-reset {
    background: #555;
}

.btn-announce.btn-reset:hover {
    background: #666;
}

.cables-container {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.cable-card {
    width: 45px;
    height: 70px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.cable-card.safe {
    background: linear-gradient(135deg, #8b4513 0%, #654321 100%);
}

.cable-card.defuse {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.cable-card.bomb {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.cable-wire {
    width: 5px;
    height: 55px;
    border-radius: 2px;
}

.cable-wire.safe {
    background: linear-gradient(to bottom, #555 0%, #333 100%);
}

.cable-wire.defuse {
    background: linear-gradient(to bottom, #2ecc71 0%, #27ae60 100%);
}

.cable-wire.bomb {
    background: linear-gradient(to bottom, #ff6b6b 0%, #ee5a6f 100%);
}


/* New Round Modal */
.round-modal {
    background: rgba(0, 0, 0, 0.9);
}

.round-modal-content-enhanced {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--light-bg) 100%);
    padding: 25px 35px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease-out;
    max-width: 450px;
}

.round-modal-content-enhanced h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #ffd700;
}

.round-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
}

.round-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.round-stat-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.round-stat-value {
    font-weight: 700;
    font-size: 1rem;
    color: #ffd700;
}

.round-last-cable {
    font-size: 0.9rem;
    margin: 10px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border-left: 3px solid #3498db;
    font-weight: 600;
    color: #e8e8e8;
}

.round-message {
    font-size: 0.85rem;
    opacity: 0.7;
    font-style: italic;
    margin: 0;
}

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

/* Game Over - Compact */
.game-over-content-compact {
    text-align: center;
    max-width: 600px;
}

.game-over-content-compact h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.game-over-message {
    font-size: 0.95rem;
    margin: 12px 0;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
}

.game-over-message.sherlock-win {
    background: var(--sherlock-blue);
}

.game-over-message.moriarty-win {
    background: var(--moriarty-red);
}

.players-reveal-compact {
    margin: 20px 0;
}

.players-reveal-compact h3 {
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.players-reveal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.player-reveal-item {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.player-reveal-item.sherlock {
    background: rgba(58, 90, 158, 0.4);
}

.player-reveal-item.moriarty {
    background: rgba(139, 38, 53, 0.4);
}

.player-reveal-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-reveal-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.waiting-players-info {
    margin: 15px 0;
    padding: 12px;
    background: rgba(241, 196, 15, 0.2);
    border: 1px solid #f1c40f;
    border-radius: 8px;
    text-align: center;
}

.waiting-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f39c12;
    margin: 0 0 8px 0;
}

.waiting-players-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.waiting-player-name {
    background: rgba(241, 196, 15, 0.3);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #f1c40f;
}

#backToLobbyBtn {
    margin: 15px auto 0;
    display: block;
}

/* Side Panel (Logs + Chat) */
.side-panel {
    width: 250px;
    display: none;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    height: 100%;
}

.side-panel.active {
    display: flex;
}

#sidePanelContainer,
#gameSidePanelContainer {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Game Logs */
.game-logs {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.game-logs h4 {
    background: linear-gradient(135deg, #5a6c7d 0%, #4a5a6a 100%);
    padding: 8px 10px;
    margin: 0;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
}

.game-logs-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column-reverse;
    gap: 4px;
    min-height: 0;
}

.game-log-item {
    padding: 4px 6px;
    border-radius: 4px;
    background: var(--light-bg);
    font-size: 0.7rem;
    line-height: 1.3;
    animation: logSlide 0.2s ease-out;
    word-wrap: break-word;
}

.game-log-item.cable-cut {
    border-left: 3px solid #3498db;
}

.game-log-item.bomb-found {
    border-left: 3px solid #e74c3c;
}

.game-log-item.defuse-found {
    border-left: 3px solid #2ecc71;
}

.game-log-item.round-change {
    border-left: 3px solid #f39c12;
    font-weight: 600;
}

.game-log-item.player-join {
    border-left: 3px solid #2ecc71;
}

.game-log-item.player-leave {
    border-left: 3px solid #95a5a6;
}

.game-log-item.player-kick {
    border-left: 3px solid #e74c3c;
    font-weight: 600;
}

.game-log-item.player-ban {
    border-left: 3px solid #8b2635;
    font-weight: 600;
}

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

/* Chat Widget */
.chat-widget {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 8px 10px;
    margin: 0;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
}

.chat-header h4 {
    margin: 0;
    font-size: 0.8rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-message {
    padding: 4px 6px;
    border-radius: 4px;
    background: var(--light-bg);
    word-wrap: break-word;
    animation: messageSlide 0.2s ease-out;
}

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

.chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
    gap: 8px;
}

.chat-message-author {
    font-weight: 600;
    font-size: 0.7rem;
    color: #667eea;
    flex-shrink: 0;
}

.chat-message-text {
    font-size: 0.75rem;
    line-height: 1.3;
}

.chat-message-time {
    font-size: 0.6rem;
    opacity: 0.5;
    flex-shrink: 0;
}

.chat-input-container {
    display: flex;
    gap: 4px;
    padding: 6px;
    background: var(--light-bg);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.chat-input-container input {
    flex: 1;
    padding: 5px 8px;
    border: 2px solid transparent;
    border-radius: 4px;
    background: var(--card-bg);
    color: var(--text-light);
    font-size: 0.75rem;
    margin: 0;
}

.chat-input-container input:focus {
    outline: none;
    border-color: #667eea;
}

.chat-input-container .btn {
    padding: 5px 10px;
    font-size: 0.7rem;
    flex-shrink: 0;
}

/* Responsive - Large Screens */
@media (min-width: 1400px) {
    /* Increase player cards size */
    .players-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 15px;
    }

    .player-card {
        padding: 12px;
    }

    .player-name {
        font-size: 1.05rem;
    }

    .player-cables img {
        width: 38px !important;
        height: 72px !important;
    }

    /* Increase hand size */
    .your-hand {
        padding: 18px;
    }

    .hand-role img {
        height: 80px !important;
    }

    .cables-container img {
        width: 40px !important;
        height: 76px !important;
    }

    /* Larger announcement buttons */
    .announcement-section {
        padding: 10px 15px;
    }

    .announcement-section label {
        font-size: 0.85rem;
    }

    .btn-announce {
        padding: 6px 10px;
        font-size: 0.9rem;
    }

    /* Larger game info */
    .round-info,
    .defuse-info,
    .announce-info {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .turn-indicator {
        padding: 12px;
        font-size: 0.95rem;
    }
}

@media (min-width: 1600px) {
    /* Even bigger for very large screens */
    .players-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 20px;
    }

    .player-card {
        padding: 15px;
    }

    .player-name {
        font-size: 1.15rem;
    }

    .player-cables img {
        width: 45px !important;
        height: 85px !important;
    }

    .your-hand {
        padding: 22px;
        gap: 20px;
    }

    .hand-role img {
        height: 95px !important;
    }

    .cables-container {
        gap: 8px;
    }

    .cables-container img {
        width: 48px !important;
        height: 90px !important;
    }

    .announcement-section {
        padding: 12px 18px;
    }

    .announcement-section label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    .btn-announce {
        padding: 7px 12px;
        font-size: 0.95rem;
    }

    .round-info,
    .defuse-info,
    .announce-info {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .announce-svg {
        width: 18px;
        height: 18px;
    }

    .bomb-svg {
        width: 22px;
        height: 22px;
    }

    .turn-indicator {
        padding: 14px;
        font-size: 1rem;
    }

    .game-board {
        padding: 15px;
    }
}

@media (min-width: 1920px) {
    /* Maximum size for ultra-wide screens */
    .game-container {
        max-width: 1800px;
        margin: 0 auto;
    }

    .players-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 25px;
    }

    .player-card {
        padding: 18px;
    }

    .player-name {
        font-size: 1.25rem;
    }

    .defuse-announce {
        font-size: 1rem;
    }

    .player-cables img {
        width: 52px !important;
        height: 98px !important;
    }

    .your-hand {
        padding: 25px;
        gap: 25px;
    }

    .hand-role img {
        height: 110px !important;
    }

    .cables-container {
        gap: 10px;
    }

    .cables-container img {
        width: 55px !important;
        height: 104px !important;
    }

    .announcement-section {
        padding: 15px 20px;
    }

    .announcement-section label {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }

    .btn-announce {
        padding: 8px 14px;
        font-size: 1rem;
    }

    .round-info,
    .defuse-info,
    .announce-info {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .announce-svg {
        width: 20px;
        height: 20px;
    }

    .bomb-svg {
        width: 24px;
        height: 24px;
    }

    .turn-indicator {
        padding: 16px;
        font-size: 1.1rem;
    }

    .game-board {
        padding: 20px;
    }

    .side-panel {
        width: 300px;
    }

    .game-logs h4,
    .chat-header h4 {
        font-size: 0.9rem;
        padding: 10px 12px;
    }

    .game-log-item {
        font-size: 0.8rem;
        padding: 6px 8px;
    }

    .chat-message {
        padding: 6px 8px;
    }

    .chat-message-author {
        font-size: 0.8rem;
    }

    .chat-message-text {
        font-size: 0.85rem;
    }
}

/* Responsive - Small Screens */
@media (max-width: 768px) {
    /* General adjustments */
    body {
        font-size: 14px;
    }

    .screen {
        padding: 5px;
    }

    .container {
        padding: 0 5px;
    }

    /* Welcome screen - Stack vertically */
    .logo {
        font-size: 1.8rem;
    }

    .logo-img {
        height: 30px;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .welcome-layout {
        flex-direction: column;
        gap: 15px;
    }

    .welcome-left,
    .welcome-right {
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
    }

    .welcome-left .card {
        padding: 20px 15px;
    }

    .changelog {
        max-height: 300px;
        min-height: 200px;
        padding: 15px;
    }

    .changelog h3 {
        font-size: 0.9rem;
    }

    .changelog-list li {
        font-size: 0.75rem;
    }

    /* Lobby screen */
    .title-small {
        font-size: 1rem;
    }

    .logo-img-small {
        height: 20px;
    }

    .lobby-actions {
        flex-direction: column;
        gap: 10px;
    }

    .lobby-actions .btn {
        width: 100%;
    }

    .search-bar {
        width: 100%;
        min-width: 100%;
    }

    /* Room list items - Stack vertically on mobile */
    .room-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
    }

    .room-item-info {
        width: 100%;
        flex-wrap: wrap;
        font-size: 0.75rem;
    }

    .room-code {
        font-size: 0.85rem;
    }

    .room-actions {
        width: 100%;
        flex-direction: row;
        gap: 8px;
    }

    .room-actions .btn {
        flex: 1;
        font-size: 0.7rem;
        padding: 8px 10px;
    }

    .status-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    /* Room screen - Adjust header */
    .room-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .room-header h2 {
        font-size: 0.95rem;
    }

    .room-header > div {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .room-info {
        flex-direction: column;
        gap: 8px;
        padding: 10px;
    }

    .room-info p {
        font-size: 0.8rem;
    }

    .players-waiting {
        padding: 12px;
    }

    .players-waiting h3 {
        font-size: 0.85rem;
    }

    .players-waiting ul {
        grid-template-columns: 1fr;
    }

    /* Game screen - Major improvements */
    .game-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        gap: 8px;
        padding: 5px;
    }

    .game-main {
        flex: 0 1 auto;
        min-height: auto;
        display: flex;
        flex-direction: column;
        overflow-y: visible;
    }

    .game-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 8px;
        background: var(--card-bg);
        border-radius: 8px;
        margin-bottom: 8px;
    }

    .game-header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .game-info {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    .round-info,
    .defuse-info,
    .announce-info {
        font-size: 0.7rem;
        padding: 5px 10px;
    }

    .announce-alerts {
        width: 100%;
        justify-content: flex-start;
    }

    .announce-alert {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    .turn-indicator {
        font-size: 0.75rem;
        padding: 8px;
        margin-bottom: 8px;
    }

    /* Players grid - Single column on mobile */
    .players-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .player-card {
        padding: 10px;
    }

    .player-name {
        font-size: 0.85rem;
    }

    .player-cables img,
    .cable-image {
        width: 28px !important;
        height: 53px !important;
    }

    .defuse-announce {
        font-size: 0.75rem;
    }

    .announce-svg {
        width: 14px;
        height: 14px;
    }

    .bomb-svg {
        width: 18px;
        height: 18px;
    }

    /* Your hand - Role and cables side by side, announcements below */
    .your-hand {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 8px;
        padding: 10px;
        flex-shrink: 0;
        width: 100%;
        box-sizing: border-box;
    }

    /* First row: role + cables side by side */
    .hand-role {
        grid-column: 1;
        grid-row: 1;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding-right: 8px;
    }

    .hand-role img {
        height: 60px !important;
    }

    .hand-cables {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        min-width: 0;
    }

    .cables-container {
        display: flex;
        justify-content: flex-start;
        gap: 4px;
        flex-wrap: wrap;
    }

    .cables-container img {
        width: 30px !important;
        height: 58px !important;
    }

    /* Announcements below - spans both columns on row 2 */
    .hand-announcements {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 6px;
        flex-shrink: 0;
    }

    .announcement-section {
        padding: 6px 8px;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
    }

    .announcement-section label {
        font-size: 0.7rem;
        margin-bottom: 3px;
        display: block;
        text-align: left;
        font-weight: 600;
    }

    .announcement-buttons {
        gap: 3px;
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .btn-announce {
        padding: 5px 8px;
        font-size: 0.7rem;
        flex: 0 0 auto;
        min-width: 32px;
    }

    /* Game board - Better scrolling */
    .game-board {
        flex: 1 1 auto;
        overflow-y: auto;
        margin-bottom: 10px;
        max-height: 50vh;
    }

    /* Side panel - Stacked vertically on mobile */
    #gameSidePanelContainer {
        width: 100%;
        flex-shrink: 0;
    }

    .side-panel {
        width: 100%;
        height: auto;
        max-height: none;
        min-height: auto;
        flex-direction: column;
        gap: 10px;
        overflow: visible;
        display: flex !important;
    }

    .game-logs,
    .chat-widget {
        flex: 0 0 auto;
        width: 100%;
        min-height: 200px;
        max-height: 250px;
        overflow: hidden;
    }

    .game-logs-content {
        overflow-y: auto;
        max-height: 140px;
    }

    .chat-messages {
        overflow-y: auto;
        max-height: 140px;
    }

    .game-logs h4,
    .chat-header h4 {
        font-size: 0.75rem;
        padding: 6px 8px;
    }

    .game-logs-content,
    .chat-messages {
        font-size: 0.7rem;
    }

    .game-log-item {
        font-size: 0.65rem;
        padding: 3px 5px;
    }

    .chat-message {
        padding: 4px 6px;
    }

    .chat-message-author {
        font-size: 0.65rem;
    }

    .chat-message-text {
        font-size: 0.7rem;
    }

    .chat-input-container input {
        font-size: 0.7rem;
        padding: 4px 6px;
    }

    .chat-input-container .btn {
        font-size: 0.65rem;
        padding: 4px 8px;
    }

    /* Modals - Better sizing and positioning */
    .modal {
        padding: 20px 10px;
        align-items: center;
        justify-content: center;
    }

    .modal-content {
        width: 90%;
        max-width: 400px;
        padding: 20px 15px;
        max-height: 80vh;
        overflow-y: auto;
        margin: auto;
    }

    .modal-content h2 {
        font-size: 1rem;
        margin-bottom: 15px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-group label {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }

    input[type="text"],
    select {
        font-size: 0.85rem;
        padding: 10px 8px;
    }

    .btn {
        font-size: 0.8rem;
        padding: 10px 16px;
    }

    .modal-actions {
        margin-top: 15px;
    }

    /* Round modal */
    .round-modal-content-enhanced {
        padding: 20px;
        max-width: 90%;
    }

    .round-modal-content-enhanced h2 {
        font-size: 1.2rem;
    }

    .round-stat-item {
        font-size: 0.8rem;
    }

    .round-last-cable {
        font-size: 0.8rem;
        padding: 8px;
    }

    /* Game over modal */
    .game-over-content-compact {
        max-width: 95%;
    }

    .players-reveal-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .player-reveal-item {
        font-size: 0.75rem;
    }

    /* Spectator mode */
    .spectator-banner {
        font-size: 0.75rem;
        padding: 6px;
    }

    body.spectator-mode {
        padding-top: 30px;
    }

    /* Connection notifications */
    .connection-notification {
        font-size: 0.8rem;
        padding: 10px 15px;
        max-width: 90%;
    }

    .notification-icon {
        font-size: 1.2rem;
    }

    /* Room container layout */
    .room-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .room-main {
        width: 100%;
    }
}

/* Responsive - Very Small Screens (smartphones in portrait) */
@media (max-width: 480px) {
    /* Further reduce sizes for very small screens */
    .logo {
        font-size: 1.5rem;
    }

    .logo-img {
        height: 25px;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .title-small {
        font-size: 0.9rem;
    }

    /* Make room items even more compact */
    .room-item {
        padding: 10px;
    }

    .room-item-info {
        font-size: 0.7rem;
    }

    .room-code {
        font-size: 0.8rem;
    }

    .room-players-list {
        display: none; /* Hide full player list on very small screens */
    }

    /* Game screen adjustments */
    .game-header {
        padding: 6px;
    }

    .round-info,
    .defuse-info {
        font-size: 0.65rem;
        padding: 4px 8px;
    }

    .turn-indicator {
        font-size: 0.7rem;
        padding: 6px;
    }

    /* Reduce cable sizes even more */
    .player-cables img,
    .cable-image {
        width: 25px !important;
        height: 47px !important;
    }

    .cables-container img {
        width: 25px !important;
        height: 48px !important;
    }

    /* Compact announcements */
    .announcement-section {
        padding: 6px 8px;
    }

    .announcement-section label {
        font-size: 0.65rem;
    }

    .btn-announce {
        padding: 4px 6px;
        font-size: 0.7rem;
    }

    /* Side panel adjustments */
    .side-panel {
        max-height: 250px;
    }

    .game-logs,
    .chat-widget {
        min-height: 200px;
    }

    /* Defuse badge smaller */
    .defuse-found-badge {
        font-size: 0.65rem;
        padding: 1px 5px;
        min-width: 16px;
    }

    /* Announcements display */
    .player-announcements {
        gap: 4px;
    }

    .defuse-announce {
        font-size: 0.7rem;
    }

    .announce-svg {
        width: 12px;
        height: 12px;
    }

    .bomb-svg {
        width: 16px;
        height: 16px;
    }
}

/* Responsive - Tablet Portrait Mode */
@media (min-width: 481px) and (max-width: 768px) {
    /* Optimize for tablet portrait */
    .players-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .side-panel {
        max-height: 350px;
    }

    .game-logs,
    .chat-widget {
        min-height: 280px;
    }
}

/* Responsive - Landscape Mode on Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    /* Adjust for landscape orientation */
    .welcome-layout {
        flex-direction: row;
    }

    .welcome-left,
    .welcome-right {
        flex: 1;
    }

    .changelog {
        max-height: calc(100vh - 200px);
    }

    .game-container {
        flex-direction: row;
        height: calc(100vh - 10px);
    }

    .game-main {
        flex: 1;
        overflow-y: auto;
    }

    .side-panel {
        width: 250px;
        max-height: 100%;
        flex-direction: column;
    }

    .your-hand {
        flex-direction: row;
        padding: 8px;
    }

    .hand-role img {
        height: 45px !important;
    }

    .cables-container img {
        width: 24px !important;
        height: 46px !important;
    }

    .announcement-section {
        padding: 6px 8px;
    }

    .btn-announce {
        padding: 4px 6px;
        font-size: 0.7rem;
    }
}

/* Volume Slider */
.volume-slider {
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: linear-gradient(to right, var(--sherlock-blue) 0%, var(--sherlock-blue) 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-light);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: all 0.15s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    background: #ffffff;
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-light);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    border: none;
    transition: all 0.15s ease;
}

.volume-slider::-moz-range-thumb:hover {
    background: #ffffff;
    transform: scale(1.2);
}

/* Connection Notifications */
.connection-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    animation: slideDown 0.3s ease-out;
    font-weight: 600;
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.connection-notification.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

.connection-notification.reconnecting {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.95) 0%, rgba(243, 156, 18, 0.95) 100%);
    color: var(--text-dark);
    border: 2px solid #f39c12;
}

.connection-notification.reconnecting .notification-icon {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.connection-notification.success {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.95) 0%, rgba(39, 174, 96, 0.95) 100%);
    color: white;
    border: 2px solid #27ae60;
}

.connection-notification.warning {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.95) 0%, rgba(192, 57, 43, 0.95) 100%);
    color: white;
    border: 2px solid #c0392b;
}

.connection-notification.error {
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.95) 0%, rgba(139, 38, 53, 0.95) 100%);
    color: white;
    border: 2px solid #8b2635;
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
}

/* Connection status styles for game logs */
.game-log-item.connection-lost {
    border-left: 3px solid #f39c12;
    background: rgba(241, 196, 15, 0.15);
    font-weight: 600;
}

.game-log-item.connection-restored {
    border-left: 3px solid #2ecc71;
    background: rgba(46, 204, 113, 0.15);
    font-weight: 600;
}

.game-log-item.player-disconnected {
    border-left: 3px solid #e67e22;
    background: rgba(230, 126, 34, 0.15);
    font-style: italic;
}

.game-log-item.player-reconnected {
    border-left: 3px solid #2ecc71;
    background: rgba(46, 204, 113, 0.15);
    font-weight: 600;
}

/* ============================================
   SPECTATOR MODE STYLES
   ============================================ */

/* Spectator banner */
.spectator-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Adjust body when spectator mode is active */
body.spectator-mode {
    padding-top: 40px;
}

/* Status badges for rooms */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    margin-left: 8px;
}

.status-badge.waiting {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.4);
}

.status-badge.in-progress {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Room item styles for in-progress games */
.room-item.in-progress {
    border-left: 3px solid #2ecc71;
    background: linear-gradient(90deg, rgba(46, 204, 113, 0.1) 0%, transparent 100%);
}

/* Room actions container */
.room-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Spectator button */
.btn-spectator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-spectator:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-spectator:active {
    transform: translateY(0);
}

/* Spectator view for player cards */
.player-card.spectator-view {
    opacity: 0.95;
}

.player-card.spectator-view .cable-image {
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Game log items for spectator events */
.game-log-item.spectator,
.game-log-item.spectator-join,
.game-log-item.spectator-leave {
    border-left: 3px solid #667eea;
    background: rgba(102, 126, 234, 0.15);
}

/* Disable interactions in spectator mode */
.spectator-mode .btn-announce {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.spectator-mode .cable-image.clickable {
    cursor: not-allowed !important;
    pointer-events: none;
    opacity: 0.9;
}

/* Hide certain UI elements in spectator mode */
.spectator-mode #defuseAnnouncementSection,
.spectator-mode #bombAnnouncementSection {
    display: none !important;
}

/* Spectator info badge */
.spectator-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    margin-left: 10px;
}

/* Adjust game screen layout for spectator */
.spectator-mode .game-screen {
    padding-top: 50px;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .spectator-banner {
        font-size: 12px;
        padding: 8px;
    }

    body.spectator-mode {
        padding-top: 35px;
    }

    .room-actions {
        flex-direction: column;
        width: 100%;
    }

    .room-actions .btn {
        width: 100%;
    }

    .status-badge {
        font-size: 0.75em;
        padding: 3px 8px;
    }
}
