:root {
    --ice-blue: #00b4d8;
    --deep-blue: #0077b6;
    --frost-white: #caf0f8;
    --snow-white: #f0f3f5;
    --cold-gray: #90e0ef;
    --dark-blue: #023e8a;
    --alert-red: #ff6b6b;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #333;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 霜効果オーバーレイ */
.frost-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(255,255,255,0.4) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 10;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease;
}

h1 {
    font-size: 3rem;
    background: linear-gradient(45deg, var(--deep-blue), var(--ice-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.tagline {
    font-size: 1.2rem;
    color: var(--deep-blue);
    opacity: 0.8;
}

/* タイマーセクション */
.timer-section {
    background: rgba(255,255,255,0.9);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,119,182,0.2);
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.timer-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0,180,216,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

.temperature-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.temp-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--deep-blue);
}

.temp-slider {
    width: 200px;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--frost-white) 0%, var(--ice-blue) 50%, var(--deep-blue) 100%);
    border-radius: 5px;
    outline: none;
}

.temp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    background: white;
    border: 3px solid var(--ice-blue);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.timer-display {
    text-align: center;
    position: relative;
    z-index: 1;
}

.time {
    font-size: 5rem;
    font-weight: 700;
    color: var(--deep-blue);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 4px 10px rgba(0,119,182,0.2);
    transition: all 0.3s ease;
}

.timer-display.active .time {
    animation: pulse 2s ease-in-out infinite;
    color: var(--ice-blue);
}

.status {
    font-size: 1.2rem;
    color: var(--deep-blue);
    margin-top: 10px;
    font-weight: 500;
}

.start-btn {
    margin-top: 30px;
    padding: 15px 50px;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, var(--ice-blue), var(--deep-blue));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,119,182,0.3);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,119,182,0.4);
}

.start-btn.stop {
    background: linear-gradient(135deg, var(--alert-red), #e63946);
}

/* 統計セクション */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(255,255,255,0.9);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,119,182,0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,119,182,0.2);
}

.stat-card h3 {
    color: var(--deep-blue);
    font-size: 1rem;
    margin-bottom: 10px;
    opacity: 0.8;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--ice-blue);
}

/* 実績セクション */
.achievements-section {
    background: rgba(255,255,255,0.9);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

.achievements-section h2 {
    color: var(--deep-blue);
    margin-bottom: 20px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.achievement {
    background: linear-gradient(135deg, var(--snow-white), var(--frost-white));
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.achievement.unlocked {
    background: linear-gradient(135deg, var(--cold-gray), var(--ice-blue));
    transform: scale(1.05);
}

.achievement.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.achievement:hover {
    transform: scale(1.1);
}

.achievement-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.achievement-desc {
    font-size: 0.8rem;
    color: var(--dark-blue);
}

/* ランキングセクション */
.ranking-section {
    background: rgba(255,255,255,0.9);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

.ranking-section h2 {
    color: var(--deep-blue);
    margin-bottom: 20px;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: linear-gradient(135deg, var(--snow-white), var(--frost-white));
    border-radius: 10px;
    transition: all 0.3s ease;
}

.ranking-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,119,182,0.2);
}

.rank {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--deep-blue);
    width: 40px;
}

.name {
    flex: 1;
    font-weight: 500;
}

.time {
    font-weight: bold;
    color: var(--ice-blue);
}

.temp {
    color: var(--deep-blue);
    margin-left: 10px;
}

/* 効果セクション */
.benefits-section {
    background: rgba(255,255,255,0.9);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

.benefits-section h2 {
    color: var(--deep-blue);
    margin-bottom: 20px;
}

.benefits-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.benefits-list li {
    padding: 15px;
    background: linear-gradient(135deg, var(--frost-white), var(--cold-gray));
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.benefits-list li:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,119,182,0.2);
}

/* モーダル */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

.modal-content h2 {
    color: var(--deep-blue);
    margin-bottom: 20px;
}

.result-time {
    font-size: 3rem;
    font-weight: bold;
    color: var(--ice-blue);
    margin: 20px 0;
}

.result-message {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
}

.close-modal {
    padding: 10px 30px;
    background: var(--ice-blue);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: var(--deep-blue);
}

/* 実績通知 */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: -400px;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: right 0.3s ease;
    z-index: 1001;
}

.achievement-notification.show {
    right: 20px;
}

.achievement-notification h3 {
    color: var(--deep-blue);
    margin-bottom: 10px;
}

/* フッター */
footer {
    text-align: center;
    padding: 30px 0;
    color: var(--deep-blue);
    opacity: 0.8;
}

/* アニメーション */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* レスポンシブ */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .time { font-size: 3.5rem; }
    .temp-value { font-size: 2rem; }
    .temp-slider { width: 150px; }
    .stats-section { grid-template-columns: 1fr; }
    .achievements-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}