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

html {
    width: 100%;
    height: 100%;
}

body {
    background-color: #000000;
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    -webkit-user-select: none;
    user-select: none;
    overflow-y: auto;
}

.modal-content {
    background-color: #1a1a1a;
    border: 2px solid #00ff00;
    border-radius: 10px;
    padding: 30px 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 20px #00ff00, inset 0 0 10px rgba(0, 255, 0, 0.1);
    -webkit-box-shadow: 0 0 20px #00ff00, inset 0 0 10px rgba(0, 255, 0, 0.1);
}

.modal-content h2 {
    color: #00ff00;
    font-size: 28px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px #00ff00;
}

.modal-content p {
    color: #cccccc;
    font-size: 14px;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #00ff00;
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input[type="number"] {
    width: 100%;
    padding: 12px;
    background-color: #000000;
    border: 2px solid #00ff00;
    color: #00ff00;
    font-size: 16px;
    border-radius: 5px;
    -webkit-border-radius: 5px;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-user-select: text;
    user-select: text;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.form-group input[type="number"]:focus {
    outline: 2px solid #00ff00;
    outline-offset: 2px;
    box-shadow: 0 0 10px #00ff00, inset 0 0 5px rgba(0, 255, 0, 0.1);
    -webkit-box-shadow: 0 0 10px #00ff00, inset 0 0 5px rgba(0, 255, 0, 0.1);
}

.form-group input[type="number"]::placeholder {
    color: #666666;
}

.radio-group {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00ff00;
    font-size: 13px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    padding: 10px 14px;
    border: 2px solid #00ff00;
    border-radius: 5px;
    -webkit-border-radius: 5px;
    background-color: rgba(0, 255, 0, 0.05);
    transition: all 0.2s ease;
    flex: auto;
    min-width: 130px;
}

.radio-label:active {
    background-color: rgba(0, 255, 0, 0.15);
}

.radio-label input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    margin-right: 8px;
    background-color: #000000;
    border: 2px solid #00ff00;
    border-radius: 50%;
    -webkit-border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked {
    background-color: #00ff00;
    box-shadow: 0 0 8px #00ff00, inset 0 0 3px rgba(0, 0, 0, 0.5);
    -webkit-box-shadow: 0 0 8px #00ff00, inset 0 0 3px rgba(0, 0, 0, 0.5);
}

.radio-label:has(input[type="radio"]:checked) {
    background-color: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    -webkit-box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.form-info {
    background-color: #0a0a0a;
    border: 1px solid #00ff00;
    padding: 15px;
    margin-bottom: 20px;
    margin-top: 15px;
    border-radius: 5px;
    text-align: center;
}

.form-info p {
    color: #00ff00;
    font-size: 14px;
    margin: 0;
}

.form-info span {
    font-weight: bold;
    font-size: 18px;
    text-shadow: 0 0 5px #00ff00;
}

.submit-btn {
    width: calc(100% - 20px);
    padding: 14px 16px;
    margin: 10px;
    background-color: #000000;
    border: 2px solid #00ff00;
    color: #00ff00;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 5px;
    -webkit-border-radius: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px #00ff00;
    -webkit-box-shadow: 0 0 10px #00ff00;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

.submit-btn:active {
    background-color: #00ff00;
    color: #000000;
    transform: scale(0.98);
    -webkit-transform: scale(0.98);
    box-shadow: 0 0 20px #00ff00;
    -webkit-box-shadow: 0 0 20px #00ff00;
    opacity: 0.9;
}

.submit-btn:active {
    background-color: #00ff00;
    color: #000000;
    transform: scale(0.98);
    -webkit-transform: scale(0.98);
    box-shadow: 0 0 20px #00ff00;
    -webkit-box-shadow: 0 0 20px #00ff00;
    opacity: 0.9;
}

.modal.hidden {
    display: none;
}

.container {
    text-align: center;
    padding: 20px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.title {
    color: #ffffff;
    font-size: clamp(16px, 5vw, 36px);
    margin-bottom: clamp(20px, 5vh, 60px);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
}

.counter-display {
    font-size: clamp(20px, 8vw, 120px);
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: clamp(1px, 0.5vw, 4px);
    min-height: clamp(50px, 20vh, 200px);
    transition: color 0.3s ease;
    color: #00ff00;
    white-space: nowrap;
}

/* DEFCON Color States */
.counter-display.green {
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
}

.counter-display.amber {
    color: #ffaa00;
    text-shadow: 0 0 10px #ffaa00, 0 0 20px #ffaa00;
}

.counter-display.red {
    color: #ff0000;
    text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000;
}

/* Pause/Play Indicator */
.pause-play-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
    font-size: 80px;
    color: #ffffff;
    text-shadow: 0 0 20px #ffffff, 0 0 40px #ffffff;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
}

.indicator-icon {
    width: 80px;
    height: 80px;
    font-size: 80px;
    color: #ffffff;
    filter: drop-shadow(0 0 20px #ffffff) drop-shadow(0 0 40px #ffffff);
    -webkit-filter: drop-shadow(0 0 20px #ffffff) drop-shadow(0 0 40px #ffffff);
}

.pause-play-indicator.show {
    animation: pausePlayFade 1s ease-in-out;
    -webkit-animation: pausePlayFade 1s ease-in-out;
}

@keyframes pausePlayFade {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
}

@-webkit-keyframes pausePlayFade {
    0% {
        opacity: 0;
        -webkit-transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        -webkit-transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
        -webkit-transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        -webkit-transform: translate(-50%, -50%) scale(0.5);
    }
}

.control-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    -webkit-transform: translateX(-50%);
    color: #999999;
    font-size: clamp(12px, 2.5vw, 16px);
    letter-spacing: 0.5px;
    opacity: 0.8;
    z-index: 100;
    -webkit-user-select: none;
    user-select: none;
}

/* Landscape orientation adjustments */
@media (orientation: landscape) {
    body {
        height: 100vh;
    }
    
    .container {
        flex-direction: row;
        gap: 40px;
    }
    
    .title {
        writing-mode: vertical-rl;
        text-orientation: mixed;
        margin-bottom: 0;
        margin-right: 20px;
        font-size: clamp(14px, 4vw, 28px);
    }
    
    .counter-display {
        font-size: clamp(30px, 14vh, 180px);
        letter-spacing: clamp(1px, 0.8vw, 6px);
    }
}

/* Portrait orientation adjustments */
@media (orientation: portrait) {
    .container {
        flex-direction: column;
    }
    
    .title {
        writing-mode: horizontal-tb;
        margin-bottom: clamp(20px, 5vh, 40px);
    }
}

/* Small phones (< 500px width) */
@media (max-width: 500px) {
    .title {
        font-size: clamp(14px, 4vw, 20px);
        margin-bottom: clamp(15px, 4vh, 25px);
    }
    
    .counter-display {
        font-size: clamp(18px, 7vw, 60px);
        letter-spacing: clamp(0.5px, 0.4vw, 3px);
    }
}

/* Tablets (500px - 1024px) */
@media (min-width: 500px) and (max-width: 1024px) {
    .title {
        font-size: clamp(18px, 5vw, 28px);
        margin-bottom: clamp(20px, 5vh, 40px);
    }
    
    .counter-display {
        font-size: clamp(28px, 8vw, 90px);
        letter-spacing: clamp(1px, 0.6vw, 4px);
    }
}

/* Large screens (> 1024px) */
@media (min-width: 1024px) {
    .title {
        font-size: clamp(24px, 6vw, 40px);
        margin-bottom: clamp(30px, 6vh, 60px);
    }
    
    .counter-display {
        font-size: clamp(60px, 12vw, 160px);
        letter-spacing: clamp(3px, 1vw, 8px);
    }
}

/* Very small height screens */
@media (max-height: 400px) {
    .container {
        padding: 10px;
    }
    
    .title {
        font-size: clamp(12px, 3vw, 16px);
        margin-bottom: clamp(5px, 2vh, 15px);
    }
    
    .counter-display {
        font-size: clamp(16px, 8vh, 70px);
        min-height: auto;
    }
}

/* Reset Button */
.reset-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    -webkit-border-radius: 50%;
    background-color: #000000;
    border: 2px solid #00ff00;
    color: #00ff00;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px #00ff00;
    -webkit-box-shadow: 0 0 10px #00ff00;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    padding: 0;
}

.reset-btn:active {
    background-color: #00ff00;
    color: #000000;
    transform: scale(0.9);
    -webkit-transform: scale(0.9);
    box-shadow: 0 0 20px #00ff00;
    -webkit-box-shadow: 0 0 20px #00ff00;
}

.reset-btn:hover {
    box-shadow: 0 0 15px #00ff00;
    -webkit-box-shadow: 0 0 15px #00ff00;
}

/* Reset button responsive sizing */
@media (max-width: 500px) {
    .reset-btn {
        top: 12px;
        right: 12px;
        width: 45px;
        height: 45px;
        font-size: 24px;
    }
}