@import url('https://fonts.googleapis.com/css2?family=Gaegu:wght@300;400;700&display=swap');

/* ---------- CSS RESET ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* THEME VARIABLES */

[data-theme="tomato"] {
    --primary: #e05252;
    --primary-dark: #c03a3a;
    --primary-light: #f7b8b8;
    --accent: #ff8c42;
    --bg: #fff5f5;
    --bg2: #ffe8e8;
    --card: #ffffff;
    --text: #4a2020;
    --text-muted: #a06060;
    --border: #f5c0c0;
    --dot-fill: #e05252;
    --blob1: #ffcaca;
    --blob2: #ffd6b0;
    --blob3: #ffb8b8;
    --mascot: "🍅";
    --progress-stroke: #e05252;
    --nav-bg: rgba(255, 245, 245, 0.85);
    --shadow: rgba(224, 82, 82, 0.18);
    --btn-hover: #c03a3a;
}

[data-theme="froggie"] {
    --primary: #4caf74;
    --primary-dark: #388a57;
    --primary-light: #b6edcb;
    --accent: #a3e635;
    --bg: #f2faf4;
    --bg2: #d8f3e2;
    --card: #ffffff;
    --text: #1a3d28;
    --text-muted: #5a8a6a;
    --border: #b6edcb;
    --dot-fill: #4caf74;
    --blob1: #c8f0d6;
    --blob2: #dff5e4;
    --blob3: #b8e8c8;
    --mascot: "🐸";
    --progress-stroke: #4caf74;
    --nav-bg: rgba(242, 250, 244, 0.85);
    --shadow: rgba(76, 175, 116, 0.18);
    --btn-hover: #388a57;
}

[data-theme="bunny"] {
    --primary: #d966b0;
    --primary-dark: #b54494;
    --primary-light: #f9d0ee;
    --accent: #ff93d0;
    --bg: #fef5fb;
    --bg2: #fce4f6;
    --card: #ffffff;
    --text: #4a1040;
    --text-muted: #a05090;
    --border: #f5bee8;
    --dot-fill: #d966b0;
    --blob1: #fcd4f0;
    --blob2: #fde8f8;
    --blob3: #f9c0e8;
    --mascot: "🐰";
    --progress-stroke: #d966b0;
    --nav-bg: rgba(254, 245, 251, 0.85);
    --shadow: rgba(217, 102, 176, 0.18);
    --btn-hover: #b54494;
}

[data-theme="bear"] {
    --primary: #8b6f47;
    --primary-dark: #6b5030;
    --primary-light: #e8d5b8;
    --accent: #d4a96a;
    --bg: #fdf8f2;
    --bg2: #f5e8d5;
    --card: #ffffff;
    --text: #3d2b10;
    --text-muted: #8a7050;
    --border: #e8d5b8;
    --dot-fill: #8b6f47;
    --blob1: #f0e0c8;
    --blob2: #f5ead8;
    --blob3: #e8d4b8;
    --mascot: "🐻";
    --progress-stroke: #8b6f47;
    --nav-bg: rgba(253, 248, 242, 0.85);
    --shadow: rgba(139, 111, 71, 0.18);
    --btn-hover: #6b5030;
}

[data-theme="melon"] {
    --primary: #2ec4a6;
    --primary-dark: #1a9a82;
    --primary-light: #a8eee3;
    --accent: #f7c59f;
    --bg: #f0fdfb;
    --bg2: #d0f5ee;
    --card: #ffffff;
    --text: #0d3d34;
    --text-muted: #3a8a7a;
    --border: #a8eee3;
    --dot-fill: #2ec4a6;
    --blob1: #b8f0e6;
    --blob2: #d8f8f0;
    --blob3: #a0ead8;
    --mascot: "🍈";
    --progress-stroke: #2ec4a6;
    --nav-bg: rgba(240, 253, 251, 0.85);
    --shadow: rgba(46, 196, 166, 0.18);
    --btn-hover: #1a9a82;
}

[data-theme="valentine"] {
    --primary: #e84393;
    --primary-dark: #c02075;
    --primary-light: #ffc0e0;
    --accent: #ff6eb4;
    --bg: #fff5f9;
    --bg2: #ffe0f0;
    --card: #ffffff;
    --text: #4a0028;
    --text-muted: #a03070;
    --border: #ffc0e0;
    --dot-fill: #e84393;
    --blob1: #ffd0e8;
    --blob2: #ffe8f4;
    --blob3: #ffb8d8;
    --mascot: "💖";
    --progress-stroke: #e84393;
    --nav-bg: rgba(255, 245, 249, 0.85);
    --shadow: rgba(232, 67, 147, 0.18);
    --btn-hover: #c02075;
}

/* BASE*/
html {
    scroll-behavior: smooth;
}

body {
    font-family: "Gaegu", sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* =============================================
   BACKGROUND BLOBS
   ============================================= */
.bg-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
    animation: blobFloat 8s ease-in-out infinite alternate;
}

.blob1 {
    width: 380px;
    height: 380px;
    background: var(--blob1);
    top: -100px;
    left: -100px;
}

.blob2 {
    width: 300px;
    height: 300px;
    background: var(--blob2);
    bottom: 60px;
    right: -80px;
    animation-delay: 2s;
}

.blob3 {
    width: 200px;
    height: 200px;
    background: var(--blob3);
    top: 50%;
    left: 60%;
    animation-delay: 4s;
}

@keyframes blobFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 20px) scale(1.07);
    }
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 2.5rem;
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    border-bottom: 2px solid var(--border);
    box-shadow: 0 2px 20px var(--shadow);
    transition: background 0.5s ease;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    cursor: default;
}

.brand-emoji {
    font-size: 1.8rem;
    animation: spinBounce 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes spinBounce {

    0%,
    100% {
        transform: rotate(-8deg) scale(1);
    }

    50% {
        transform: rotate(8deg) scale(1.15);
    }
}

.brand-name {
    font-family: "Gaegu", sans-serif;
    font-size: 1.50rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
    transition: color 0.5s ease;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.4rem;
}

.nav-link {
    font-family: "Gaegu", sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.45rem 1rem;
    border-radius: 50px;
    transition: all 0.25s ease;
    border: 2px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background: var(--bg2);
    border-color: var(--primary-light);
}

/* =============================================
   MAIN CONTAINER
   ============================================= */
.main-container {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.8rem;
}

/* =============================================
   MODE TABS
   ============================================= */
.mode-tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--bg2);
    border-radius: 50px;
    padding: 0.35rem;
    border: 2px solid var(--border);
    box-shadow: 0 4px 14px var(--shadow);
}

.mode-btn {
    font-family: "Gaegu", sans-serif;
    font-weight: 700;
    font-size: 0.90rem;
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: 50px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s ease;
}

.mode-btn:hover {
    color: var(--primary);
    background: var(--bg);
}

.mode-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 3px 12px var(--shadow);
    transform: scale(1.03);
}

/* =============================================
   TIMER CARD
   ============================================= */
.timer-card {
    background: var(--card);
    border-radius: 28px;
    padding: 2.2rem 2rem;
    box-shadow: 0 8px 40px var(--shadow), 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 2.5px solid var(--border);
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    position: relative;
    overflow: hidden;
    transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

.timer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 28px 28px 0 0;
}

/* Mascot */
.mascot-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.mascot {
    font-size: 3.2rem;
    animation: mascotBounce 2.5s ease-in-out infinite;
    display: inline-block;
    cursor: default;
    user-select: none;
    transition: font-size 0.3s;
}

@keyframes mascotBounce {

    0%,
    100% {
        transform: translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

.mascot-speech {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg2);
    padding: 0.3rem 0.9rem;
    border-radius: 50px;
    border: 1.5px solid var(--border);
    white-space: nowrap;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Ring */
.progress-ring-wrap {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.progress-bg {
    fill: none;
    stroke: var(--bg2);
    stroke-width: 7;
}

.progress-fill {
    fill: none;
    stroke: var(--progress-stroke);
    stroke-width: 7;
    stroke-linecap: round;
    stroke-dasharray: 339.3;
    /* 2π×54 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.5s ease;
}

/* Timer Display (overlaid on ring via absolute) */
.timer-display {
    position: absolute;
    font-family: "Gaegu", sans-serif;
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -2px;
    line-height: 1;
    pointer-events: none;
    transition: color 0.5s ease;
    text-shadow: 0 2px 12px var(--shadow);
    /* Center inside .progress-ring-wrap */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ctrl-btn {
    font-family: "Gaegu", sans-serif;
    font-weight: 700;
    border: none;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.2s ease;
    outline: none;
}

.ctrl-btn:not(.play-btn) {
    background: var(--bg2);
    color: var(--text-muted);
    border: 2px solid var(--border);
    width: 46px;
    height: 46px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctrl-btn:not(.play-btn):hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    transform: scale(1.1);
}

.play-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 1rem;
    padding: 0.75rem 2.2rem;
    box-shadow: 0 6px 20px var(--shadow);
    letter-spacing: 0.3px;
}

.play-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 10px 28px var(--shadow);
}

.play-btn:active {
    transform: scale(0.97);
}

/* Session Dots */
.session-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.session-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

.session-dots {
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg2);
    border: 2px solid var(--border);
    transition: all 0.4s ease;
}

.dot.filled {
    background: var(--dot-fill);
    border-color: var(--primary-dark);
    transform: scale(1.2);
    box-shadow: 0 0 8px var(--shadow);
}

/* =============================================
   SETTINGS PANEL
   ============================================= */
.settings-panel {
    background: var(--card);
    border-radius: 24px;
    padding: 1.8rem;
    width: 100%;
    max-width: 540px;
    border: 2.5px solid var(--border);
    box-shadow: 0 6px 28px var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    transition: border-color 0.5s ease;
}

.settings-title {
    font-family: "Gaegu", sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.setting-item label {
    font-size: 0.97rem;
    font-weight: 800;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.3;
}

.number-input {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--bg2);
    border-radius: 50px;
    padding: 0.3rem 0.5rem;
    border: 2px solid var(--border);
}

.num-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    line-height: 1;
}

.num-btn:hover {
    background: var(--primary-light);
}

.number-input input {
    width: 38px;
    text-align: center;
    font-family: "Gaegu", sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    background: transparent;
    border: none;
    outline: none;
}

.number-input input::-webkit-inner-spin-button,
.number-input input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

/* Theme Section */
.theme-section {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.theme-title {
    font-family: "Gaegu", sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

.theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.55rem 0.3rem;
    border: 2.5px solid var(--border);
    border-radius: 16px;
    background: var(--bg2);
    cursor: pointer;
    transition: all 0.22s ease;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-muted);
    font-family: "Gaegu", sans-serif;
}

.theme-emoji {
    font-size: 1.8rem;
}

.theme-btn:hover {
    transform: scale(1.08);
    background: var(--primary-light);
}

.theme-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
    box-shadow: 0 3px 12px var(--shadow);
    transform: scale(1.06);
}

/* ============================
   FOOTER
   ============================ */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    background: var(--footer-bg);
    color: rgba(91, 54, 54, 0.8);
    font-size: 1rem;
    transition: background 0.5s;
}

.footer p+p {
    margin-top: 0.3rem;
}

.footer-sub {
    opacity: 0.8;
    font-size: 0.78rem;
}

/* =============================================
   TOAST
   ============================================= */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: var(--primary);
    color: #fff;
    padding: 0.85rem 1.8rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 8px 24px var(--shadow);
    transition: transform 0.4s cubic-bezier(.34, 1.56, .64, 1);
    z-index: 999;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}


/* =============================================
   PAGE CONTENT (FAQ / About)
   ============================================= */
.page-content {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0 auto;
    padding: 1rem 1rem 5rem;
}

.page-hero {
    text-align: center;
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.page-mascot {
    font-size: 3rem;
    animation: mascotBounce 2.5s ease-in-out infinite;
    display: inline-block;
}

.about-mascot {
    transition: transform 0.3s ease;
}

.page-title {
    font-family: "Gaegu", sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

.page-subtitle {
    font-size: 1.07rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* --- FAQ --- */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.faq-item {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 3px 14px var(--shadow);
    transition: box-shadow 0.2s;
}

.faq-item:hover {
    box-shadow: 0 6px 22px var(--shadow);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.1rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: "Gaegu", sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    cursor: pointer;
    gap: 1rem;
    text-align: left;
    transition: background 0.2s;
}

.faq-question:hover {
    background: var(--bg2);
}

.faq-arrow {
    font-size: 1.3rem;
    color: var(--primary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item.open .faq-arrow {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 1.4rem;
}

.faq-item.open .faq-answer {
    max-height: 300px;
    padding: 0 1.4rem 1.2rem;
}

.faq-answer p {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.7;
    font-weight: 600;
    border-top: 1.5px solid var(--border);
    padding-top: 0.85rem;
}

/* --- About Cards --- */
.about-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2.5rem;
}

.about-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 22px;
    padding: 1.6rem 1.4rem;
    box-shadow: 0 4px 18px var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.about-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
}

.about-card-icon {
    font-size: 2rem;
}

.about-card h3 {
    font-family: "Gaegu", sans-serif;
    font-size: 1.09rem;
    font-weight: 800;
    color: var(--primary);
}

.about-card p {
    font-size: 0.89rem;
    color: var(--text-muted);
    line-height: 1.65;
    font-weight: 600;
}

.about-card p em {
    color: var(--primary);
    font-style: normal;
    font-weight: 800;
}

.about-tagline {
    text-align: center;
    margin-bottom: 2rem;
}

.tagline-text {
    font-family: "Gaegu", sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    background: var(--bg2);
    padding: 0.7rem 2rem;
    border-radius: 50px;
    border: 2px solid var(--border);
    display: inline-block;
    box-shadow: 0 4px 14px var(--shadow);
}

/* Back button */
.page-footer-link {
    text-align: center;
    margin-top: 1rem;
}

.back-btn {
    display: inline-block;
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    box-shadow: 0 6px 20px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.back-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px var(--shadow);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 600px) {
    .navbar {
        padding: 0.7rem 1.2rem;
    }

    .brand-name {
        font-size: 1.25rem;
    }

    .nav-link {
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .theme-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .timer-display {
        font-size: 2.8rem;
    }

    .mode-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .about-cards {
        grid-template-columns: 1fr;
    }
}