/* Flip Clock Online - /app/flip-clock/. Moved out of the page 16 Oct 2026. */
.flip-tool { max-width: 1080px; margin: 0 auto; }

.hero-section {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: linear-gradient(135deg, #0a1018 0%, #050810 100%);
    border-radius: 8px;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    border: 1px solid #1a2030;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 70%, rgba(75, 178, 213, 0.10) 0%, transparent 50%), radial-gradient(circle at 70% 30%, rgba(245, 158, 11, 0.06) 0%, transparent 50%);
    pointer-events: none;
}
.hero-section__icon { width: 100px; height: 100px; margin: 0 auto 1.25rem; position: relative; z-index: 1; color: #4bb2d5; font-size: 5rem; line-height: 100px; filter: drop-shadow(0 0 18px rgba(75, 178, 213, 0.5)); }
.hero-section__title { font-size: 1.75rem; font-weight: 600; color: #fff; margin: 0 0 0.5rem; position: relative; z-index: 1; font-family: 'Segoe UI', system-ui, sans-serif; }
.hero-section__subtitle { font-size: 1rem; color: rgba(255, 255, 255, 0.6); margin: 0; max-width: 600px; margin-left: auto; margin-right: auto; line-height: 1.5; position: relative; z-index: 1; font-family: 'Segoe UI', system-ui, sans-serif; }

/* ============================================
   FLIP CLOCK STAGE - LIVE PREVIEW
   ============================================ */
.flip-stage {
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 100%);
    border-radius: 12px;
    padding: 3rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    position: relative;
    border: 1px solid #2a2a2a;
    --card-bg: #1a1a1a;
    --card-text: #fefefe;
    --card-border: #2a2a2a;
    --card-divider: rgba(0,0,0,0.6);
    --card-shadow: rgba(0,0,0,0.5);
    --stage-bg: #0a0a0a;
    --label-color: rgba(255,255,255,0.5);
    --ampm-color: #4bb2d5;
    --cw: clamp(28px, 10vw, 100px); /* card width - every part of the clock is sized from it */
    transition: background 0.4s ease;
    background: var(--stage-bg);
}

.flip-row { display: flex; gap: calc(var(--cw) * 0.14); align-items: center; justify-content: center; flex-wrap: nowrap; max-width: 100%; }
.flip-group { display: flex; flex-direction: column; align-items: center; gap: max(4px, calc(var(--cw) * 0.08)); }
.flip-group__label { font-size: max(9px, calc(var(--cw) * 0.12)); white-space: nowrap; text-transform: uppercase; letter-spacing: 0.15em; color: var(--label-color); font-family: 'Segoe UI', sans-serif; font-weight: 500; }
.flip-pair { display: flex; gap: calc(var(--cw) * 0.08); }
.flip-colon { font-size: calc(var(--cw) * 0.9); color: var(--card-text); font-weight: 700; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 1; padding: 0 4px; opacity: 0.85; user-select: none; align-self: center; animation: blink 2s ease-in-out infinite; }
@keyframes blink { 0%, 50%, 100% { opacity: 0.85; } 25%, 75% { opacity: 0.35; } }

/* Individual flip card */
.flip-card {
    position: relative;
    flex: 0 0 auto;
    width: var(--cw);
    height: calc(var(--cw) * 1.4);
    perspective: calc(var(--cw) * 6);
    -webkit-perspective: calc(var(--cw) * 6);
    --r: calc(var(--cw) * 0.08);
    border-radius: var(--r);
}

/* The static halves (always visible) */
.flip-card__half {
    position: absolute;
    left: 0; right: 0;
    height: 50%;
    background: var(--card-bg);
    color: var(--card-text);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
    font-size: calc(var(--cw) * 1.1);
    line-height: 1;
    box-shadow: 0 4px 12px var(--card-shadow);
    border: 1px solid var(--card-border);
}
.flip-card__half--top {
    top: 0;
    border-radius: var(--r) var(--r) 0 0;
    align-items: flex-end;
    border-bottom: 1px solid var(--card-divider);
}
.flip-card__half--top span { transform: translateY(50%); display: block; }
.flip-card__half--bottom {
    bottom: 0;
    border-radius: 0 0 var(--r) var(--r);
    align-items: flex-start;
    border-top: 1px solid var(--card-divider);
}
.flip-card__half--bottom span { transform: translateY(-50%); display: block; }

/* The animating leaves */
.flip-card__leaf {
    position: absolute;
    left: 0; right: 0;
    height: 50%;
    background: var(--card-bg);
    color: var(--card-text);
    display: flex;
    justify-content: center;
    overflow: hidden;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
    font-size: calc(var(--cw) * 1.1);
    line-height: 1;
    transform-origin: bottom center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border: 1px solid var(--card-border);
}
.flip-card__leaf--top {
    top: 0;
    border-radius: var(--r) var(--r) 0 0;
    align-items: flex-end;
    transform-origin: bottom center;
    border-bottom: 1px solid var(--card-divider);
    z-index: 2;
}
.flip-card__leaf--top span { transform: translateY(50%); display: block; }
.flip-card__leaf--bottom {
    bottom: 0;
    border-radius: 0 0 var(--r) var(--r);
    align-items: flex-start;
    transform: rotateX(90deg);
    transform-origin: top center;
    border-top: 1px solid var(--card-divider);
    z-index: 1;
}
.flip-card__leaf--bottom span { transform: translateY(-50%); display: block; }

/* Animation: top leaf flips down 90deg, bottom leaf flips up from 90 to 0 */
/* 0.3s + 0.3s: the flip finishes well inside one second, so the next tick never lands mid-flip.
   Keep FLIP_MS in the page script in step with these durations. */
.flip-card.flipping .flip-card__leaf { will-change: transform; }
.flip-card.flipping .flip-card__leaf--top {
    animation: flipTop 0.3s ease-in forwards;
}
.flip-card.flipping .flip-card__leaf--bottom {
    animation: flipBottom 0.3s 0.3s ease-out forwards;
}
@keyframes flipTop {
    0% { transform: rotateX(0); }
    100% { transform: rotateX(-90deg); }
}
@keyframes flipBottom {
    0% { transform: rotateX(90deg); }
    100% { transform: rotateX(0); }
}

/* AM/PM marker */
.flip-ampm {
    color: var(--ampm-color);
    font-size: max(11px, calc(var(--cw) * 0.2));
    font-weight: 700;
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 2px;
    margin-left: 0.5rem;
    align-self: flex-end;
    margin-bottom: 0.5rem;
}

/* Date line */
.flip-date {
    margin-top: 1.75rem;
    font-size: clamp(13px, calc(var(--cw) * 0.2), 22px);
    color: var(--label-color);
    font-family: 'Segoe UI', sans-serif;
    font-weight: 400;
    letter-spacing: 1px;
    text-align: center;
}

/* THEMES */
.flip-stage[data-theme="classic"] { --stage-bg: #0a0a0a; --card-bg: linear-gradient(180deg,#1a1a1a 0%,#222 50%,#1a1a1a 100%); --card-text: #fefefe; --card-border: #2a2a2a; --card-divider: rgba(0,0,0,0.7); --card-shadow: rgba(0,0,0,0.6); --label-color: rgba(255,255,255,0.55); --ampm-color: #4bb2d5; }
.flip-stage[data-theme="light"] { --stage-bg: #f0eee7; --card-bg: linear-gradient(180deg,#fbfaf6 0%,#fff 50%,#fbfaf6 100%); --card-text: #1a1a1a; --card-border: #d8d4c8; --card-divider: rgba(0,0,0,0.12); --card-shadow: rgba(0,0,0,0.18); --label-color: rgba(0,0,0,0.55); --ampm-color: #ce3527; }
.flip-stage[data-theme="sepia"] { --stage-bg: #1a1208; --card-bg: linear-gradient(180deg,#3a2a14 0%,#4a3618 50%,#3a2a14 100%); --card-text: #f4e4b8; --card-border: #5a4220; --card-divider: rgba(0,0,0,0.5); --card-shadow: rgba(0,0,0,0.6); --label-color: rgba(244,228,184,0.55); --ampm-color: #f4a460; }
.flip-stage[data-theme="neon"] { --stage-bg: #050518; --card-bg: linear-gradient(180deg,#0e0b2c 0%,#15123c 50%,#0e0b2c 100%); --card-text: #00ff88; --card-border: #2a1e6b; --card-divider: rgba(0,255,136,0.15); --card-shadow: rgba(0,255,136,0.2); --label-color: rgba(0,255,136,0.6); --ampm-color: #ff00aa; }
.flip-stage[data-theme="neon"] .flip-card__half, .flip-stage[data-theme="neon"] .flip-card__leaf { text-shadow: 0 0 16px var(--card-text), 0 0 32px var(--card-text); }
.flip-stage[data-theme="wood"] { --stage-bg: #2a1810; --card-bg: linear-gradient(180deg,#5a3a1f 0%,#704522 50%,#5a3a1f 100%); --card-text: #f5e8c8; --card-border: #3a2410; --card-divider: rgba(0,0,0,0.5); --card-shadow: rgba(0,0,0,0.7); --label-color: rgba(245,232,200,0.55); --ampm-color: #ffd95a; }
.flip-stage[data-theme="airport"] { --stage-bg: #0a1a0a; --card-bg: linear-gradient(180deg,#0a0a0a 0%,#111 50%,#0a0a0a 100%); --card-text: #ffd95a; --card-border: #1a1a1a; --card-divider: rgba(0,0,0,0.85); --card-shadow: rgba(0,0,0,0.8); --label-color: rgba(255,217,90,0.6); --ampm-color: #ff6b00; }
.flip-stage[data-theme="airport"] .flip-card__half, .flip-stage[data-theme="airport"] .flip-card__leaf { font-family: 'Courier New', monospace; }

/* CONTROL PANEL */
.win-control-panel { background: linear-gradient(180deg, #2d2d2d 0%, #252525 100%); border-radius: 8px; margin-bottom: 2rem; border: 1px solid #404040; overflow: hidden; font-family: 'Segoe UI', system-ui, sans-serif; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); }
.win-titlebar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #1f1f1f; border-bottom: 1px solid #404040; }
.win-titlebar__icon i { color: #4bb2d5; font-size: 18px; }
.win-titlebar__text { font-size: 13px; color: #fff; flex: 1; }
.win-titlebar__buttons { display: flex; gap: 2px; }
.win-titlebar__btn { width: 12px; height: 12px; border-radius: 50%; }
.win-titlebar__btn--minimize { background: #ffbd2e; }
.win-titlebar__btn--maximize { background: #28c940; }
.win-titlebar__btn--close { background: #ff5f57; }

.win-panel-content { padding: 24px; }
.win-section { margin-bottom: 24px; }
.win-section:last-child { margin-bottom: 0; }
.win-section__title { font-size: 14px; font-weight: 600; color: #fff; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.win-section__title i { color: #4bb2d5; font-size: 16px; }

/* Mode tabs */
.mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.mode-tab { background: #363636; border: 2px solid #4a4a4a; border-radius: 6px; padding: 12px 14px; cursor: pointer; transition: all 0.15s ease; text-align: center; color: #fff; font-size: 13px; font-weight: 500; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 8px; }
.mode-tab:hover { background: #404040; border-color: #4bb2d5; }
.mode-tab.active { background: rgba(75, 178, 213, 0.12); border-color: #4bb2d5; color: #66c5de; }
.mode-tab i { font-size: 16px; }

/* Theme grid */
.theme-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
@media (max-width: 700px) { .theme-grid { grid-template-columns: repeat(3, 1fr); } }
.theme-card { font: inherit; color: inherit; width: 100%; min-width: 0; min-height: 44px; background: #363636; border: 2px solid #4a4a4a; border-radius: 6px; padding: 8px 6px; cursor: pointer; transition: all 0.15s ease; text-align: center; }
.theme-card:hover { background: #404040; border-color: #4bb2d5; }
.theme-card.active { border-color: #4bb2d5; box-shadow: 0 0 0 2px rgba(75,178,213,0.3); }
.theme-card__swatch { width: 100%; height: 36px; border-radius: 4px; margin-bottom: 6px; border: 1px solid rgba(255,255,255,0.1); position: relative; overflow: hidden; }
.theme-card__swatch::before { content: attr(data-digit); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: 'Helvetica Neue', sans-serif; font-weight: 700; font-size: 22px; }
.theme-card[data-theme="classic"] .theme-card__swatch { background: linear-gradient(180deg,#1a1a1a 0%,#222 50%,#1a1a1a 100%); color: #fefefe; }
.theme-card[data-theme="light"] .theme-card__swatch { background: linear-gradient(180deg,#fbfaf6 0%,#fff 50%,#fbfaf6 100%); color: #1a1a1a; border-color: #d8d4c8; }
.theme-card[data-theme="sepia"] .theme-card__swatch { background: linear-gradient(180deg,#3a2a14 0%,#4a3618 50%,#3a2a14 100%); color: #f4e4b8; }
.theme-card[data-theme="neon"] .theme-card__swatch { background: linear-gradient(180deg,#0e0b2c 0%,#15123c 50%,#0e0b2c 100%); color: #00ff88; }
.theme-card[data-theme="wood"] .theme-card__swatch { background: linear-gradient(180deg,#5a3a1f 0%,#704522 50%,#5a3a1f 100%); color: #f5e8c8; }
.theme-card[data-theme="airport"] .theme-card__swatch { background: linear-gradient(180deg,#0a0a0a 0%,#111 50%,#0a0a0a 100%); color: #ffd95a; font-family: 'Courier New', monospace; }
.theme-card__name { font-size: 11px; color: #fff; margin: 0; }

/* Inputs */
.win-input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.win-input-row--three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 700px) { .win-input-row, .win-input-row--three { grid-template-columns: 1fr; } }
.win-input-group { display: flex; flex-direction: column; gap: 6px; }
.win-input-label { font-size: 13px; color: rgba(255,255,255,0.8); }
.win-input, .win-select { padding: 10px 14px; font-size: 14px; font-family: 'Segoe UI', system-ui, sans-serif; background: #1f1f1f; border: 1px solid #5a5a5a; border-bottom: 2px solid #4bb2d5; border-radius: 4px 4px 0 0; color: #fff; outline: none; width: 100%; box-sizing: border-box; }
.win-input:focus, .win-select:focus { background: #2a2a2a; border-color: #66c5de; border-bottom-color: #66c5de; }
.win-input:focus-visible, .win-select:focus-visible { outline: 2px solid #66c5de; outline-offset: 1px; }

/* Toggles */
.win-toggle-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
@media (max-width: 700px) { .win-toggle-list { grid-template-columns: 1fr; } }
.win-toggle { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; user-select: none; padding: 4px 0; }
.win-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.win-toggle__switch { width: 36px; height: 20px; background: #5a5a5a; border-radius: 10px; position: relative; transition: background 0.2s ease; flex-shrink: 0; margin-top: 1px; }
.win-toggle__switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform 0.2s ease; }
.win-toggle input:checked + .win-toggle__switch { background: #4bb2d5; }
.win-toggle input:checked + .win-toggle__switch::after { transform: translateX(16px); }
.win-toggle__label { font-size: 13px; font-weight: 500; color: #fff; line-height: 1.3; }
.win-toggle__hint { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 2px; line-height: 1.3; }

/* Color picker custom */
.color-picker-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.color-picker-cell { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 130px; }
.color-picker-input { display: flex; gap: 8px; align-items: center; }
.color-picker-input input[type="color"] { width: 44px; height: 44px; border: 1px solid #5a5a5a; border-radius: 4px; cursor: pointer; padding: 2px; background: #1f1f1f; }
.color-picker-input input[type="text"] { flex: 1; padding: 8px 12px; font-size: 13px; background: #1f1f1f; border: 1px solid #5a5a5a; border-bottom: 2px solid #4bb2d5; border-radius: 4px 4px 0 0; color: #fff; outline: none; font-family: 'Segoe UI', monospace; }

/* Buttons */
.win-btn-row { display: flex; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #404040; flex-wrap: wrap; }
@media (max-width: 600px) { .win-btn-row { flex-direction: column; } }
.win-btn { flex: 1; min-width: 130px; padding: 12px 24px; font-size: 14px; font-weight: 500; font-family: 'Segoe UI', system-ui, sans-serif; border: none; border-radius: 4px; cursor: pointer; transition: all 0.15s ease; display: flex; align-items: center; justify-content: center; gap: 8px; }
.win-btn i { font-size: 16px; }
.win-btn-primary { background: linear-gradient(180deg, #4bb2d5 0%, #3b779b 100%); color: #fff; font-weight: 600; }
.win-btn-primary:hover { background: linear-gradient(180deg, #66c5de 0%, #4bb2d5 100%); }
.win-btn-secondary { background: #363636; color: #fff; border: 1px solid #5a5a5a; }
.win-btn-secondary:hover { background: #404040; border-color: #6a6a6a; }
.win-btn-share { background: transparent; color: #66c5de; border: 1px solid #66c5de; flex: 0 0 auto; padding: 12px 18px; }
.win-btn-share:hover { background: rgba(102, 197, 222, 0.1); }
.win-btn-share.copied { background: #28c940; border-color: #28c940; color: #fff; }
.win-btn-warning { background: linear-gradient(180deg, #ff6b35 0%, #d04020 100%); color: #fff; font-weight: 600; }
.win-btn-warning:hover { background: linear-gradient(180deg, #ff8a5b 0%, #ff6b35 100%); }

/* Tips */
.win-tips { background: rgba(75, 178, 213, 0.08); border: 1px solid rgba(75, 178, 213, 0.2); border-radius: 4px; padding: 16px; margin-top: 20px; }
.win-tips__title { font-size: 13px; font-weight: 600; color: #66c5de; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.win-tips__list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; list-style: none; margin: 0; padding: 0; }
@media (max-width: 600px) { .win-tips__list { grid-template-columns: 1fr; } }
.win-tips__list li { font-size: 12px; color: rgba(255,255,255,0.7); padding-left: 16px; position: relative; }
.win-tips__list li::before { content: '›'; position: absolute; left: 0; color: #66c5de; font-weight: bold; }

kbd { display: inline-block; padding: 2px 6px; font-size: 11px; font-family: 'Segoe UI', monospace; background: #1f1f1f; border: 1px solid #5a5a5a; border-radius: 3px; color: #fff; }

/* Mode-specific sections (only show when relevant) */
.mode-section { display: none; }
.mode-section.active { display: block; }

/* Light info cards */
.features-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin: 2rem 0; }
@media (max-width: 768px) { .features-row { grid-template-columns: 1fr; } }
.feature-box { text-align: center; padding: 1.5rem 1rem; background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); border: 1px solid #e9ecef; }
.feature-box__icon { width: 44px; height: 44px; margin: 0 auto 0.875rem; color: #3b779b; display: flex; align-items: center; justify-content: center; }
.feature-box__icon i { font-size: 2.5rem; }
.feature-box__title { font-size: 1rem; font-weight: 600; color: #2f6e8d; margin: 0 0 0.375rem; }
.feature-box__desc { font-size: 0.875rem; color: #5a7a8a; margin: 0; line-height: 1.4; }

.info-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); border: 1px solid #e9ecef; margin-bottom: 1.5rem; overflow: hidden; }
.info-card__header { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.25rem; background: #f8f9fa; border-bottom: 1px solid #e9ecef; }
.info-card__header i { font-size: 1.25rem; color: #4bb2d5; flex-shrink: 0; }
.info-card__title { font-size: 1rem; font-weight: 600; color: #2f6e8d; margin: 0; }
.info-card__body { padding: 1.25rem; }
.info-card__body p { margin: 0 0 1rem; color: #5a7a8a; line-height: 1.6; }
.info-card__body p:last-child { margin-bottom: 0; }

.use-cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
@media (max-width: 700px) { .use-cases { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .use-cases { grid-template-columns: 1fr; } }
.use-case { padding: 0.875rem; background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; }
.use-case__icon { color: #3b779b; font-size: 1.25rem; margin-bottom: 0.5rem; }
.use-case__title { font-size: 0.875rem; font-weight: 600; color: #2f6e8d; margin: 0 0 0.25rem; }
.use-case__desc { font-size: 0.8125rem; color: #5a7a8a; margin: 0; line-height: 1.4; }

.faq-item { border-bottom: 1px solid #e9ecef; }
.faq-item:last-child { border-bottom: none; }
.faq-q { width: 100%; background: none; border: none; padding: 0.875rem 0; text-align: left; font-size: 0.9375rem; font-weight: 600; color: #2f6e8d; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-family: inherit; }
.faq-q:hover { color: #3b779b; }
.faq-q i { color: #4bb2d5; transition: transform 0.2s ease; flex-shrink: 0; font-size: 0.875rem; }
.faq-item.open .faq-q i { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-item.open .faq-a { max-height: 500px; }
.faq-a p { padding: 0 0 0.875rem; color: #5a7a8a; line-height: 1.6; margin: 0; font-size: 0.875rem; }

/* FULLSCREEN MODE */
body.flip-fullscreen, html.flip-fullscreen { overflow: hidden !important; height: 100% !important; margin: 0 !important; padding: 0 !important; }
.flip-stage.fullscreen-active { position: fixed; inset: 0; z-index: 2147483646; border-radius: 0; border: none; min-height: 100vh; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
/* Card width from whichever runs out first, width or height, so all six cards always fit */
.flip-stage.fullscreen-active { --cw: min(10.5vw, 34vh, 260px); }
@supports (height: 1svh) { .flip-stage.fullscreen-active { --cw: min(10.5vw, 34svh, 260px); } }
.flip-stage.fullscreen-active .flip-date { margin-top: 3vh; font-size: clamp(14px, calc(var(--cw) * 0.24), 40px); }
/* Phone or tablet held upright: stack hours, minutes and seconds for much bigger digits */
@media (orientation: portrait) {
    .flip-stage.fullscreen-active { --cw: min(30vw, 16vh, 260px); }
    @supports (height: 1svh) { .flip-stage.fullscreen-active { --cw: min(30vw, 16svh, 260px); } }
    .flip-stage.fullscreen-active .flip-row { flex-direction: column; gap: calc(var(--cw) * 0.16); }
    .flip-stage.fullscreen-active .flip-colon { display: none !important; }
    .flip-stage.fullscreen-active .flip-ampm { margin: 0; align-self: center; }
}
.flip-stage.fullscreen-active.hide-cursor, .flip-stage.fullscreen-active.hide-cursor * { cursor: none; }

.exit-hint { position: fixed; top: 20px; right: 20px; padding: 10px 20px; background: rgba(0, 0, 0, 0.85); color: rgba(255, 255, 255, 0.9); font-size: 13px; border-radius: 6px; opacity: 0; transition: opacity 0.3s ease; pointer-events: none; z-index: 2147483648; font-family: 'Segoe UI', sans-serif; }
.exit-hint.visible { opacity: 1; }

.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px); padding: 12px 24px; background: #1f1f1f; color: #fff; border-radius: 6px; font-size: 14px; z-index: 2147483647; transition: transform 0.3s ease, visibility 0.3s; visibility: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.3); border: 1px solid #404040; font-family: 'Segoe UI', sans-serif; }
.toast.visible { transform: translateX(-50%) translateY(0); visibility: visible; }

@media (max-width: 600px) {
    .hero-section { padding: 2rem 1rem; }
    .hero-section__title { font-size: 1.5rem; }
    .win-panel-content { padding: 16px; }
    .flip-stage { padding: 2rem 0.75rem; }
}

/* Phones: the colour hex inputs kept their default width and pushed the page column out */
.flip-tool { width: 100%; min-width: 0; } /* margin: 0 auto turned off flex stretch on phones, so the box grew to its widest child */
.color-picker-input input[type="text"] { min-width: 0; }
@media (max-width: 479px) {
    /* Mode tabs: icon above the word, so "Countdown" and "Stopwatch" are not broken into letters */
    .mode-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
    .mode-tab { flex-direction: column; gap: 4px; padding: 10px 2px; font-size: 12px; word-break: normal; overflow-wrap: normal; }
}

/* =====================================================================
   16 Oct 2026 - fluid card sizing, focus states, button states, motion
   ===================================================================== */
/* Size the cards from the stage's own width where container units exist */
@supports (width: 1cqw) {
    .flip-stage { container-type: inline-size; --cw: clamp(28px, 10.5cqw, 100px); }
}
.mode-tab:focus-visible, .theme-card:focus-visible, .win-btn:focus-visible { outline: 3px solid #66c5de; outline-offset: 2px; }
.faq-q:focus-visible { outline: 3px solid #3b779b; outline-offset: 2px; }
.win-toggle input:focus-visible + .win-toggle__switch { outline: 3px solid #66c5de; outline-offset: 2px; }
.color-picker-input input:focus-visible { outline: 2px solid #66c5de; outline-offset: 1px; }
.win-btn { min-height: 44px; }
.win-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.win-btn-row--tight { margin-top: 8px; padding-top: 0; border-top: 0; }
.win-btn-row--flush { margin-top: 0; padding-top: 0; border-top: 0; }
.win-btn--compact { flex: 0 0 auto; padding: 8px 16px; }
.flip-stage.is-done .flip-date { color: var(--ampm-color); font-weight: 700; }

/* =====================================================================
   16 Oct 2026 - Night Mode: dim red on black for a bedside clock.
   data-night="1" on the stage beats every theme and the inline custom colours
   (!important on the variables), and the leaves use the same variables, so
   the flip animation halves turn red-on-black too.
   ===================================================================== */
.night-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.night-btn { background: #363636; border: 2px solid #4a4a4a; border-radius: 6px; min-height: 44px; padding: 10px 12px; cursor: pointer; transition: all 0.15s ease; color: #fff; font-size: 13px; font-weight: 500; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 8px; }
.night-btn:hover { background: #404040; border-color: #4bb2d5; }
.night-btn.active { background: rgba(75, 178, 213, 0.12); border-color: #4bb2d5; color: #66c5de; }
.night-btn:focus-visible { outline: 3px solid #66c5de; outline-offset: 2px; }
.night-btn i { font-size: 15px; }
.night-btn { word-break: normal; overflow-wrap: normal; white-space: nowrap; }
@media (max-width: 479px) {
    /* Same treatment as the mode tabs: icon above the word on narrow phones */
    .night-seg { gap: 6px; }
    .night-btn { flex-direction: column; gap: 4px; padding: 8px 2px; font-size: 12px; }
}
.night-hint { font-size: 12px; color: rgba(255,255,255,0.6); margin: 10px 0 0; line-height: 1.4; }
.night-status { color: #66c5de; font-weight: 600; white-space: nowrap; }
.night-status:empty { display: none; }

.flip-stage[data-night="1"] {
    --stage-bg: #000 !important;
    --card-bg: #0b0b0b !important;
    --card-text: #b3121b !important;
    --card-border: #111 !important;
    --card-divider: rgba(0,0,0,0.95) !important;
    --card-shadow: transparent !important;
    --label-color: rgba(163,18,26,0.45) !important;
    --ampm-color: rgba(163,18,26,0.6) !important;
    border-color: #000;
}
.flip-stage[data-night="1"] .flip-card__half,
.flip-stage[data-night="1"] .flip-card__leaf { text-shadow: none; box-shadow: none; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; }
.flip-stage[data-night="1"] .flip-colon { animation: none; opacity: 0.4; }
.flip-stage[data-night="1"] .flip-date { opacity: 0.8; }
.flip-stage[data-night="1"].is-done .flip-date { color: var(--card-text); }
.flip-stage[data-night="1"] .tool-stage-fs { opacity: 0.35; }
.flip-stage[data-night="1"] .tool-stage-fs:hover, .flip-stage[data-night="1"] .tool-stage-fs:focus-visible { opacity: 1; }
/* The switch: the clock fades out, the look changes, it fades back in (1.5s in all) */
.flip-stage .flip-row, .flip-stage .flip-date { transition: opacity 0.75s ease; }
.flip-stage.night-fading .flip-row, .flip-stage.night-fading .flip-date { opacity: 0; }
.flip-stage.night-anim { transition: background 0.75s ease; }

/* Reduced motion: the script changes digits instantly, this stops the rest */
@media (prefers-reduced-motion: reduce) {
    .flip-colon { animation: none; opacity: 0.85; }
    .flip-card.flipping .flip-card__leaf--top, .flip-card.flipping .flip-card__leaf--bottom { animation: none; }
    .flip-stage, .mode-tab, .theme-card, .win-btn, .win-toggle__switch, .win-toggle__switch::after, .faq-a, .faq-q i, .toast, .exit-hint { transition: none; }
    .night-btn, .flip-stage .flip-row, .flip-stage .flip-date, .flip-stage.night-anim { transition: none; }
}
