/* Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --error-color: #dc2626;
    --background: #ffffff;
    --surface: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

#app {
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    flex-direction: column;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Hauptmenü */
.title {
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: clamp(1rem, 4vw, 1.25rem);
}

.game-modes {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.mode-btn {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 80px;
}

.mode-btn:hover,
.mode-btn:focus {
    border-color: var(--primary-color);
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.mode-btn:active {
    transform: translateY(0);
}

.mode-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.mode-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.mode-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 0.25rem;
}

.instructions {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.instructions h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.125rem;
}

.instructions ol {
    padding-left: 1.5rem;
}

.instructions li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Spielbereich */
#game-screen {
    background: var(--background);
}

#game-container {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

#game-info {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.125rem;
    font-weight: 600;
}

#target-time {
    color: var(--primary-color);
}

#game-status {
    color: var(--text-secondary);
}

/* Spieler-Bereiche */
.player-area {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 2px solid transparent;
    overflow: hidden;
}

.player-area:hover {
    background: rgba(37, 99, 235, 0.05);
}

.player-area:active {
    background: rgba(37, 99, 235, 0.1);
    transform: scale(0.98);
}

.player-area.waiting {
    background: rgba(100, 116, 139, 0.1);
    border-color: var(--secondary-color);
}

.player-area.ready {
    background: rgba(5, 150, 105, 0.1);
    border-color: var(--success-color);
}

.player-area.playing {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--primary-color);
}

.player-area.finished {
    background: rgba(217, 119, 6, 0.1);
    border-color: var(--warning-color);
}

.player-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

.player-instruction {
    text-align: center;
    font-size: clamp(1rem, 4vw, 1.5rem);
    font-weight: 600;
    color: var(--text-primary);
    padding: 2rem;
}

/* Einzelspieler Layout */
.single-player .player-area {
    width: 100%;
    height: 100%;
}

/* Duell Layout */
.duel-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.duel-layout .player-area {
    flex: 1;
}

/* Gruppen Layout */
.group-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.group-layout .player-area {
    flex: 1;
}

/* Ergebnisse */
#results-screen {
    background: var(--background);
}

#results-screen h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: clamp(1.5rem, 6vw, 2rem);
    color: var(--text-primary);
}

.result-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-player {
    font-weight: 600;
    color: var(--text-primary);
}

.result-time {
    font-size: 1.25rem;
    font-weight: 700;
}

.result-time.perfect {
    color: var(--success-color);
}

.result-time.good {
    color: var(--primary-color);
}

.result-time.okay {
    color: var(--warning-color);
}

.result-time.poor {
    color: var(--error-color);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
}

.btn.primary {
    background: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn.secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn.secondary:hover {
    background: var(--background);
    border-color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }
    
    .mode-btn {
        padding: 1rem;
        min-height: 70px;
    }
    
    .mode-icon {
        font-size: 1.5rem;
    }
    
    .player-label {
        top: 0.5rem;
        left: 0.5rem;
        padding: 0.25rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .player-instruction {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

/* Animationen */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 0.6s ease-in-out;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.flash {
    animation: flash 0.3s ease-in-out;
}

/* Barrierefreiheit */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ff;
        --text-primary: #000000;
        --background: #ffffff;
        --surface: #f0f0f0;
        --border: #000000;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #0f172a;
        --surface: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --border: #334155;
    }
} 