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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background-color: #000000;
    color: #ff0000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}


#app {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.clock-display {
    opacity: 1;
    transition: opacity 0.5s ease-in-out, filter 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    cursor: grab;
}

.clock-display.dragging {
    cursor: grabbing;
}

.clock-display.hidden {
    opacity: 0 !important;
    pointer-events: none;
    filter: brightness(0) !important;
}

.time {
    font-family: 'Orbitron', monospace;
    font-size: clamp(3rem, 15vw, 8rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    color: #ff0000;
    text-align: center;
    padding: 0 1rem;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.5), 0 0 40px rgba(255, 0, 0, 0.3);
    line-height: 1.2;
}

.countdown-bar {
    position: absolute;
    bottom: 30%;
    width: 60%;
    max-width: 400px;
    height: 4px;
    background-color: rgba(255, 0, 0, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.countdown-bar-fill {
    height: 100%;
    width: 100%;
    background-color: #ff0000;
    transform-origin: left center;
    animation: countdown 5s linear forwards;
}

@keyframes countdown {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

.settings-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #ff0000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    background-color: rgba(255, 0, 0, 0.1);
    transform: rotate(90deg);
}

.settings-btn:active {
    transform: rotate(90deg) scale(0.95);
}


.wake-lock-btn {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: none;
    border: 1px solid #ff0000;
    color: #ff0000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.3s ease;
}

.wake-lock-btn:hover {
    background-color: rgba(255, 0, 0, 0.1);
    transform: scale(1.1);
}

.wake-lock-btn:active {
    transform: scale(0.95);
}

.wake-lock-btn.active {
    background-color: rgba(255, 0, 0, 0.2);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
}

.activation-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.activation-content {
    text-align: center;
    padding: 2rem;
    max-width: 800px;
    width: 90%;
}

.activation-content h1 {
    color: #ff0000;
    font-family: 'Orbitron', monospace;
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
}

.activation-content p {
    color: rgba(255, 0, 0, 0.8);
    font-size: clamp(1rem, 4vw, 1.25rem);
    margin-bottom: 3rem;
    line-height: 1.4;
}

.activate-clock-btn {
    background: none;
    border: 2px solid #ff0000;
    color: #ff0000;
    padding: 1.5rem 3rem;
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    font-weight: 500;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0 auto;
    min-width: 280px;
    letter-spacing: 0.025em;
}

.activate-clock-btn:hover {
    background-color: rgba(255, 0, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.2);
}

.activate-clock-btn:active {
    transform: translateY(0);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3);
}

.activate-clock-btn svg {
    flex-shrink: 0;
}


.show-time-btn {
    background: none;
    border: 1px solid #ff0000;
    color: #ff0000;
    padding: 1rem 4rem;
    font-size: 1.3rem;
    cursor: pointer;
    border-radius: 2rem;
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    min-width: 200px;
}

.show-time-btn:hover {
    background-color: rgba(255, 0, 0, 0.1);
}

.show-time-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.hidden-time-info {
    position: absolute;
    left: 50%;
    top: 60%;
    transform: translateX(-50%);
    color: #ff0000;
    opacity: 0.7;
    font-size: 1rem;
    text-align: center;
    animation: fadeIn 0.5s forwards;
    white-space: nowrap;
}

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

.settings-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background-color: #1a0000;
    border-left: 1px solid #ff0000;
    transition: right 0.3s ease;
    z-index: 200;
    display: flex;
    flex-direction: column;
}

.settings-panel.open {
    right: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 0, 0, 0.3);
}

.settings-header h2 {
    color: #ff0000;
    font-size: 1.5rem;
    font-weight: 400;
}

.close-btn {
    background: none;
    border: none;
    color: #ff0000;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.close-btn:hover {
    transform: scale(1.1);
}

.close-btn:active {
    transform: scale(0.95);
}

.settings-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.setting-group {
    margin-bottom: 2.5rem;
}

.setting-group label {
    display: block;
    color: #ff0000;
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
    opacity: 0.9;
    font-weight: 500;
}

.setting-control {
    width: 100%;
    padding: 1rem 1.25rem;
    background-color: #000000;
    border: 1px solid #ff0000;
    color: #ff0000;
    font-size: 1.15rem;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
    min-height: 60px;
    box-sizing: border-box;
}

.setting-control:focus {
    border-color: #ff3333;
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.2);
}

select.setting-control {
    cursor: pointer;
}

input[type="time"].setting-control {
    color-scheme: dark;
    -webkit-appearance: none;
    appearance: none;
}

/* Custom time display inputs */
.time-display {
    cursor: pointer;
    position: relative;
    padding-right: 3rem;
}

.time-display::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ff0000' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E");
    background-size: contain;
    opacity: 0.8;
}

.time-display:hover::after {
    opacity: 1;
}

/* Custom Time Picker Overlay */
.time-picker-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 300;
    animation: fadeIn 0.3s ease;
}

.time-picker-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-picker-container {
    background-color: #1a0000;
    border: 1px solid #ff0000;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    padding: 1.5rem;
}

.time-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 0, 0, 0.3);
}

.time-picker-header h3 {
    color: #ff0000;
    font-size: 1.3rem;
    font-weight: 400;
}

.time-picker-display {
    text-align: center;
    margin-bottom: 2rem;
}

.time-picker-display span {
    font-size: 2.5rem;
    color: #ff0000;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.time-picker-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.time-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.time-separator {
    font-size: 2rem;
    color: #ff0000;
    padding: 0 0.5rem;
}

.time-value {
    font-size: 2rem;
    color: #ff0000;
    width: 80px;
    text-align: center;
    padding: 0.5rem;
    border: 1px solid #ff0000;
    border-radius: 4px;
    background-color: #000000;
}

.period-column .time-value {
    width: 60px;
}

.time-adjust-btn {
    background: none;
    border: 1px solid #ff0000;
    color: #ff0000;
    width: 50px;
    height: 35px;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.time-adjust-btn:hover {
    background-color: rgba(255, 0, 0, 0.1);
}

.time-adjust-btn:active {
    transform: scale(0.95);
    background-color: rgba(255, 0, 0, 0.2);
}

.time-picker-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.time-picker-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #ff0000;
}

.cancel-btn {
    background-color: transparent;
    color: #ff0000;
}

.cancel-btn:hover {
    background-color: rgba(255, 0, 0, 0.1);
}

.confirm-btn {
    background-color: #ff0000;
    color: #000000;
    border: none;
    font-weight: 500;
}

.confirm-btn:hover {
    background-color: #cc0000;
}

.time-picker-btn:active {
    transform: scale(0.98);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 1rem 1.25rem;
    background-color: #000000;
    border: 1px solid #ff0000;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.checkbox-label:hover {
    background-color: rgba(255, 0, 0, 0.05);
}

.checkbox-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-right: 1rem;
    accent-color: #ff0000;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label span {
    color: #ff0000;
    font-size: 1.15rem;
}

.save-btn {
    width: 100%;
    padding: 1.25rem;
    background-color: #ff0000;
    color: #000000;
    border: none;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 2.5rem;
    letter-spacing: 0.025em;
}

.save-btn:hover {
    background-color: #cc0000;
}

.save-btn:active {
    transform: scale(0.98);
}

@media (max-width: 480px) {
    .settings-panel {
        max-width: 100%;
    }
    
    .time {
        font-size: clamp(2.5rem, 18vw, 6rem);
    }
    
    .countdown-bar {
        bottom: 25%;
        width: 70%;
    }
    
    /* Mobile optimizations for time picker */
    .time-picker-container {
        width: 95%;
        padding: 1rem;
    }
    
    .time-adjust-btn {
        width: 60px;
        height: 45px;
        font-size: 1.5rem;
    }
    
    .time-value {
        font-size: 2.5rem;
        width: 90px;
        padding: 0.75rem;
    }
    
    .period-column .time-value {
        width: 70px;
    }
    
    .time-picker-display span {
        font-size: 3rem;
    }
}

/* Mobile landscape orientation */
@media (max-height: 480px) and (orientation: landscape) {
    .time {
        font-size: clamp(4rem, 20vw, 12rem);
        line-height: 1.1;
    }
    
    .settings-panel {
        max-width: 60%;
        width: 60%;
    }
    
    .settings-header {
        padding: 0.75rem 1.5rem;
    }
    
    .settings-header h2 {
        font-size: 1.2rem;
    }
    
    .settings-content {
        padding: 0.75rem 1.5rem;
        display: flex;
        flex-wrap: wrap;
        gap: 1.5rem;
        overflow-y: auto;
    }
    
    .setting-group {
        flex: 1;
        min-width: 200px;
        margin-bottom: 0.75rem;
    }
    
    .setting-group label {
        margin-bottom: 0.3rem;
        font-size: 0.85rem;
    }
    
    .setting-control {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .save-btn {
        padding: 0.6rem;
        font-size: 1rem;
        margin-top: 0.5rem;
    }
    
    .checkbox-label span {
        font-size: 0.9rem;
    }
    
    .checkbox-label input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin-right: 0.5rem;
    }
}

/* Enhanced mobile landscape for small screens */
@media (max-height: 420px) and (orientation: landscape) {
    .settings-panel {
        max-width: 70%;
        width: 70%;
    }
    
    .settings-content {
        flex-direction: row;
        padding: 0.5rem 1rem;
    }
    
    .setting-group {
        flex: 1;
        margin-bottom: 0.5rem;
    }
}

@media (min-width: 768px) {
    .time {
        font-size: clamp(4rem, 20vw, 10rem);
    }
}

@media (min-width: 1200px) {
    .time {
        font-size: 10rem;
    }
}

/* Portrait orientation styles */
@media (orientation: portrait) {
    .time.portrait-mode {
        font-family: 'Orbitron', monospace;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        line-height: 0.75;
        font-size: clamp(8rem, 28vw, 25rem);
        font-weight: 900;
        letter-spacing: 0.1em;
        text-shadow: 
            0 0 30px rgba(255, 0, 0, 0.8),
            0 0 60px rgba(255, 0, 0, 0.5),
            0 0 90px rgba(255, 0, 0, 0.3);
        margin: 0;
        padding: 0 2rem;
        gap: 2rem;
    }
    
    .time.portrait-mode .hours {
        display: block;
        width: 100%;
        text-align: center;
        margin: 0;
        padding: 0 1rem;
    }
    
    .time.portrait-mode .minutes {
        display: block;
        width: 100%;
        text-align: center;
        margin: 0;
        padding: 0 1rem;
    }
    
    .time.portrait-mode .period {
        display: block;
        width: 100%;
        text-align: center;
        margin: 0;
        padding: 0 1rem;
        font-size: clamp(3rem, 10vw, 8rem);
        opacity: 0.9;
    }
}

/* Small screen portrait optimization */
@media (orientation: portrait) and (max-width: 480px) {
    .time.portrait-mode {
        font-size: clamp(10rem, 32vw, 28rem);
        padding: 0 1.5rem;
        gap: 1.5rem;
        text-shadow: 
            0 0 40px rgba(255, 0, 0, 0.9),
            0 0 80px rgba(255, 0, 0, 0.6),
            0 0 120px rgba(255, 0, 0, 0.4);
    }
    
    .countdown-bar {
        bottom: 20%;
        width: 75%;
    }
}

/* Extra small screen portrait */
@media (orientation: portrait) and (max-width: 320px) {
    .time.portrait-mode {
        font-size: clamp(8rem, 35vw, 25rem);
        padding: 0 1rem;
        gap: 1rem;
        text-shadow: 
            0 0 35px rgba(255, 0, 0, 0.9),
            0 0 70px rgba(255, 0, 0, 0.6),
            0 0 105px rgba(255, 0, 0, 0.4);
    }
    
    .countdown-bar {
        bottom: 18%;
        width: 80%;
    }
}

/* Landscape mode - tighter line spacing for wrapped text */
@media (orientation: landscape) {
    .time:not(.portrait-mode) {
        line-height: 0.95;
    }
    
    /* Make AM/PM smaller in landscape to match portrait size */
    .time:not(.portrait-mode) .period {
        font-size: 0.35em;
        opacity: 0.9;
        vertical-align: middle;
        margin-left: 0.1em;
    }
}



@media (max-width: 480px) {
    .prompt-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .prompt-content h3 {
        font-size: 1.5rem;
    }
    
    .prompt-content p {
        font-size: 1rem;
    }
    
    .activate-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1.1rem;
        min-width: 180px;
    }
}



