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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #ffffff;
    overflow-x: hidden;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    padding-bottom: 40px;
}

.screen.active {
    display: flex;
}

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

.game-title {
    font-size: 4rem;
    font-weight: 900;
    text-align: center;
    background: linear-gradient(135deg, #e94560 0%, #ff6b9d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    line-height: 1.1;
    text-shadow: 0 0 40px rgba(233, 69, 96, 0.3);
}

.game-title-small {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #e94560 0%, #ff6b9d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.tagline {
    font-size: 1.1rem;
    color: #a0a0a0;
    text-align: center;
    margin-bottom: 40px;
}

.logo-section {
    margin-bottom: 40px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.btn {
    display: inline-block;
    padding: 16px 32px;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #e94560 0%, #ff6b9d 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(233, 69, 96, 0.4);
}

.btn-primary:hover, .btn-primary:active {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(233, 69, 96, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #4a90a4 0%, #6bb3d9 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(74, 144, 164, 0.4);
}

.btn-large {
    padding: 20px 40px;
    font-size: 1.4rem;
}

.btn-group {
    width: 100%;
    padding: 24px;
    font-size: 1.5rem;
    border-radius: 20px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.btn-group.available {
    background: linear-gradient(135deg, #2d5a3d 0%, #3d7a5a 100%);
    border: 3px solid #4a9b6a;
}

.btn-group.joined {
    background: linear-gradient(135deg, #e94560 0%, #ff6b9d 100%);
    border: 3px solid #ff8eb0;
    animation: pulse 0.5s ease;
}

.btn-group.locked {
    background: linear-gradient(135deg, #1a1a2e 0%, #2a2a4e 100%);
    border: 3px solid #4a4a6a;
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-group.full {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    border: 3px solid #fff176;
    color: #1a1a2e;
}

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

.btn-duel {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    font-size: 3rem;
    background: linear-gradient(135deg, #e94560 0%, #ff6b9d 100%);
    color: white;
    box-shadow: 0 15px 50px rgba(233, 69, 96, 0.6);
    animation: pulseGlow 1s infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 15px 50px rgba(233, 69, 96, 0.6); }
    50% { box-shadow: 0 20px 70px rgba(233, 69, 96, 0.9); }
}

.input-field {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    border: 2px solid #3a3a5a;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-align: center;
    margin-bottom: 10px;
}

.input-field::placeholder {
    color: #888;
}

.input-field:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.3);
}

.input-large {
    font-size: 1.4rem;
    padding: 20px;
}

.join-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #3a3a5a;
}

.error-message {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
}

.rules-preview {
    margin-top: 60px;
    text-align: center;
    color: #888;
}

.rules-preview h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #aaa;
}

.rules-preview p {
    font-size: 0.9rem;
    margin: 5px 0;
}

.room-code-display {
    font-size: 1.2rem;
    color: #aaa;
    margin-bottom: 30px;
}

.room-code-display span {
    font-weight: 700;
    color: #e94560;
    font-size: 2rem;
    letter-spacing: 4px;
    font-family: 'Courier New', monospace;
    background: rgba(233, 69, 96, 0.15);
    padding: 8px 16px;
    border-radius: 8px;
    display: inline-block;
    margin-top: 8px;
    cursor: pointer;
}

.room-code-display span:active {
    transform: scale(0.95);
}

.name-input-section {
    width: 100%;
    max-width: 300px;
    text-align: center;
}

.hint {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 20px;
}

.player-info {
    margin-bottom: 30px;
}

.player-name-highlight {
    font-weight: 700;
    color: #e94560;
    font-size: 1.3rem;
}

.players-section {
    width: 100%;
    max-width: 300px;
    margin-bottom: 30px;
}

.players-section h3 {
    font-size: 1rem;
    color: #aaa;
    margin-bottom: 15px;
    text-align: center;
}

.player-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.player-list li {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
}

.player-list li.host {
    background: linear-gradient(135deg, #e94560 0%, #ff6b9d 100%);
}

.player-list li.eliminated {
    opacity: 0.4;
    text-decoration: line-through;
}

.waiting-message {
    color: #888;
    font-size: 1rem;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hidden {
    display: none !important;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}

.round-info {
    font-size: 1.2rem;
    color: #aaa;
}

.timer-display {
    font-size: 3rem;
    font-weight: 900;
    color: #e94560;
    min-width: 80px;
    text-align: center;
}

.timer-display.warning {
    animation: timerPulse 0.5s infinite;
    color: #ff4444;
}

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

.announcement {
    text-align: center;
    margin-bottom: 30px;
}

.mingle-text {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.group-size-text {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #e94560 0%, #ff6b9d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.groups-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.group-btn-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.group-name {
    font-weight: 700;
}

.group-count {
    font-size: 1.2rem;
    opacity: 0.9;
}

.group-members {
    font-size: 0.85rem;
    margin-top: 8px;
    opacity: 0.8;
}

.your-status {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 25px;
    border-radius: 12px;
    text-align: center;
}

#status-text {
    font-size: 1.1rem;
    color: #aaa;
}

.results-title {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #fff;
}

.survivors-section, .eliminated-section, .eliminated-with-section {
    width: 100%;
    max-width: 350px;
    margin-bottom: 25px;
}

.survivors-section h3, .eliminated-section h3, .eliminated-with-section h3 {
    font-size: 1.1rem;
    color: #aaa;
    margin-bottom: 15px;
    text-align: center;
}

#surviving-groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.surviving-group {
    background: linear-gradient(135deg, #2d5a3d 0%, #3d7a5a 100%);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}

.surviving-group .group-label {
    font-weight: 700;
    margin-bottom: 5px;
}

.surviving-group .group-names {
    font-size: 0.9rem;
    color: #aaa;
}

.eliminated-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.eliminated-list li {
    background: rgba(255, 0, 0, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    color: #ff6666;
    text-decoration: line-through;
}

.remaining-count {
    font-size: 1.2rem;
    color: #e94560;
    margin-top: 20px;
}

.next-round-notice {
    font-size: 1rem;
    color: #4ecdc4;
    margin-top: 15px;
    animation: pulse 1.5s infinite;
}

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

.duel-title {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.duel-subtitle {
    font-size: 1.2rem;
    color: #aaa;
    margin-bottom: 30px;
}

.duel-players {
    font-size: 1.4rem;
    margin-bottom: 40px;
    text-align: center;
}

.duel-players span {
    color: #e94560;
    font-weight: 700;
}

.duel-instruction {
    font-size: 1.5rem;
    margin-bottom: 40px;
    text-align: center;
}

.wait-text {
    color: #888;
    animation: blink 1s infinite;
}

.go-text {
    font-size: 4rem;
    font-weight: 900;
    color: #4caf50;
    animation: goFlash 0.3s ease;
}

@keyframes goFlash {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.winner-celebration {
    text-align: center;
    margin-bottom: 50px;
}

.winner-title {
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: winnerPulse 1s infinite;
}

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

.winner-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: #e94560;
    margin-top: 20px;
}

.eliminated-title {
    font-size: 3rem;
    font-weight: 900;
    color: #ff4444;
    margin-bottom: 20px;
}

.eliminated-message {
    font-size: 1.3rem;
    color: #aaa;
    margin-bottom: 30px;
}

.spectator-notice {
    font-size: 1rem;
    color: #666;
    font-style: italic;
    margin-bottom: 20px;
}

#eliminated-screen .btn-secondary,
#winner-screen .btn-primary {
    margin-top: 30px;
}

@media (max-width: 400px) {
    .game-title {
        font-size: 3rem;
    }
    
    .btn-large {
        padding: 16px 30px;
        font-size: 1.2rem;
    }
    
    .timer-display {
        font-size: 2.5rem;
    }
    
    .duel-title {
        font-size: 2.5rem;
    }
    
    .winner-title {
        font-size: 3rem;
    }
}

.hub-link {
    display: block;
    text-align: center;
    margin-top: 30px;
    padding: 12px 24px;
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.hub-link:hover {
    color: #4ecdc4;
}
