/* START: Global Configuration */
html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Press Start 2P', cursive;
}

.fullscreen-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    transition: background-color 0.5s ease, color 0.5s ease;
    position: relative;
}

/* END: Global Configuration */

/* START: Fantasy Themes */
/* Default Theme (Dark) */
.theme-default {
    background-color: #212529;
    color: #ffffff;
}

.theme-default #time,
.theme-default #date {
    color: #ffffff;
}

/* Forest Theme (Green) */
.theme-forest {
    background-color: #2d5a27;
    color: #e0ffe0;
}

.theme-forest #time {
    color: #90ee90;
}

.theme-forest #date {
    color: #c1ffc1;
}

/* Dungeon Theme (Purple/Grey) */
.theme-dungeon {
    background-color: #2c2c54;
    color: #d1d1ff;
}

.theme-dungeon #time {
    color: #aaaaff;
}

.theme-dungeon #date {
    color: #ccccff;
}

/* Dragon Theme (Red/Orange) */
.theme-dragon {
    background-color: #8b0000;
    color: #ffebcd;
}

.theme-dragon #time {
    color: #ffa500;
}

.theme-dragon #date {
    color: #ffd700;
}

/* END: Fantasy Themes */

/* START: UI Elements */
.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    z-index: 10;
}

.site-title {
    font-size: 0.8rem;
    opacity: 0.8;
}

.top-right {
    display: flex;
    gap: 10px;
}

/* END: UI Elements */

/* START: Clock Styles */
.full-width-clock {
    width: 95vw;
    max-width: 1600px;
    text-align: center;
    padding: 2rem !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    border: none !important;
    z-index: 2;
}

.clock-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    cursor: pointer;
    transition: background 0.2s, color 0.5s ease;
    padding: 10px 20px;
}

#editable-title:hover {
    background: rgba(255, 255, 255, 0.1);
}

.bg-icons {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
    opacity: 0.28;
}

.theme-default .bg-icons {
    filter: none;
}

.theme-forest .bg-icons {
    filter: hue-rotate(95deg) saturate(1.15) brightness(1.05);
}

.theme-dungeon .bg-icons {
    filter: hue-rotate(235deg) saturate(1.05) brightness(0.95);
}

.theme-dragon .bg-icons {
    filter: hue-rotate(15deg) saturate(1.35) brightness(1.02);
}

.bg-icons .nes-icon {
    position: absolute;
    opacity: 1;
    will-change: transform;
    animation: bg-float var(--float-duration, 14s) ease-in-out var(--float-delay, 0s) infinite;
    transform: translate3d(-50%, -50%, 0) scale(var(--icon-scale, 1));
}

@keyframes bg-float {
    0% {
        transform: translate3d(-50%, -50%, 0) scale(var(--icon-scale, 1)) rotate(calc(var(--icon-rotate, 0deg) * -1));
    }

    50% {
        transform: translate3d(calc(-50% + var(--drift-x, 24px)), calc(-50% + var(--drift-y, -28px)), 0) scale(var(--icon-scale, 1)) rotate(var(--icon-rotate, 0deg));
    }

    100% {
        transform: translate3d(-50%, -50%, 0) scale(var(--icon-scale, 1)) rotate(calc(var(--icon-rotate, 0deg) * -1));
    }
}

.time-text {
    font-size: 12vw;
    margin: 40px 0;
    transition: color 0.5s ease;
    line-height: 1;
}

.date-text {
    font-size: 2.5vw;
    opacity: 0.8;
    transition: color 0.5s ease;
}

/* END: Clock Styles */

/* START: Dialog Styles */
#support-dialog {
    max-width: 600px;
    width: 90%;
    background-color: #fff;
    color: #212529;
}

#support-dialog .title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: block;
}

.links-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.support-link-item {
    display: block;
    padding: 15px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.1s;
}

.support-link-item:hover {
    transform: scale(1.02);
}

.link-name {
    font-weight: bold;
    display: block;
    font-size: 0.9rem;
    color: #209cee;
    margin-bottom: 5px;
}

.link-desc {
    font-size: 0.7rem;
    display: block;
    line-height: 1.4;
}

.dialog-menu {
    margin-top: 30px;
    text-align: right;
}

/* END: Dialog Styles */

/* START: Mobile Responsiveness */
@media (max-width: 768px) {
    .time-text {
        font-size: 3rem;
    }

    .date-text {
        font-size: 0.8rem;
    }

    #clock-display {
        padding: 1.5rem;
        min-width: 250px;
    }

    .ui-overlay {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .top-right {
        width: 100%;
        justify-content: flex-end;
    }
}

/* END: Mobile Responsiveness */
