/**
 * Game Styles - Boomfection Spielseite
 * @copyright reDim GmbH | @link https://www.redim.de | @contact team@redim.de
 */

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

body {
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0f0f1a 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: #e0e0e0;
    overflow: hidden;
}

#app { display: flex; height: 100vh; }

#canvas-container {
    flex: 1;
    position: relative;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

canvas:active { cursor: grabbing; }

/* Lobby Panel */
#lobby-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 15, 25, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 140, 50, 0.3);
    border-radius: 16px;
    padding: 30px;
    width: 400px;
    max-width: 90vw;
}

#lobby-panel.hidden { display: none; }

#lobby-panel h1 {
    color: #ff8c32;
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
}

.player-setup {
    background: rgba(40, 40, 60, 0.5);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.player-setup h3 {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 10px;
}

.player-setup input {
    width: 100%;
    padding: 10px;
    background: #2a2a3a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    margin-bottom: 10px;
}

.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.color-option:hover { transform: scale(1.1); }
.color-option.selected { border-color: #fff; }

.btn {
    background: linear-gradient(135deg, #ff8c32 0%, #e07020 100%);
    border: none;
    color: #fff;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    width: 100%;
    margin-top: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 140, 50, 0.4);
}

.btn:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
}

/* Game UI */
#game-ui {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(15, 15, 25, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 140, 50, 0.3);
    border-radius: 12px;
    padding: 20px;
    min-width: 220px;
}

#game-ui.hidden { display: none; }

#game-ui h2 {
    color: #ff8c32;
    font-size: 1rem;
    margin-bottom: 15px;
}

.current-turn {
    padding: 10px;
    background: rgba(255, 140, 50, 0.2);
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
}

.current-turn .player-name {
    font-size: 1.2rem;
    font-weight: bold;
}

.player-list {
    margin-top: 15px;
}

.player-item {
    display: flex;
    align-items: center;
    padding: 8px;
    background: rgba(40, 40, 60, 0.3);
    border-radius: 6px;
    margin-bottom: 6px;
}

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

.player-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
}

.player-stats {
    margin-left: auto;
    font-size: 0.8rem;
    color: #888;
}

/* Round indicator */
#round-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(15, 15, 25, 0.9);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
}

#round-indicator.hidden { display: none; }

/* Winner overlay */
#winner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#winner-overlay.hidden { display: none; }

.winner-content {
    text-align: center;
    padding: 40px;
}

.winner-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.winner-content .winner-name {
    font-size: 2rem;
    margin-bottom: 30px;
}

/* Tooltip */
#tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 140, 50, 0.5);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0;
    z-index: 100;
}

#tooltip.visible { opacity: 1; }

/* ============================================================================
   ROTATE DEVICE HINT (dismissible banner)
   @copyright reDim GmbH | @link https://www.redim.de | @contact team@redim.de
   ============================================================================ */

.rotate-hint {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    font-size: 0.8rem;
    text-align: center;
    padding: 8px 16px;
}

.rotate-hint-icon {
    font-size: 1.2rem;
}

.rotate-hint-dismiss {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 1rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    flex-shrink: 0;
}

@media (max-width: 768px) and (orientation: portrait) {
    .rotate-hint:not(.dismissed) {
        display: flex;
    }
}

/* ============================================================================
   MOBILE RESPONSIVE
   @copyright reDim GmbH | @link https://www.redim.de | @contact team@redim.de
   ============================================================================ */

@media (max-width: 768px) {
    #app {
        height: 100vh;
        height: 100dvh;
    }

    #lobby-panel {
        width: calc(100% - 32px) !important;
        max-width: 400px;
        max-height: calc(100dvh - 40px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 16px;
    }

    #lobby-panel h1 {
        font-size: 1.4rem;
        margin-bottom: 12px;
    }

    .player-setup {
        padding: 10px;
        margin-bottom: 10px;
    }

    #game-ui {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: auto !important;
        min-width: auto;
        border-radius: 12px 12px 0 0;
        padding: 10px 14px;
        max-height: 35vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #round-indicator {
        top: 8px;
        right: 8px;
        font-size: 0.75rem;
        padding: 6px 12px;
    }

    .winner-content h1 {
        font-size: 2rem;
    }

    .winner-content .winner-name {
        font-size: 1.4rem;
    }

    .winner-content {
        padding: 20px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 1rem;
    }

    .color-option {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    #app {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    #lobby-panel {
        padding: 12px;
    }

    #lobby-panel h1 {
        font-size: 1.2rem;
    }

    #game-ui {
        padding: 8px 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rotate-hint-icon {
        animation: none;
    }
}
