/* Reset and Base Styles */
:root {
    --bg-color: #FFFBEB; /* Cream Yellow */
    --text-main: #fb923c; /* Orange */
    --text-soft: #94a3b8;
    --text-dark: #475569;
    --panel-bg: #ffffff;
    --panel-border: #fef08a; /* Soft yellow border */
    --panel-shadow: rgba(250, 204, 21, 0.15);
    
    --primary-color: #fca5a5;
    --primary-hover: #f87171;
    --primary-shadow: rgba(252, 165, 165, 0.4);
    
    --secondary-color: #94a3b8;
    --secondary-hover: #64748b;
    --secondary-shadow: rgba(148, 163, 184, 0.3);
    
    --ring-bg: #fef08a;
    --ring-color: #fca5a5;
    
    --chip-bg: #ffedd5;
    --chip-border: #fed7aa;
    --chip-text: #fb923c;
    
    --input-bg: #fffbeb;
    --msg-bg: #f1f5f9;
    --msg-self-bg: #ffe4e6;
    --msg-self-border: #fecdd3;
    
    --modal-overlay: rgba(255,251,235,0.8);
}

body.theme-12h { /* Mint / Green */
    --bg-color: #f0fdf4; 
    --text-main: #34d399; 
    --text-dark: #065f46;
    --panel-border: #bbf7d0; 
    --panel-shadow: rgba(74, 222, 128, 0.15);
    --primary-color: #6ee7b7; 
    --primary-hover: #34d399;
    --primary-shadow: rgba(110, 231, 183, 0.4);
    --ring-bg: #bbf7d0;
    --ring-color: #6ee7b7;
    --chip-bg: #dcfce7;
    --chip-border: #bbf7d0;
    --chip-text: #34d399;
    --input-bg: #f0fdf4;
    --modal-overlay: rgba(240,253,244,0.8);
}

body.theme-24h { /* Lavender / Purple */
    --bg-color: #faf5ff; 
    --text-main: #c084fc; 
    --text-dark: #6b21a8;
    --panel-border: #e9d5ff; 
    --panel-shadow: rgba(192, 132, 252, 0.15);
    --primary-color: #d8b4fe; 
    --primary-hover: #c084fc;
    --primary-shadow: rgba(216, 180, 254, 0.4);
    --ring-bg: #f3e8ff;
    --ring-color: #d8b4fe;
    --chip-bg: #f3e8ff;
    --chip-border: #e9d5ff;
    --chip-text: #c084fc;
    --input-bg: #faf5ff;
    --modal-overlay: rgba(250,245,255,0.8);
}

body.theme-36h { /* Dark Gold / Red */
    --bg-color: #1e293b; 
    --text-main: #fbbf24; 
    --text-soft: #64748b;
    --text-dark: #f8fafc;
    --panel-bg: #0f172a;
    --panel-border: #334155; 
    --panel-shadow: rgba(0,0,0, 0.5);
    --primary-color: #f59e0b; 
    --primary-hover: #d97706;
    --primary-shadow: rgba(245, 158, 11, 0.4);
    --secondary-color: #475569;
    --ring-bg: #334155;
    --ring-color: #fbbf24;
    --chip-bg: #1e293b;
    --chip-border: #334155;
    --chip-text: #fbbf24;
    --input-bg: #1e293b;
    --msg-bg: #1e293b;
    --msg-self-bg: #451a03;
    --msg-self-border: #78350f;
    --modal-overlay: rgba(15,23,42,0.8);
}

body.theme-48h { /* Deep Red / Dark */
    --bg-color: #1a0f14; 
    --text-main: #fb7185; 
    --text-soft: #9f1239;
    --text-dark: #fecdd3;
    --panel-bg: #28141d;
    --panel-border: #4c1d2e; 
    --panel-shadow: rgba(0,0,0, 0.5);
    --primary-color: #e11d48; 
    --primary-hover: #be123c;
    --primary-shadow: rgba(225, 29, 72, 0.4);
    --secondary-color: #4c1d2e;
    --ring-bg: #4c1d2e;
    --ring-color: #fb7185;
    --chip-bg: #28141d;
    --chip-border: #4c1d2e;
    --chip-text: #fb7185;
    --input-bg: #1a0f14;
    --msg-bg: #1a0f14;
    --msg-self-bg: #4c0519;
    --msg-self-border: #881337;
    --modal-overlay: rgba(26,15,20,0.8);
}

body.theme-refeeding { /* Sky Blue / Teal */
    --bg-color: #f0f9ff; 
    --text-main: #0ea5e9; 
    --text-soft: #64748b;
    --text-dark: #0c4a6e;
    --panel-border: #bae6fd; 
    --panel-shadow: rgba(14, 165, 233, 0.1);
    --primary-color: #38bdf8; 
    --primary-hover: #0ea5e9;
    --primary-shadow: rgba(56, 189, 248, 0.4);
    --ring-bg: #e0f2fe;
    --ring-color: #0ea5e9;
    --chip-bg: #f0f9ff;
    --chip-border: #bae6fd;
    --chip-text: #0ea5e9;
    --input-bg: #f0f9ff;
    --modal-overlay: rgba(240,249,255,0.8);
}


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

body {
    font-family: 'Jua', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.8s ease, color 0.8s ease;
}

.container {
    display: grid;
    grid-template-areas: 
        "main"
        "chat";
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 95%;
    max-width: 800px;
    margin: 1.5rem auto;
    z-index: 1;
}

@media (min-width: 1024px) {
    .container {
        grid-template-areas: "main chat";
        grid-template-columns: 1fr 320px;
        max-width: 1300px;
        height: calc(100vh - 5rem);
        gap: 2rem;
        align-items: stretch;
        margin: 2.5rem auto;
    }
}

.soft-panel {
    background: var(--panel-bg);
    border: 3px solid var(--panel-border);
    border-radius: 36px;
    box-shadow: 0 10px 30px var(--panel-shadow);
    transition: background 0.8s ease, border-color 0.8s ease, box-shadow 0.8s ease;
}

.main-content {
    grid-area: main;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    min-width: 0;
}

@media (min-width: 1100px) {
    .main-content {
        overflow-y: auto;
        padding-right: 1rem;
        scrollbar-width: thin;
        scrollbar-color: var(--panel-border) transparent;
    }
    .main-content::-webkit-scrollbar { width: 6px; }
    .main-content::-webkit-scrollbar-thumb { background: var(--panel-border); border-radius: 10px; }
}

.app-mode-nav {
    display: flex;
    background: var(--panel-bg);
    border: 2px solid var(--panel-border);
    border-radius: 20px;
    padding: 0.4rem;
    gap: 0.4rem;
    box-shadow: 0 4px 15px var(--panel-shadow);
    transition: all 0.5s ease;
}

.mode-tab {
    flex: 1;
    padding: 0.8rem;
    border: none;
    background: transparent;
    border-radius: 14px;
    font-family: 'Jua', sans-serif;
    font-size: 1.1rem;
    color: var(--text-soft);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-tab.active {
    background: var(--text-main);
    color: var(--panel-bg);
    box-shadow: 0 4px 10px var(--primary-shadow);
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    margin-bottom: 0.2rem;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.mascot-emoji {
    font-size: 2.2rem;
}

.header-logo h1 {
    font-size: 2.4rem;
    color: var(--text-main);
    margin-bottom: 0;
    text-shadow: 2px 2px 0px var(--chip-bg);
    transition: color 0.8s ease, text-shadow 0.8s ease;
}

.header-actions {
    display: flex;
    gap: 0.8rem;
}

.header-subtitle {
    color: var(--text-soft);
    font-size: 1rem;
    font-family: sans-serif;
    text-align: left;
    margin-bottom: 1rem;
    transition: color 0.8s ease;
}


.icon-btn {
    background: var(--chip-bg);
    border: none;
    color: var(--text-main);
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 0 var(--chip-border);
}

.icon-btn:hover {
    background: var(--chip-border);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--chip-border);
}

.icon-btn:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 var(--chip-border);
}

.icon-btn svg { width: 22px; height: 22px; }


.mascot-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 0.5rem;
    width: 100%;
}

.mascot-progress-container {
    position: relative;
    width: 95%;
    min-width: 380px; /* Strong presence on all screens */
    max-width: 500px; /* Increased max too to match the new minimum */
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem auto;
    transition: all 0.3s ease;
}

.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring__background {
    stroke: var(--ring-bg);
    stroke-width: 16px; /* Thicker */
    transition: stroke 0.8s ease;
}

.progress-ring__circle {
    stroke: var(--ring-color);
    stroke-width: 16px; /* Thicker */
    stroke-dasharray: 816;
    stroke-dashoffset: 816;
    transition: stroke-dashoffset 1s ease-in-out, stroke 0.8s ease;
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px var(--panel-shadow));
}

.mascot-img {
    width: 60%; /* Strictly proportional to the ring */
    height: auto;
    max-width: 260px;
    animation: floating 3s ease-in-out infinite;
    z-index: 2;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.15));
    transition: transform 0.3s ease;
}

.mascot-img.pop {
    animation: popEffect 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popEffect {
    0% { transform: scale(1); }
    50% { transform: scale(1.15) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.speech-bubble {
    background: var(--panel-bg);
    border: 3px solid var(--chip-border);
    border-radius: 24px;
    padding: 1rem 1.5rem;
    position: relative;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px var(--panel-shadow);
    z-index: 1;
    font-size: clamp(1rem, 3vw, 1.3rem); /* Fluid font size */
    color: var(--text-main);
    text-align: center;
    max-width: 90%;
    transition: all 0.8s ease;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 12px 12px 0;
    border-style: solid;
    border-color: var(--panel-bg) transparent transparent transparent;
    z-index: 2;
    transition: border-color 0.8s ease;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 14px 14px 0;
    border-style: solid;
    border-color: var(--chip-border) transparent transparent transparent;
    z-index: 1;
    transition: border-color 0.8s ease;
}

.timer-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
}

/* Mode Chips */
.mode-chips {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.chip {
    background: var(--chip-bg);
    border: 2px solid var(--chip-border);
    color: var(--chip-text);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-family: 'Jua', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    transform: scale(1.05);
}

.chip.active {
    background: var(--text-main);
    color: var(--panel-bg);
    border-color: var(--text-main);
    box-shadow: 0 4px 10px var(--panel-shadow);
}


.time-value {
    font-size: 3.5rem;
    color: var(--text-dark);
    line-height: 1;
    margin-bottom: 0.3rem;
    z-index: 2;
    text-shadow: 1px 1px 0px var(--chip-bg);
    transition: color 0.5s ease;
}

.time-label {
    font-size: 0.8rem;
    color: var(--text-soft);
    letter-spacing: 2px;
    font-family: sans-serif;
    font-weight: bold;
    z-index: 2;
    transition: color 0.5s ease;
}

.time-colon {
    font-size: 3.5rem;
    color: var(--text-soft);
    margin: 0 -0.5rem;
    padding-bottom: 1.5rem;
    animation: blink 1s infinite;
    transition: color 0.5s ease;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.timer-status {
    font-size: 1.3rem;
    color: var(--text-soft);
    margin-bottom: 1.5rem;
    transition: color 0.8s ease;
}

.timer-controls {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 2rem;
    font-size: 1.2rem;
    font-family: 'Jua', sans-serif;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--panel-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.primary-btn {
    background: var(--primary-color);
    box-shadow: 0 8px 15px var(--primary-shadow);
}

.primary-btn:hover {
    transform: translateY(-3px);
    background: var(--primary-hover);
}

.secondary-btn {
    background: var(--secondary-color);
    box-shadow: 0 8px 15px var(--secondary-shadow);
}

.secondary-btn:hover {
    transform: translateY(-3px);
    background: var(--secondary-hover);
}

.text-btn {
    background: none;
    border: none;
    color: var(--text-soft);
    font-family: 'Jua', sans-serif;
    font-size: 1rem;
    margin-top: 1rem;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.text-btn:hover {
    color: var(--text-dark);
}

.datetime-input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--chip-border);
    border-radius: 12px;
    font-family: sans-serif;
    font-size: 1rem;
    color: var(--text-dark);
    background: var(--input-bg);
    outline: none;
    transition: border-color 0.2s, background 0.8s ease, color 0.8s ease;
}

.datetime-input:focus {
    border-color: var(--text-main);
}

/* Chat Sidebar */
.chat-sidebar {
    grid-area: chat;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 1.2rem;
    min-height: 450px;
    border-left: none;
}

@media (min-width: 1100px) {
    .chat-sidebar {
        height: 100%;
        min-height: 0;
        border-left: 2px dashed var(--panel-border);
    }
}

.chat-header {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px dashed var(--chip-border);
}

.chat-header h2 {
    font-size: 1.2rem;
    color: var(--text-main);
    transition: color 0.8s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-header h2::before {
    content: '💬';
    font-size: 1.2rem;
}

.user-info-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nickname-input {
    background: var(--input-bg);
    border: 2px solid var(--chip-border);
    color: var(--text-main);
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
    width: 130px;
    outline: none;
    font-family: 'Jua', sans-serif;
    transition: all 0.3s ease;
}

.nickname-input:focus {
    border-color: var(--text-main);
    background: var(--panel-bg);
    box-shadow: 0 0 0 3px var(--panel-shadow);
}

.user-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--text-soft);
}

.dot {
    width: 10px;
    height: 10px;
    background-color: #34d399; /* Emerald */
    border-radius: 50%;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 0.5rem;
    margin-bottom: 1rem;
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar,
.modal-content::-webkit-scrollbar { width: 8px; }
.chat-messages::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
    background: var(--chip-bg);
    border-radius: 10px;
}
.chat-messages::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
    background: var(--text-main);
    border-radius: 10px;
}

.message {
    display: flex;
    flex-direction: column;
    padding: 0.8rem 1rem;
    border-radius: 16px;
    background: var(--msg-bg);
    font-size: 1rem;
    font-family: sans-serif;
    line-height: 1.4;
    max-width: 90%;
    word-break: break-word;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--text-dark);
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.message-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-family: 'Jua', sans-serif;
}

.self .message-header { justify-content: flex-end; }
.other .message-header { justify-content: flex-start; }

.message-nickname { font-weight: normal; }

.message-fasting-time {
    font-size: 0.8rem;
    background: var(--panel-border);
    color: var(--text-dark);
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
}

.message.self {
    align-self: flex-end;
    background: var(--msg-self-bg);
    border-bottom-right-radius: 4px;
    border: 2px solid var(--msg-self-border);
}

.message.other {
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 2px solid var(--panel-border);
}

.system-msg {
    align-self: center;
    background: transparent;
    border: none;
    color: var(--text-soft);
    font-size: 0.9rem;
    text-align: center;
    font-family: 'Jua', sans-serif;
}

.sticker-area {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    padding: 0 0.5rem;
    flex-wrap: wrap;
}

.sticker-btn {
    background: var(--chip-bg);
    border: 2px solid var(--chip-border);
    color: var(--text-main);
    padding: 0.4rem 0.6rem;
    border-radius: 12px;
    font-family: 'Jua', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sticker-btn:hover {
    background: var(--text-main);
    color: var(--panel-bg);
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 4px 10px var(--panel-shadow);
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
    background: var(--msg-bg);
    border-radius: 100px;
    padding: 0.5rem;
    border: 2px solid var(--panel-border);
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dark);
    padding: 0 1rem;
    font-size: 1rem;
    font-family: sans-serif;
    outline: none;
}

#chat-input::placeholder {
    color: var(--text-soft);
}

.send-btn {
    background: var(--primary-color);
    color: var(--panel-bg);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.send-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.send-btn svg { width: 20px; height: 20px; }

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: var(--modal-overlay);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, background 0.8s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 2.5rem;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: var(--text-main);
}

.timeline {
    list-style: none;
    position: relative;
    padding-left: 1.5rem;
    font-family: sans-serif;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--chip-border);
    border-radius: 2px;
}

.timeline li {
    position: relative;
    margin-bottom: 1.5rem;
}
.timeline li:last-child { margin-bottom: 0; }

.timeline li::before {
    content: '';
    position: absolute;
    left: -1.5rem; top: 5px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid var(--panel-bg);
    transform: translateX(-6px);
}

.time-badge {
    display: inline-block;
    background: var(--primary-color);
    color: var(--panel-bg);
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-family: 'Jua', sans-serif;
}

.time-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-dark);
    text-align: left;
}

.time-desc strong {
    color: var(--text-main);
    font-size: 1.05rem;
}

/* History List */
.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--input-bg);
    border: 2px solid var(--chip-border);
    padding: 1rem;
    border-radius: 16px;
    margin-bottom: 0.8rem;
    font-family: sans-serif;
}

.history-item:last-child { margin-bottom: 0; }

.history-date {
    color: var(--text-soft);
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.history-duration {
    color: var(--text-main);
    font-weight: bold;
    font-size: 1.1rem;
}

.history-item-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.delete-history-btn {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.delete-history-btn:hover {
    background: #ef4444;
    color: #fff;
    transform: scale(1.1);
}

/* --- Premium Safe-Clock (Maximum Stability) --- */
.timer-display {
    display: flex;
    gap: 1.2rem;
    margin: 2.5rem 0;
    justify-content: center;
    align-items: center;
}

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

.clock-card {
    position: relative;
    min-width: 100px;
    width: fit-content;
    padding: 0 0.8rem;
    height: 120px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 16px;
    box-shadow: 0 12px 30px var(--panel-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    font-weight: 900;
    color: var(--text-dark);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Permanent Visual Split Line (Mimics Flip Clock) */
.clock-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(0,0,0,0.1);
    z-index: 10;
    transform: translateY(-50%);
}

/* Subtle 3D Depth Shadow */
.clock-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.02), transparent);
    pointer-events: none;
}

/* The 'Safe-Flip' Shutter Animation */
.clock-card.update {
    animation: safeShutter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-main);
}

@keyframes safeShutter {
    0% { transform: scaleY(1); filter: brightness(1); }
    40% { transform: scaleY(0.4); filter: brightness(1.3); }
    100% { transform: scaleY(1); filter: brightness(1); }
}

.time-label {
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--text-soft);
    font-weight: 800;
    text-transform: uppercase;
}

.time-colon {
    font-size: 3.5rem;
    color: var(--text-main);
    font-weight: 800;
    margin-top: -20px;
}

@media (max-width: 600px) {
    .clock-card {
        width: 80px;
        height: 100px;
        font-size: 3.5rem;
        border-radius: 12px;
    }
    .timer-display { gap: 0.8rem; }
    .time-colon { font-size: 2.5rem; }
}
