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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#clock-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.image-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 2s ease-in-out;
    opacity: 0;
}

.image-layer.active {
    opacity: 1;
}

#loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#loading-indicator.hidden {
    display: none;
}

#loading-message {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-style: italic;
    letter-spacing: 0.5px;
    text-align: center;
    white-space: pre-line;
    line-height: 1.8;
    animation: loading-message-fade 0.6s ease-in;
}

@keyframes loading-message-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hourglass {
    width: 32px;
    height: 32px;
    opacity: 0.6;
    animation: hourglass-flip 2s ease-in-out infinite;
}

@keyframes hourglass-flip {
    0%, 40% { transform: rotate(0deg); }
    50%, 90% { transform: rotate(180deg); }
    100% { transform: rotate(360deg); }
}

/* Vignette overlay */
#vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 60%,
        rgba(0, 0, 0, 0.4) 100%
    );
    pointer-events: none;
    z-index: 5;
}

/* Cursor auto-hide */
body.idle {
    cursor: none;
}

body.idle #clock-container {
    cursor: none;
}

/* Fullscreen cursor hint */
#clock-container {
    cursor: pointer;
}

/* Debug Panel */
#debug-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 16px 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#debug-panel.hidden {
    display: none;
}

.debug-info {
    display: flex;
    gap: 20px;
    font-size: 14px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.debug-info span {
    color: #aaa;
}

.debug-info span::before {
    color: #666;
    margin-right: 6px;
}

#debug-time::before {
    content: 'TIME';
}

#debug-template::before {
    content: 'TEMPLATE';
}

#debug-status::before {
    content: 'STATUS';
}

#debug-running-time::before {
    content: 'CLOCK';
}

.rating-buttons {
    display: flex;
    gap: 10px;
}

.rating-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

.rating-btn:hover {
    transform: scale(1.05);
}

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

.rating-btn.good {
    background: #22c55e;
    color: #fff;
}

.rating-btn.ok {
    background: #f59e0b;
    color: #fff;
}

.rating-btn.bad {
    background: #ef4444;
    color: #fff;
}

.rating-btn.dont-use {
    background: #6b7280;
    color: #fff;
}

.rating-btn.selected {
    opacity: 1;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.rating-btn:not(.selected) {
    opacity: 0.6;
}

#rating-feedback {
    font-size: 13px;
    color: #22c55e;
    padding: 4px 0;
}

#rating-feedback.hidden {
    display: none;
}

#rating-feedback.error {
    color: #ef4444;
}

#debug-log {
    margin-top: 12px;
    max-height: 120px;
    overflow-y: auto;
    font-size: 11px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    color: #888;
    border-top: 1px solid #333;
    padding-top: 8px;
}

.debug-log-entry {
    padding: 2px 0;
    border-bottom: 1px solid #222;
}

.debug-log-entry:last-child {
    border-bottom: none;
    color: #aaa;
}

/* Responsive */
@media (max-width: 600px) {
    .debug-info {
        flex-direction: column;
        gap: 8px;
    }

    .rating-buttons {
        flex-wrap: wrap;
    }

    .rating-btn {
        flex: 1;
        min-width: calc(50% - 5px);
    }
}
