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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 2rem;
    width: 90%;
    max-width: 900px;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
}

.timer-display {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto 2rem;
}

.time-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: bold;
    color: #333;
    font-variant-numeric: tabular-nums;
}

.time-text.warning {
    color: #ff6b6b;
    animation: pulse 1s infinite;
}

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

.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
}

.controls {
    display: grid;
    gap: 2rem;
}

.time-presets h3,
.custom-time h3,
.question-tracker h3 {
    margin-bottom: 1rem;
    color: #444;
}

.preset-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.preset-btn:hover {
    background: #667eea;
    color: white;
}

.preset-btn.active {
    background: #667eea;
    color: white;
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.time-input-group input {
    width: 80px;
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.2rem;
    text-align: center;
}

.time-input-group span {
    font-size: 1.5rem;
    font-weight: bold;
}

.main-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #45a049;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #e68900;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #da190b;
}

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

.btn-secondary:hover:not(:disabled) {
    background: #616161;
}

.btn-info {
    background: #2196F3;
    color: white;
    margin-top: 1rem;
    width: 100%;
}

.btn-info:hover:not(:disabled) {
    background: #0b7dda;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.features {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.feature-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.question-tracker {
    background: #f5f5f5;
    padding: 1.5rem;
    border-radius: 12px;
}

.question-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.question-controls span {
    font-size: 1.2rem;
    font-weight: 600;
}

.history {
    max-height: 150px;
    overflow-y: auto;
}

.history h4 {
    margin-bottom: 0.5rem;
    color: #666;
}

.history ul {
    list-style: none;
}

.history li {
    padding: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9rem;
}

.fullscreen-mode {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 1000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fullscreen-mode.active {
    display: flex;
}

.fullscreen-timer {
    font-size: 15rem;
    color: white;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    font-variant-numeric: tabular-nums;
}

.fullscreen-timer.warning {
    animation: flash 1s infinite;
}

@keyframes flash {
    0%, 50% { opacity: 1; }
    25%, 75% { opacity: 0.3; }
}

#exitFullscreen {
    position: absolute;
    top: 2rem;
    right: 2rem;
}

.shortcuts {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.shortcuts h4 {
    margin-bottom: 0.5rem;
    color: #666;
}

.shortcuts p {
    color: #888;
    font-size: 0.9rem;
}

kbd {
    background: #f0f0f0;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-family: monospace;
}

.screen-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 999;
    pointer-events: none;
    animation: screenFlash 0.5s;
}

@keyframes screenFlash {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .timer-display {
        width: 250px;
        height: 250px;
    }
    
    .time-text {
        font-size: 3rem;
    }
    
    .fullscreen-timer {
        font-size: 8rem;
    }
    
    .main-controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}