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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #00bcd4 0%, #26c6da 50%, #00acc1 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 188, 212, 0.3);
    text-align: center;
    max-width: 900px;
    margin: 80px auto 20px;
}

h1 {
    margin-bottom: 30px;
    color: #f5f5f5;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-size: 2.5rem;
}

.time-pickers {
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 30px;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.time-picker {
    text-align: center;
}

.time-picker h2 {
    margin-bottom: 15px;
    color: #fafafa;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    font-size: 1.5rem;
}

.clock {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-color: rgba(0, 188, 212, 0.2);
    border: 3px solid #00bcd4;
    position: relative;
    margin: 0 auto;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.clock .hand {
    position: absolute;
    width: 4px;
    height: 80px;
    background-color: #f00;
    border-radius: 2px;
    top: 50%;
    left: 50%;
    transform-origin: bottom center;
    z-index: 10;
}

.value {
    font-size: 28px;
    font-weight: bold;
    color: #f5f5f5;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
    margin-top: 15px;
}

.selected-time {
    margin-top: 20px;
}

.selected-time h2 {
    margin-bottom: 10px;
    color: #fafafa;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    font-size: 1.2rem;
}

#selected-time {
    font-size: 3rem;
    font-weight: bold;
    color: #f5f5f5;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

#save-button {
    padding: 12px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    background-color: #00bcd4;
    color: white;
    border: 2px solid #00838f;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#save-button:hover {
    background-color: #00acc1;
    transform: translateY(-2px);
}

.disclaimer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.disclaimer p {
    font-size: 14px;
    color: #37474f;
    font-weight: bold;
}

.game-container,
.result-container,
.fail-container,
.countdown-overlay {
    display: none;
}

.game-container {
    max-width: 900px;
    margin: 80px auto 20px;
    padding: 20px;
}

.game-header {
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: space-around;
    -moz-box-pack: space-around;
    -ms-flex-pack: distribute;
    -webkit-justify-content: space-around;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.game-header div {
    text-align: center;
}

.game-header h3 {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.game-header div div {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.game-area {
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 15px;
    padding: 15px;
    height: 450px;
    position: relative;
    overflow: hidden;
}

.track {
    width: 180px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.track-hour {
    border-left: 3px solid #ff6b6b;
}

.track-minute {
    border-left: 3px solid #ffd93d;
}

.track-second {
    border-left: 3px solid #6bcb77;
}

.track-label {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    z-index: 10;
}

.track-content {
    height: 100%;
    position: relative;
}

.hit-zone {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    border-top: 2px dashed white;
    border-bottom: 2px dashed white;
    cursor: pointer;
    z-index: 5;
}

.note-block {
    position: absolute;
    width: 80%;
    left: 10%;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
}

.note-block.hour {
    background: linear-gradient(180deg, #ff6b6b 0%, #ee5a5a 100%);
}

.note-block.minute {
    background: linear-gradient(180deg, #ffd93d 0%, #f4b942 100%);
}

.note-block.second {
    background: linear-gradient(180deg, #6bcb77 0%, #4caf50 100%);
}

.note-block.hit {
    animation: hitEffect 0.3s ease-out forwards;
}

@keyframes hitEffect {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.perfect-text {
    position: fixed;
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    pointer-events: none;
    animation: perfectPopup 1s ease-out forwards;
    z-index: 100;
}

@keyframes perfectPopup {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    20% { transform: translateY(-20px) scale(1.2); opacity: 1; }
    100% { transform: translateY(-60px) scale(1); opacity: 0; }
}

.key-hints {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 20px;
}

.key-hint {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.3rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    transition: all 0.2s ease;
}

.key-hint.active {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.key-a { color: #ff6b6b; }
.key-s { color: #ffd93d; }
.key-d { color: #6bcb77; }

.game-container button,
.result-container button,
.fail-container button {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
}

.game-container button:hover,
.result-container button:hover,
.fail-container button:hover {
    transform: translateY(-2px);
}

#back-to-select {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.result-container,
.fail-container {
    max-width: 500px;
    margin: 100px auto;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.result-container h1,
.fail-container h1 {
    color: #333;
    margin-bottom: 20px;
}

.fail-container p {
    color: #ff6b6b;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.result-time,
.fail-time {
    margin-bottom: 30px;
}

.result-time h3,
.fail-time h3 {
    color: #666;
    margin-bottom: 10px;
}

#result-time-value,
#fail-time-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
}

#confirm-time,
#confirm-fail-time {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
}

#play-again,
#restart-game {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
}

.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.countdown-content {
    background: white;
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.countdown-content h1 {
    color: #333;
    margin-bottom: 20px;
    text-shadow: none;
}

#final-countdown {
    font-size: 4rem;
    font-weight: bold;
    color: #ff6b6b;
    margin-bottom: 30px;
}

#stop-countdown {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

@media screen and (max-width: 768px) {
    .container {
        margin: 60px 15px 20px;
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .time-pickers {
        gap: 20px;
    }
    
    .clock {
        width: 140px;
        height: 140px;
    }
    
    .clock .hand {
        height: 60px;
    }
    
    .value {
        font-size: 1.2rem;
    }
    
    #selected-time {
        font-size: 2rem;
    }
    
    .game-area {
        flex-direction: column;
        height: auto;
        min-height: 400px;
        padding: 10px;
        gap: 10px;
    }
    
    .track {
        width: 100%;
        height: 180px;
    }
    
    .key-hints {
        gap: 30px;
    }
    
    .key-hint {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .game-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .result-container,
    .fail-container {
        margin: 60px 15px;
        padding: 25px;
    }
    
    #final-countdown {
        font-size: 2.5rem;
    }
}

.dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 2000;
}

.dialog.show {
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
}

.dialog-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 300px;
    width: 90%;
}

.dialog-content p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: #333;
}

.dialog-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.dialog-button {
    padding: 10px 25px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dialog-button:hover {
    transform: translateY(-2px);
}

.confirm-button {
    background: linear-gradient(135deg, #748385 0%, #748385 100%);
    color: white;
}

.reset-button,
.warning-confirm-button,
.time-confirm-button {
    background: linear-gradient(135deg, #58f428 0%, #58f428 100%);
    color: white;
}

.warning-dialog-content p {
    color: #ff6b6b;
}

.time-dialog-content p {
    color: #00bcd4;
}

.game-intro-dialog-content h2 {
    margin-bottom: 15px;
    color: #00bcd4;
}

.game-intro-dialog-content p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.key-highlight {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(0, 188, 212, 0.2);
    border: 1px solid #00bcd4;
    border-radius: 4px;
    font-weight: bold;
    color: #00bcd4;
    margin: 0 2px;
}

.game-intro-confirm-button {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%) !important;
    color: white;
}

@media screen and (max-width: 480px) {
    .time-pickers {
        flex-direction: column;
        align-items: center;
    }
    
    .clock {
        width: 120px;
        height: 120px;
    }
    
    .game-area {
        min-height: 350px;
    }
    
    .track {
        height: 140px;
    }
}