.red    { --primary: #ff6b6b; }
.cyan   { --primary: #22d3ee; }
.blue   { --primary: #4f6fff; }
.green  { --primary: #51cf66; }
.purple { --primary: #b197fc; }
.pink   { --primary: #ff8787; }

.red #clock {
    color: var(--clock-color, #000000);
}

#body {
    --bg: #080e14;
    --text: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.12);
}

#body.dark-mode {
    --bg: #080e14;
    --text: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.12);
}

#body.light-mode {
    --bg: #f1f5f9;
    --text: #000000;
    --card-bg: rgba(255, 255, 255, 0.9);
    --border: rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'DynaPuff', system-ui, sans-serif;
    margin: 0;
    transition: background 0.3s, color 0.3s;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px 60px 20px;
}

#customizeSection {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    z-index: 100;
}

#customizeSection .customize-label {
    font-size: 0.7em;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.customize-select-group { display: flex; gap: 8px; }

select, input {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--primary);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9em;
    outline: none;
}

select option { background-color: #0f172a; color: #ffffff; }
#body.light-mode select option { background-color: #ffffff; color: #0f172a; }

#editButton {
    position: absolute;
    top: 16px;
    right: 16px;
    color: var(--text);
    z-index: 100;
}

#clock {
    font-size: 8.5em;
    font-weight: 700;
    color: var(--clock-color, var(--text));
    text-shadow: 10px 10px 0 var(--primary);
    margin: 20px 0 0 0;
}

#clock .clock-period, #clock small {
    font-size: 0.45em;
    margin-left: 10px;
    vertical-align: baseline;
    text-shadow: 4px 4px 0 var(--primary);
}

#date {
    font-size: 1.25em;
    font-weight: 700;
    margin: 10px 0 35px 0;
}

#searchDiv {
    position: relative;
    display: flex;
    align-items: center;
    width: 50%;
    max-width: 600px;
    margin-bottom: 30px;
}

#search {
    width: 100%;
    border: 2px solid var(--primary);
    border-radius: 50px;
    background: transparent;
    padding: 14px 48px 14px 22px;
    font-size: 1.05em;
}

#searchIcon {
    position: absolute;
    right: 20px;
    cursor: pointer;
}

#shortcuts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    width: 100%;
    margin-bottom: 35px;
}

.shortcut-tile {
    width: 95px;
    height: 95px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    text-decoration: none;
    backdrop-filter: blur(10px);
    transition: transform 0.2s, border-color 0.2s;
}

.shortcut-tile:hover {
    transform: scale(1.05);
    border-color: var(--primary);
}

.shortcut-favicon { width: 28px; height: 28px; border-radius: 4px; }
.shortcut-label { font-size: 0.75em; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#todoSection {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 440px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

#todoSection h3 {
    margin: 0 0 16px 0;
    font-size: 0.9em;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#todoInput { display: flex; gap: 8px; margin-bottom: 16px; }
#todoInput input { flex: 1; }
#todoInput button { background: var(--primary); color: #fff; border: none; border-radius: 6px; padding: 0 16px; cursor: pointer; font-weight: bold; }

#todoList { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
#todoList li { padding: 10px 14px; background: rgba(255, 255, 255, 0.04); border-radius: 8px; display: flex; justify-content: space-between; border-left: 4px solid var(--primary); }
.todoComplete { text-decoration: line-through; opacity: 0.5; }
.todoDelete { background: none; border: none; color: var(--text); cursor: pointer; opacity: 0.6; }

#rssFeed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1100px;
}

.newsCard {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.newsImg {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 4px;
}

.newsTitle { margin: 0; font-size: 1.05em; }
.newsDateTime { font-size: 0.75em; opacity: 0.8; }
.newsDesc { font-size: 0.88em; opacity: 0.8; flex-grow: 1; margin: 4px 0; }
.newsLink { color: var(--primary); font-weight: bold; text-decoration: none; font-size: 0.85em; }

@media (max-width: 768px) {
    #clock { font-size: 5em; text-shadow: 6px 6px 0 var(--primary); }
    #searchDiv { width: 90%; }
}
