:root{
    --digit-color: rgb(255, 123, 0); /* オレンジのLED風 */
    --bg-color: #222;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-color);
    margin: 0;
    font-family: 'Space Grotesk', monospace;
    font-feature-settings: "tnum";
    position: relative;
    overflow: hidden;
    transition: 0.3s;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

#fireworks-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

#pong-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 102;
    display: none;
    background: transparent;
}

#game-start-countdown {
    position: fixed;
    top: 15%;
    left: 0;
    width: 100%;
    z-index: 103;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-family: 'Space Grotesk', monospace;
    font-size: clamp(30px, 2vw, 100px);
    font-weight: bold;
    color: var(--digit-color);
    text-shadow: 0 0 20px var(--digit-color), 0 0 40px var(--digit-color), 0 0 60px var(--digit-color);
    pointer-events: none;
    display: none;
    text-align: center;
    animation: gameCountdownPulse 0.5s ease-in-out infinite;
}

@keyframes gameCountdownPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.9;
    }
}

.countdown-container {
    position: relative;
    z-index: 101;
    text-align: center;
    pointer-events: none;
}

.countdown-container .countdown-digit {
    pointer-events: auto;
}

.countdown-wrapper {
    display: flex;
    gap: 20px;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.label {
    font-size: 1.5vw;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
}

.countdown-digit {
    font-family: 'Space Grotesk', monospace;
    font-size: clamp(20px, 8vw, 200px);
    color: var(--digit-color);
    text-shadow: 0 0 5px var(--digit-color), 0 0 15px var(--digit-color), 0 0 25px var(--digit-color);
    padding: 20px 30px;
    background-color: rgba(255, 255, 255, 0.01);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(2px);
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    min-width: 120px;
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: 0.3s;
}

.countdown-digit:hover {
    transform: scale(1.05);
}

.countdown-digit.completed{
    border: 3px solid var(--digit-color);
}
#seconds.completed{
    border: 3px solid var(--digit-color);
    animation: blink 0.7s infinite;
}

.message {
    margin-top: 30px;
    font-size: clamp(20px, 4vw, 60px);
    color: var(--digit-color);
    text-shadow: 0 0 10px var(--digit-color), 0 0 20px var(--digit-color);
    animation: pulse 2s ease-in-out infinite;
}

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

.theme-selector {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 5;
}

.theme-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
    color: var(--digit-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.theme-btn:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* テーマカラー */
body[data-theme="orange"] {
    --digit-color: rgb(255, 123, 0);
    --bg-color: #222;
}

body[data-theme="blue"] {
    --digit-color: rgb(0, 162, 255);
    --bg-color: #1a1a2e;
}

body[data-theme="green"] {
    --digit-color: rgb(0, 255, 123);
    --bg-color: #0a1a0a;
}

body[data-theme="purple"] {
    --digit-color: rgb(200, 100, 255);
    --bg-color: #1a0a1a;
}

body[data-theme="red"] {
    --digit-color: rgb(255, 50, 50);
    --bg-color: #2e1a1a;
}

body[data-theme="cyan"] {
    --digit-color: rgb(0, 255, 255);
    --bg-color: #0a1a1a;
}

@media (max-width: 768px) {
    .countdown-wrapper {
        gap: 10px;
    }
    
    .countdown-digit {
        font-size: clamp(15px, 12vw, 150px);
        padding: 15px;
        min-width: 80px;
    }
    
    .label {
        font-size: 3vw;
    }
    
    .theme-selector {
        bottom: 20px;
        right: 20px;
    }
    
    .theme-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}