:root {
    --primary: #ff4757;
    --primary-dark: #e84118;
    --secondary: #2f3542;
    --bg: #1e272e;
    --text: #f1f2f6;
    --accent: #5352ed;
    --card-bg: #2f3640;
    --success: #2ed573;
    --danger: #ff6b6b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg);
    color: var(--text);
    height: 100vh; /* Fallback */
    height: 100dvh; /* Dynamic viewport height for mobile */
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

#app {
    width: 100%;
    max-width: 500px;
    height: 100%;
    position: relative;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.screen {
    display: none;
    flex-direction: column;
    height: 100%;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    scroll-behavior: smooth;
}

/* Custom scrollbar for mobile and desktop - Beautiful styling */
.screen::-webkit-scrollbar {
    width: 10px;
}

.screen::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin: 10px 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.screen::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, 
        var(--primary) 0%, 
        var(--accent) 50%,
        var(--primary) 100%);
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1),
                0 0 10px rgba(255, 71, 87, 0.3);
    transition: background 0.3s ease;
}

.screen::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, 
        var(--primary-dark) 0%, 
        var(--primary) 50%,
        var(--primary-dark) 100%);
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.2),
                0 0 15px rgba(255, 71, 87, 0.5);
}

.screen::-webkit-scrollbar-thumb:active {
    background: var(--primary);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.3),
                0 0 20px rgba(255, 71, 87, 0.7);
}

/* Firefox scrollbar */
.screen {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(0, 0, 0, 0.2);
    scroll-snap-type: y proximity; /* Custom scroll frames for mobile */
}

/* Scroll snap points for smooth mobile scrolling */
.screen > * {
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* Smooth scroll fade indicators */
.screen::before,
.screen::after {
    content: '';
    position: sticky;
    height: 20px;
    z-index: 10;
    pointer-events: none;
    display: block;
}

.screen::before {
    top: 0;
    background: linear-gradient(180deg, var(--bg) 0%, transparent 100%);
}

.screen::after {
    bottom: 0;
    background: linear-gradient(0deg, var(--bg) 0%, transparent 100%);
}

#waiting-screen {
    padding: 0;
    overflow: hidden;
}

.screen.active {
    display: flex;
}

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

/* Headers */
h1 {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary);
    letter-spacing: 4px;
    font-weight: 800;
    text-shadow: 0 4px 10px rgba(255, 71, 87, 0.2);
}

h2 {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 12px 16px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.game-header {
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin-bottom: 1rem;
    justify-content: space-between;
    width: 100%;
}

.round-badge {
    background: var(--card-bg);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.1);
}

#round-display {
    color: var(--primary);
    font-size: 1.1rem;
    margin-left: 4px;
}

.opponents-info {
    font-size: 0.9rem;
    color: #a4b0be;
    font-weight: 600;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

/* Settings Screen */
.settings-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.setting-group label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: #a4b0be;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    text-align: center;
}

.number-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.num-btn {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    border: 2px solid var(--secondary);
    background: var(--card-bg);
    color: #747d8c;
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.num-btn:hover {
    border-color: var(--primary);
    background: rgba(255, 71, 87, 0.1);
}

.num-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

.toggle-options {
    display: flex;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 16px;
    gap: 15px;
}

.toggle-options.vertical {
    flex-direction: column;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.toggle-switch {
    width: 50px;
    height: 28px;
    background: var(--secondary);
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: 0.3s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: 0.3s;
}

.toggle-switch.active {
    background: var(--success);
}

.toggle-switch.active::after {
    left: 25px;
}

/* Controls */
input, textarea {
    width: 100%;
    background: var(--card-bg);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 16px;
    color: var(--text);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    transition: 0.3s;
}

input::placeholder, textarea::placeholder {
    color: rgba(241, 242, 246, 0.4);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #363d48;
    box-shadow: 0 0 0 4px rgba(255, 71, 87, 0.1);
}

textarea {
    resize: none;
    height: 110px;
}

.btn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn:active {
    transform: scale(0.96);
}

.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

.secondary {
    background: var(--secondary);
    color: var(--text);
}

.accent {
    background: linear-gradient(135deg, #a55eea, #45aaf2);
    color: white;
}

.small {
    width: auto;
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 12px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.3rem;
    background: var(--card-bg);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.danger {
    background: var(--danger);
    color: white;
}

/* Landing */
#landing-screen {
    justify-content: center;
    text-align: center;
}

.landing-text {
    color: #a4b0be;
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}

.name-container {
    margin-bottom: 2rem;
}

#username-input {
    text-align: center;
    font-weight: 800;
    letter-spacing: 1px;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    width: 100%;
}

.divider {
    text-align: center;
    color: #747d8c;
    font-weight: bold;
    font-size: 0.9rem;
    position: relative;
    padding: 10px 0;
}

.join-container {
    display: flex;
    gap: 10px;
    width: 100%;
}

#room-code-input {
    text-align: center;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 0;
    flex: 2;
}

#join-btn {
    flex: 1;
    padding: 0;
}

/* Waiting */
.centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex: 1;
    text-align: center;
    padding-bottom: 30px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.waiting-content {
    padding: 20px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.count-badge {
    background: var(--secondary);
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #a4b0be;
    font-size: 0.9rem;
}

.loader {
    width: 60px;
    height: 60px;
    border: 6px solid var(--secondary);
    border-top: 6px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 2rem;
    margin-left: auto;
    margin-right: auto;
}

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

.player-list {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.player-item {
    background: var(--card-bg);
    padding: 14px 20px;
    border-radius: 16px;
    font-weight: 600;
    animation: fadeIn 0.3s;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.role-badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800;
}

/* Room Code Hero Display */
.waiting-header {
    margin-bottom: 1.5rem;
    padding: 12px 16px;
    justify-content: space-between;
    align-items: center;
}

.room-code-in-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.code-label-top {
    font-size: 0.7rem;
    color: #a4b0be;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    margin-bottom: 6px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.code-value-hero {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--primary);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Courier New', monospace;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.lobby-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.lobby-settings-display {
    background: var(--card-bg);
    padding: 15px 20px;
    border-radius: 12px;
    margin-top: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    width: 100%;
}

.lobby-settings-display .setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.9rem;
    color: #a4b0be;
}

.lobby-settings-display .setting-item strong {
    color: var(--text);
}

.timer-selector {
    display: flex;
    justify-content: center;
}

.timer-select {
    width: 100%;
    background: var(--card-bg);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.timer-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 71, 87, 0.1);
}

.timer-display-container {
    margin-bottom: 15px;
}

.timer-display {
    background: var(--card-bg);
    padding: 12px 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--primary);
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.2);
}

#timer-display-container .timer-display {
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
}

#timer-value {
    font-weight: 800;
    font-size: 1.3rem;
    font-family: 'Courier New', monospace;
    transition: color 0.3s;
}

/* Voters Progress */
.voters-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 15px;
}

.voter-chip {
    font-size: 0.8rem;
    padding: 4px 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #a4b0be;
    transition: 0.3s;
}

.voter-chip.voted {
    background: var(--success);
    color: #1e272e;
    font-weight: bold;
}

/* Game Screens */
.view {
    display: none;
    flex-direction: column;
    flex: 1;
    padding-top: 10px;
}

.view.active {
    display: flex;
}

/* Creator Choice */
.choice-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 30px;
}

.choice-card {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 25px 30px;
    font-size: 1.2rem;
    gap: 25px;
    border: 3px solid rgba(255,255,255,0.1);
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(47, 54, 64, 0.5) 100%);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.choice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.choice-card:hover::before {
    left: 100%;
}

.choice-card .text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 5px;
    flex: 1;
}

.choice-card .text span {
    font-weight: 700;
    line-height: 1.2;
    font-size: 1.3rem;
    letter-spacing: 1px;
}

.choice-card .text small {
    font-size: 0.85rem;
    font-weight: 400;
    color: #a4b0be;
    text-transform: none;
    line-height: 1.4;
}

.choice-card .icon {
    font-size: 2.5rem;
    background: rgba(255,255,255,0.15);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    flex-shrink: 0;
    transition: all 0.3s;
    border: 2px solid rgba(255,255,255,0.1);
}

.choice-card .icon i {
    color: var(--primary);
    font-size: 2rem;
}

.choice-card.secondary .icon i {
    color: var(--primary);
}

.choice-card.accent .icon i {
    color: var(--primary);
}

.choice-card.vote-person .icon i {
    color: var(--primary);
}

.choice-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.3);
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.1) 0%, rgba(47, 54, 64, 0.7) 100%);
}

.choice-card:hover .icon {
    background: rgba(255, 71, 87, 0.2);
    border-color: var(--primary);
    transform: scale(1.1) rotate(5deg);
}

.choice-card:hover .text small {
    color: var(--text);
}

.choice-card.secondary:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 25px rgba(83, 82, 237, 0.3);
    background: linear-gradient(135deg, rgba(83, 82, 237, 0.1) 0%, rgba(47, 54, 64, 0.7) 100%);
}

.choice-card.secondary:hover .icon {
    background: rgba(83, 82, 237, 0.2);
    border-color: var(--accent);
}

.choice-card.accent:hover {
    border-color: #45aaf2;
    box-shadow: 0 8px 25px rgba(69, 170, 242, 0.3);
    background: linear-gradient(135deg, rgba(69, 170, 242, 0.1) 0%, rgba(47, 54, 64, 0.7) 100%);
}

.choice-card.accent:hover .icon {
    background: rgba(69, 170, 242, 0.2);
    border-color: #45aaf2;
}

.choice-card.vote-person {
    background: linear-gradient(135deg, rgba(255, 184, 0, 0.1) 0%, rgba(47, 54, 64, 0.5) 100%);
}

.choice-card.vote-person:hover {
    border-color: #ffb800;
    box-shadow: 0 8px 25px rgba(255, 184, 0, 0.3);
    background: linear-gradient(135deg, rgba(255, 184, 0, 0.15) 0%, rgba(47, 54, 64, 0.7) 100%);
}

.choice-card.vote-person:hover .icon {
    background: rgba(255, 184, 0, 0.2);
    border-color: #ffb800;
}

.input-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 1.5rem;
}

.input-header h2 {
    margin-bottom: 0;
}

.input-header #back-choice-btn {
    position: absolute;
    left: 0;
}

.vs {
    text-align: center;
    font-weight: 800;
    font-size: 1.5rem;
    margin: 10px 0;
    color: var(--accent);
}

.vs-small {
    text-align: center;
    font-weight: 800;
    font-size: 1rem;
    margin: 10px 0;
    color: #747d8c;
    opacity: 0.5;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.option-btn {
    background: var(--card-bg);
    color: var(--text);
    min-height: 140px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: pre-wrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    font-size: 1.2rem;
    line-height: 1.4;
    text-transform: none;
    border: 2px solid transparent;
}

.option-btn:hover, .option-btn:active {
    background: #363d48;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Photo Mode Styles */
.photo-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.photo-upload-box {
    width: 100%;
    max-width: 250px;
    aspect-ratio: 1 / 1;
    background: var(--card-bg);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 2px dashed rgba(255,255,255,0.1);
    transition: 0.3s;
    margin: 0 auto;
}

.photo-upload-box:hover {
    border-color: var(--primary);
    background: rgba(255,255,255,0.05);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #a4b0be;
}

.upload-placeholder i {
    font-size: 3rem;
    font-weight: 300;
    color: var(--primary);
}

.upload-placeholder span {
    font-size: 3rem;
    font-weight: 300;
}

.preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0; left: 0;
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.3s;
}

.preview-img:hover {
    transform: scale(1.02);
}

.remove-photo-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.remove-photo-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.5);
}

.remove-photo-btn i {
    color: white;
}

.photo-options {
    flex-direction: row;
    gap: 10px;
}

.photo-option {
    flex: 1;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: 0.3s;
    position: relative;
}

.photo-option:active {
    transform: scale(0.98);
}

.photo-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Answer View */
.back-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.back-header h2 {
    margin-bottom: 0;
    text-align: left;
    flex: 1;
}

.selected-question-display {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-style: italic;
    color: #a4b0be;
    text-align: center;
}

#answer-input {
    min-height: 150px;
}

/* Target List (Creator View) */
.target-list {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.target-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    color: #a4b0be;
}

/* Result */
.result-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.photo-results {
    flex-direction: row;
    gap: 10px;
}

.result-card {
    padding: 20px;
    background: var(--card-bg);
    border-radius: 16px;
    text-align: center;
    border: 3px solid transparent;
    font-size: 1.1rem;
    display: flex;
    flex-direction: column; /* Changed to column to stack names */
    align-items: center;
    justify-content: center;
    min-height: 80px;
    opacity: 0.4;
    transition: all 0.5s ease;
    gap: 10px; /* Space between text and names */
}

.photo-card {
    padding: 0;
    flex: 1;
    aspect-ratio: 1/1;
    overflow: hidden;
    position: relative;
    opacity: 0.6;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}

.photo-option img {
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}

#res-img-1, #res-img-2, #vote-img-1, #vote-img-2 {
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}

.photo-card.selected {
    opacity: 1;
    border-color: var(--success);
}

.overlay-stats {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.85);
    padding: 12px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    border-top: 2px solid rgba(255, 71, 87, 0.5);
}

.voter-names {
    font-size: 0.9rem;
    color: var(--primary);
    background: rgba(255, 71, 87, 0.2);
    padding: 12px 18px;
    border-radius: 14px;
    margin-top: 12px;
    width: 100%;
    word-wrap: break-word;
    font-weight: 600;
    border: 2px solid rgba(255, 71, 87, 0.4);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.2);
    line-height: 1.5;
}

.voter-names strong {
    display: block;
    font-size: 1.1em;
    margin-bottom: 4px;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
}

.voter-names span {
    opacity: 0.85;
    font-weight: 500;
}

.result-card.selected {
    border-color: var(--success);
    background: rgba(46, 213, 115, 0.15);
    opacity: 1;
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(46, 213, 115, 0.2);
}

.result-card.not-selected {
    opacity: 0.5;
    transform: scale(0.95);
}

#result-message {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: #a4b0be;
}

.answer-box {
    background: #2f3542;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid var(--accent);
}

/* Beautiful Answer Slideshow Styling */
.slide-item {
    animation: fadeIn 0.5s;
}

.slide-name {
    font-size: 0.9rem;
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 5px;
    display: block;
}

.slide-context {
    font-size: 0.85rem;
    color: #747d8c;
    margin-bottom: 15px;
    font-style: italic;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}

.slide-answer {
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
}

/* Timer - Fixed and Improved */
.timer-container {
    width: 100%;
    margin-top: auto;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#result-timer-container {
    display: none; /* Hidden by default, shown when timer starts */
}

.timer-text-display {
    text-align: center;
    margin-bottom: 12px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#timer-seconds {
    color: var(--primary);
    font-weight: 900;
    font-size: 2rem;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 15px rgba(255, 71, 87, 0.6);
    display: inline-block;
    min-width: 50px;
    animation: pulseNumber 1s ease-in-out infinite;
}

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

.timer-bar {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 71, 87, 0.3);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.timer-progress {
    height: 100%;
    background: linear-gradient(90deg, 
        var(--primary) 0%, 
        var(--accent) 50%,
        var(--primary) 100%);
    background-size: 200% 100%;
    width: 0%;
    transition: none;
    border-radius: 15px;
    box-shadow: 
        0 0 20px rgba(255, 71, 87, 0.6),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
    animation: shimmer 2s ease-in-out infinite;
    position: relative;
}

.timer-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent);
    animation: slide 2s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes slide {
    0% { left: -100%; }
    100% { left: 100%; }
}

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

.modal.active {
    display: flex;
    animation: fadeIn 0.2s;
}

.modal-content {
    background: var(--bg);
    padding: 2.5rem;
    border-radius: 24px;
    text-align: center;
    width: 85%;
    max-width: 350px;
    border: 1px solid rgba(255,255,255,0.1);
}

.modal h3 {
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.modal p {
    color: #a4b0be;
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    flex-direction: column;
}

/* Vote Person Styles */
.vote-person-list-container {
    flex: 1;
    overflow-y: auto;
    margin-top: 20px;
    padding-right: 5px;
}

.vote-person-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 10px;
}

.vote-person-item {
    background: var(--card-bg);
    padding: 18px 20px;
    border-radius: 16px;
    border: 2px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 1.1rem;
    min-height: 60px;
}

.vote-person-item:hover {
    border-color: var(--primary);
    background: rgba(255, 71, 87, 0.1);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.2);
}

.vote-person-item.selected {
    border-color: var(--success);
    background: rgba(46, 213, 115, 0.15);
    box-shadow: 0 4px 15px rgba(46, 213, 115, 0.3);
}

.vote-person-item.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--success);
    font-size: 1.5rem;
}

.creator-badge {
    font-size: 0.8em;
    color: var(--accent);
    margin-left: 5px;
    font-weight: 600;
    opacity: 0.9;
}

.vote-person-results {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 2px solid rgba(255,255,255,0.1);
}

.vote-person-results h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--accent);
    font-size: 1.2rem;
}

.vote-person-results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vote-person-result-item {
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vote-person-result-item .player-name {
    font-weight: 600;
    font-size: 1rem;
}

.vote-person-result-item .voted-by {
    color: #a4b0be;
    font-size: 0.9rem;
    text-align: right;
}

.vote-person-result-item .voted-by strong {
    color: var(--primary);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .room-code-in-header {
        flex: 1;
    }
    
    .code-label-top {
        font-size: 0.6rem;
        letter-spacing: 1px;
        margin-bottom: 3px;
    }
    
    .code-value-hero {
        font-size: 1.4rem;
        letter-spacing: 3px;
    }
    
    .waiting-content {
        padding: 15px;
        max-height: calc(100vh - 260px);
    }
    
    .player-list {
        gap: 8px;
        width: 100%;
    }
    
    .player-item {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .lobby-settings-display {
        padding: 12px 16px;
        font-size: 0.85rem;
        margin-top: 15px;
    }
    
    .lobby-settings-display .setting-item {
        font-size: 0.8rem;
        padding: 6px 0;
    }
    
    .lobby-status {
        gap: 12px;
        margin-bottom: 20px;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .count-badge {
        font-size: 0.85rem;
        padding: 4px 12px;
    }
}

/* Crop Modal Styles */
.crop-modal-content {
    max-width: 90vw;
    width: 100%;
    max-height: 90vh;
    padding: 20px;
}

.crop-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: visible;
    display: flex;
    justify-content: center;
    align-items: center;
}

#crop-canvas {
    display: block;
    max-width: 100%;
    max-height: 60vh;
    width: auto;
    height: auto;
    border-radius: 8px;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: 8px;
}

.crop-box {
    position: absolute;
    border: 3px solid var(--primary);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6), inset 0 0 0 2px rgba(255, 255, 255, 0.3);
    cursor: move;
    pointer-events: all;
    aspect-ratio: 1 / 1;
    min-width: 100px;
    min-height: 100px;
}

.crop-handle {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border: 2px solid white;
    border-radius: 50%;
    pointer-events: all;
    cursor: nwse-resize;
}

.crop-handle-nw {
    top: -10px;
    left: -10px;
    cursor: nwse-resize;
}

.crop-handle-ne {
    top: -10px;
    right: -10px;
    cursor: nesw-resize;
}

.crop-handle-sw {
    bottom: -10px;
    left: -10px;
    cursor: nesw-resize;
}

.crop-handle-se {
    bottom: -10px;
    right: -10px;
    cursor: nwse-resize;
}

.crop-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

.crop-actions .btn {
    flex: 1;
    max-width: 200px;
}

@media (max-height: 700px) {
    h1 { font-size: 2.5rem; margin-bottom: 1rem; }
    .option-btn { min-height: 100px; }
    .loader { width: 40px; height: 40px; margin-bottom: 1rem; }
    .choice-card { height: 80px; }
    .settings-content { gap: 15px; }
    .waiting-header {
        padding: 10px 12px;
        margin-bottom: 1rem;
    }
    
    .code-value-hero {
        font-size: 1.3rem;
        letter-spacing: 3px;
    }
    
    .code-label-top {
        font-size: 0.65rem;
        letter-spacing: 1.5px;
        margin-bottom: 4px;
    }
    .waiting-content {
        max-height: calc(100vh - 230px);
        padding: 15px;
    }
}
