:root {
    --color-base: #8c55f2;
    --color-base-dark: #7a3de8;
    --color-base-light: #c294ff;
    --color-base-bg: rgba(140, 85, 242, 0.06);
    --color-base-bg-strong: rgba(140, 85, 242, 0.12);
    --color-base-border: #ece0ff;
    --gradient-primary: linear-gradient(135deg, #8c55f2 0%, #b07aff 50%, #c294ff 100%);
    --gradient-hero: linear-gradient(135deg, rgba(140, 85, 242, 0.06) 0%, rgba(194, 148, 255, 0.04) 50%, rgba(140, 85, 242, 0.02) 100%);
    --bg-primary: #ffffff;
    --bg-secondary: #f7f6fb;
    --bg-tertiary: #f3f1f9;
    --text-primary: #1a1a2e;
    --text-secondary: #5a5a7a;
    --text-muted: #8E8E93;
    --line-1: #e8e5f0;
    --green: #28ca87;
    --green-bg: rgba(40, 202, 135, 0.08);
    --red: #dc5b61;
    --red-bg: rgba(220, 91, 97, 0.08);
    --shadow-sm: 0 1px 3px rgba(85, 38, 136, 0.04);
    --shadow-card: 0 2px 16px rgba(85, 38, 136, 0.06), 0 0 0 1px rgba(85, 38, 136, 0.03);
    --shadow-card-hover: 0 8px 32px rgba(85, 38, 136, 0.12), 0 0 0 1px rgba(140, 85, 242, 0.08);
    --shadow-btn: 0 4px 20px rgba(140, 85, 242, 0.35);
    --shadow-overlay: 0 24px 80px rgba(0, 0, 0, 0.12);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-pill: 999px;
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Noto Sans CJK SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    --font-sf: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans CJK SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    --font-display: SF Pro, SF Pro Display, Microsoft YaHei, 微软雅黑, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
    display: flex;
    flex-direction: column;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.7;
}

.logo-link img {
    display: block;
}

/* ── Decorative Background ── */
.bg-decor {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.hero {
    text-align: center;
    padding: 70px 0 20px 0;
    animation: fade-in-down 0.6s var(--ease-spring) forwards;
    transition: all 0.4s var(--ease-spring);
}

.form-column {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fade-in-up 0.6s var(--ease-spring) 0.1s forwards;
}

.history-column {
    width: 360px;
    flex-shrink: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fade-in-up 0.6s var(--ease-spring) 0.2s forwards;
}

@keyframes fade-in-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    animation: drift 25s ease-in-out infinite alternate;
}

.bg-blob-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(140, 85, 242, 0.08) 0%, rgba(194, 148, 255, 0.04) 60%, transparent 100%);
    top: -150px;
    right: -100px;
}

.bg-blob-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(194, 148, 255, 0.06) 0%, rgba(140, 85, 242, 0.03) 60%, transparent 100%);
    bottom: 15%;
    left: -120px;
    animation-delay: -12s;
}

@keyframes drift {
    to {
        transform: translate(20px, 15px) scale(1.05);
    }
}

/* ── Header ── */
.header-bar {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(140, 85, 242, 0.08);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 50;
    flex-shrink: 0;
}

.header-bar img {
    width: auto;
    height: 34px;
}

.brand {
    display: none;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-base);
    background: var(--color-base-bg-strong);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
}

.header-spacer {
    flex: 1;
}

.header-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    transition: all 0.2s var(--ease);
}

.header-link:hover {
    color: var(--color-base);
    background: var(--color-base-bg);
}

/* User area / Google Sign-In（已注释，恢复登录入口时取消注释）
.user-area {
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.signin-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: #5f6368;
    letter-spacing: 0.2px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 20px;
    padding: 6px 16px 6px 10px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.signin-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.signin-btn:hover {
    background: #f8f9fa;
    border-color: #c6c9cd;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.signin-btn:active {
    background: #f1f3f4;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 3px 10px 3px 3px;
    border-radius: var(--radius-pill);
    transition: background 0.2s var(--ease);
}

.user-profile:hover {
    background: var(--bg-secondary);
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--line-1);
    object-fit: cover;
}

.user-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
*/

.container {
    width: 1250px;
    max-width: 95%;
    margin: 0 auto;
    padding: 0 24px 30px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-height: 0;
}

.hero {
    text-align: center;
    padding: 70px 0 20px 0;
    animation: fade-in-down 0.6s var(--ease-spring) forwards;
    transition: padding 0.4s var(--ease-spring);
}

.hero-icon {
    display: none;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--gradient-primary);
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(140, 85, 242, 0.25);
}

.hero-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hero h1 {
    font-family: var(--font-sf);
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 70px;
    color: var(--color-base);
    margin-bottom: 8px;
    background: linear-gradient(90deg, #8c55f2 0%, #8c55f2 40%, #ffd700 50%, #8c55f2 60%, #8c55f2 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: hero-shimmer 12s -4s linear infinite;
    transition: font-size 0.4s var(--ease-spring), transform 0.4s var(--ease-spring);
    transform-origin: center;
}

@keyframes hero-shimmer {
    0% {
        background-position: 150% 50%;
    }

    100% {
        background-position: -50% 50%;
    }
}

.hero h1 em {
    font-style: normal;
    color: inherit;
}

.hero p {
    color: var(--text-muted);
    font-family: var(--font-sf);
    font-size: 18px;
    font-weight: 400;
    max-width: 1002px;
    margin: 0 auto;
    line-height: 1.193359375;
    transition: font-size 0.4s var(--ease-spring), opacity 0.4s var(--ease-spring);
}

/* ── Card ── */
.card {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.1);
    padding: 20px 24px;
    transition: box-shadow 0.3s var(--ease);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    box-shadow: 0px 8px 30px 0px rgba(0, 0, 0, 0.15);
}

.card-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.card-label svg {
    width: 14px;
    height: 14px;
    stroke: var(--color-base);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Upload card (match Figma section style) */
#mainForm {
    height: 100%;
}

#mainForm .card {
    border: 1px solid #f1edf8;
    border-radius: 16px;
    padding: 20px 24px;
    height: 100%;
    box-sizing: border-box;
    box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.7);
}

#historyCard .history-header {
    position: relative;
    width: 100%;
}

#resultSection .card-label,
#historyCard .card-label,
#mainForm .card-label {
    margin-bottom: 12px;
    font-family: var(--font-sf);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0;
    color: #000;
    text-transform: uppercase;
    gap: 8px;
    padding-left: 45px;
    position: relative;
}

#mainForm .card-label svg {
    display: none;
}

#resultSection .card-label::before,
#historyCard .card-label::before,
#mainForm .card-label::before {
    content: '';
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f0e6ff;
    flex-shrink: 0;
    z-index: 1;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
}

#resultSection .card-label::after,
#historyCard .card-label::after,
#mainForm .card-label::after {
    content: '';
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgb(240, 230, 255, 0.3);
    flex-shrink: 0;
    z-index: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 8px;
}

/* ── Main Layout ── */
.main-layout {
    display: flex;
    gap: 32px;
    align-items: stretch;
    margin-bottom: 16px;
    min-height: 0;
}

.form-column {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fade-in-up 0.6s var(--ease-spring) 0.1s forwards;
}

.history-column {
    width: 360px;
    flex-shrink: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fade-in-up 0.6s var(--ease-spring) 0.2s forwards;
}

.history-column .card {
    height: 100%;
    box-sizing: border-box;
}

#historyCard {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#historyCard .card-label {
    font-family: var(--font-sf);
    font-size: 16px;
    font-weight: 700;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0;
}

/* ── Form Elements ── */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.cat-btn {
    flex: 1;
    text-align: center;
    background: var(--bg-tertiary);
    border: 1.5px solid transparent;
    color: var(--text-secondary);
    padding: 12px 18px;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-family: var(--font);
    white-space: nowrap;
}

.cat-btn:hover {
    background: var(--bg-primary);
    border-color: var(--color-base-border);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.cat-btn:focus-visible {
    outline: 2px solid var(--color-base);
    outline-offset: 2px;
}

.cat-btn.active.mode-quick {
    background: var(--color-base);
    color: #fff;
    box-shadow: 0 4px 12px rgba(140, 85, 242, 0.25);
}

.cat-btn.active.mode-deep {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(140, 85, 242, 0.3);
}

.option-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.custom-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--line-1);
    color: var(--text-primary);
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 15px;
    font-family: var(--font);
    transition: all 0.2s var(--ease);
    resize: vertical;
    min-height: 100px;
    margin-bottom: 20px;
}

.custom-input:focus {
    outline: none;
    border-color: var(--color-base);
    box-shadow: 0 0 0 4px var(--color-base-bg);
    background: var(--bg-primary);
}

.custom-input::placeholder {
    color: var(--text-muted);
}

/* ── File Upload ── */
.upload-area {
    border: 2px dashed var(--line-1);
    border-radius: var(--radius-md);
    padding: 36px 28px 50px 28px;
    text-align: center;
    transition: all 0.4s var(--ease-spring);
    cursor: pointer;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

#mainForm .upload-area {
    border: 2px dashed #e9dfff;
    border-radius: 12px;
    background: #fff;
    padding: 15px;
    margin-bottom: 5px;
    transition: all 0.4s var(--ease-spring);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--color-base);
    background: var(--color-base-bg);
}

.upload-area.dragover {
    border-color: var(--color-base-dark);
    background: var(--color-base-bg-strong);
    transform: scale(1.01);
}

#mainForm .upload-area.has-files {
    border-style: dashed;
    border-color: #e9dfff;
    padding: 10px 20px 10px 20px;
}

.upload-icon {
    width: 400px;
    max-width: calc(100% - 80px);
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s var(--ease-spring);
}

.upload-icon img {
    width: 100%;
    height: auto;
    display: block;
    transition: all 0.4s var(--ease-spring);
}

.upload-area.has-files .upload-icon {
    width: 100px;
    position: relative;
    height: 0;
    opacity: 0;
    overflow: hidden;
}

.upload-area.has-files .upload-icon img {
    transform: translateY(-20px) scale(0.8);
    opacity: 0;
}

.upload-area.has-files .upload-hint {
    margin-top: 0;
    margin-bottom: 8px;
}

.upload-area.has-files .upload-browse {
    margin-top: 0;
}

.upload-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

#mainForm .upload-title {
    font-family: var(--font-sf);
    font-size: 16px;
    font-weight: 700;
    color: #000;
    line-height: 1.193359375;
}

.upload-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

#mainForm .upload-hint {
    font-family: var(--font-sf);
    font-size: 14px;
    font-weight: 400;
    margin-top: 5px;
    line-height: 1.4285714286;
    color: #8e8e93;
}

.upload-browse {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-base);
    background: var(--bg-primary);
    border: 1.5px solid var(--color-base-border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

#mainForm .upload-browse {
    font-family: var(--font-sf);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.193359375;
    border: 2px solid #f2eaff;
    color: #8c55f2;
    background: #fcf9ff;
    width: 210px;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: 40px;
}

.task-label {
    display: block;
    margin-top: 12px;
    margin-bottom: 8px;
    font-family: var(--font-sf);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    color: #9080a1;
    line-height: 1.193359375;
}

.task-label-optional {
    color: #9080a1;
    font-weight: 700;
}

#mainForm .custom-input {
    font-family: var(--font-sf);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4285714286;
    text-align: left;
    min-height: 80px;
    border: 2px solid #f2eaff;
    border-radius: 12px;
    background: #fcf9ff;
    padding: 10px 20px;
    margin-bottom: 0;
    resize: vertical;
}

#promptInput {
    overflow-y: auto;
}

#promptInput::placeholder {
    color: #8e8e93;
}

.upload-browse:hover {
    border-color: var(--color-base);
    background: var(--color-base-bg);
}

.upload-limit {
    font-size: 11px;
    color: var(--text-muted);
}

.file-list {
    margin-top: 15px;
    margin-left: -10px;
    margin-right: -10px;
    margin-bottom: 5px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.4s var(--ease-spring);
}

.file-list:empty {
    display: none;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 50px;
    padding: 10px 14px;
    background: #F8F4FF;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.file-type-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}

.file-item .file-name {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    white-space: nowrap;
    color: var(--text-primary);
}

.file-item .file-size {
    color: var(--text-muted);
    font-size: 14px;
    flex-shrink: 0;
}

.file-item .file-status {
    font-size: 14px;
    flex-shrink: 0;
}

.file-item .file-status.uploading {
    color: var(--color-base);
}

.file-item .file-status.done {
    color: var(--green);
}

.file-item .file-status.error {
    color: var(--red);
}

.file-remove {
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    background-image: url("./delete.png");
    background-size: contain;
    background-position: center;
    transition: all 0.2s ease-in-out;
}

.file-remove:hover {
    opacity: .8;
}

/* ── Options Grid ── */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.option-select {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--line-1);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%235a5a7a%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 14px top 50%;
    background-size: 10px auto;
}

.option-select:focus {
    outline: none;
    border-color: var(--color-base);
    box-shadow: 0 0 0 3px var(--color-base-bg);
}

/* ── Generate Button & Reset Button ── */
.gen-btn,
.reset-btn {
    position: relative;
    background: #8C55F2;
    color: #fff;
    border: none;
    padding: 18px;
    border-radius: var(--radius-pill);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    width: 600px;
    max-width: calc(600px - 80px);
    font-family: var(--font-display);
    transition: all 0.25s var(--ease);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.gen-btn::after,
.reset-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: none;
}

.gen-btn:hover:not(:disabled)::after,
.reset-btn:hover:not(:disabled)::after {
    animation: shimmer 0.8s ease forwards;
}

@keyframes shimmer {
    to {
        transform: translateX(100%);
    }
}

.gen-btn:hover:not(:disabled),
.reset-btn:hover:not(:disabled) {
    box-shadow: var(--shadow-btn);
    transform: translateY(-1px);
}

.gen-btn:active:not(:disabled),
.reset-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.99);
    box-shadow: 0 2px 10px rgba(140, 85, 242, 0.2);
}

.gen-btn:focus-visible,
.reset-btn:focus-visible {
    outline: 2px solid var(--color-base);
    outline-offset: 3px;
}

.gen-btn:disabled,
.reset-btn:disabled {
    cursor: not-allowed;
    background: #c8c3d4;
    color: rgba(255, 255, 255, 0.85);
}

#mainForm .gen-btn,
.reset-btn {
    margin-top: 16px;
    width: 600px;
    max-width: calc(100% - 80px);
    min-height: 52px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 1px 10px 0 rgba(0, 0, 0, 0.20);
}

#mainForm .gen-btn:hover:not(:disabled),
.reset-btn:hover:not(:disabled) {
    box-shadow: 0 14px 28px rgba(140, 85, 242, 0.34);
}

.submit-note {
    margin-top: 20px;
    text-align: center;
    font-family: var(--font-sf);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    color: #8e8e93;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

/* ── Loading Overlay ── */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px) saturate(100%);
    -webkit-backdrop-filter: blur(6px) saturate(100%);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.loading-overlay.show {
    display: flex;
}

.loading-card {
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 40px 40px 32px;
    text-align: center;
    box-shadow: var(--shadow-overlay);
    max-width: 520px;
    width: calc(100% - 40px);
    animation: card-enter 0.3s var(--ease-spring);
}

/* Bottom progress strip (indeterminate shimmer, expert-style overlay) */
.loading-overlay.show .loading-card::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: linear-gradient(90deg,
            var(--line-1) 0%,
            var(--line-1) 32%,
            var(--color-base-light) 50%,
            var(--color-base) 52%,
            var(--color-base-light) 54%,
            var(--line-1) 68%,
            var(--line-1) 100%);
    background-size: 200% 100%;
    animation: loading-card-bar-shimmer 2.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes loading-card-bar-shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

@keyframes card-enter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(8px);
    }
}

.loader-orbit {
    width: 140px;
    height: 140px;
    margin: 0 auto 20px;
    position: relative;
    transform-origin: 50% 50%;
}

.c-head-group {
    transform-origin: 158px 145px;
}

.c-eyes-group {
    transform-origin: 158px 142px;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.c-eyes-group.look-dl {
    transform: translate(-10px, 6px);
}

.c-eyes-group.look-ur {
    transform: translate(10px, -6px);
}

.c-eye-base {
    transform-origin: center;
}

@keyframes blink {

    0%,
    46%,
    48%,
    52%,
    54%,
    100% {
        transform: scaleY(1);
    }

    47%,
    53% {
        transform: scaleY(0.1);
    }
}

.loading-char-svg {
    width: 100%;
    height: 100%;
    stroke: #000000;
    fill: none;
}

/* body stroke-dashoffset draw-on */
.c-body {
    stroke-dasharray: 280;
    stroke-dashoffset: 280;
    animation: char-draw 1.6s ease-out forwards;
}

@keyframes char-draw {
    to {
        stroke-dashoffset: 0;
    }
}

[class^="c-m"],
.c-eye-base {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* eyes dots: hide when smile eyes shown */
.c-eye-smile-l,
.c-eye-smile-r {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.loading-title-text {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(90deg,
            var(--text-primary) 0%,
            var(--text-secondary) 18%,
            var(--color-base) 40%,
            var(--color-base-light) 50%,
            var(--color-base) 60%,
            var(--text-secondary) 82%,
            var(--text-primary) 100%);
    background-size: 240% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: loading-title-gradient 3.2s ease-in-out infinite;
}

@keyframes loading-title-gradient {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.loading-sub {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    max-width: 100%;
}

/* Three-dot wave (expert-loading-overlay style) */
.expert-loading-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 5px;
    height: 1em;
    vertical-align: middle;
}

.expert-loading-dots.is-hidden {
    display: none;
}

.expert-loading-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-base);
    opacity: 0.35;
    animation: expert-loading-dot-wave 1.05s ease-in-out infinite;
    flex-shrink: 0;
}

.expert-loading-dot:nth-child(2) {
    animation-delay: 0.14s;
}

.expert-loading-dot:nth-child(3) {
    animation-delay: 0.28s;
}

@keyframes expert-loading-dot-wave {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.35;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

.loading-elapsed {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-variant-numeric: tabular-nums;
}

/* ── Horizontal Stepper ── */
.stepper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    padding: 0 4px;
}

.stepper-track {
    position: absolute;
    top: 10px;
    left: calc(100% / 6 / 2);
    /* Half of a step's width */
    right: calc(100% / 6 / 2);
    height: 3px;
    background: var(--line-1);
    border-radius: 3px;
    overflow: hidden;
}

.stepper-track-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-base-dark) 0%, var(--color-base-light) 50%, var(--color-base) 100%);
    background-size: 200% 100%;
    border-radius: 3px;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: progress-shimmer 2s linear infinite;
    position: relative;
}

.stepper-track-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8));
    border-radius: 3px;
}

@keyframes progress-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

.step-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--line-1);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.step-dot svg {
    width: 12px;
    height: 12px;
    opacity: 0;
}

.step-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 6px;
    white-space: nowrap;
    transition: color 0.3s ease;
}

/* Active step */
.step.active .step-dot {
    border-color: var(--color-base);
    background: var(--bg-primary);
    animation: pulse-dot 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.step.active .step-label {
    color: var(--color-base);
    font-weight: 700;
}

@keyframes pulse-dot {
    0% {
        box-shadow: 0 0 0 0 rgba(140, 85, 242, 0.4), inset 0 0 0 3px var(--color-base), 0 0 8px rgba(140, 85, 242, 0.3);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(140, 85, 242, 0), inset 0 0 0 3px var(--color-base), 0 0 8px rgba(140, 85, 242, 0.3);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(140, 85, 242, 0), inset 0 0 0 3px var(--color-base), 0 0 8px rgba(140, 85, 242, 0.3);
    }
}

/* Done step */
.step.done .step-dot {
    border-color: var(--green);
    background: var(--green);
    animation: pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.step.done .step-dot svg {
    opacity: 1;
}

.step.done .step-dot svg path {
    stroke-dasharray: 15;
    stroke-dashoffset: 15;
    animation: draw-check 0.4s ease-out forwards;
    animation-delay: 0.1s;
}

.step.done .step-label {
    color: var(--green);
    font-weight: 600;
}

@keyframes pop-in {
    0% {
        transform: scale(0.8);
    }

    40% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes draw-check {
    to {
        stroke-dashoffset: 0;
    }
}

/* ── Status ── */
.status {
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-muted);
    min-height: 20px;
}

.status.error {
    color: var(--red);
    background: var(--red-bg);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
}

/* ── Result ── */
.result-section {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.result-section.show {
    display: flex;
    animation: fade-in-up 0.6s var(--ease-spring) forwards;
}

.result-section.show~.history-column {
    margin-top: 0;
}

/* Compact mode when files are uploaded or result is shown */
.hero.compact-upload h1,
.hero.compact h1 {
    margin: 0;
}

.hero.compact-upload p,
.hero.compact p {
    font-size: 15px;
}

.hero.hidden {
    display: none;
}

@keyframes result-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.result-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.qa-badge {
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 12px;
    font-family: var(--font-display);
}

.qa-badge.high {
    background: var(--green-bg);
    color: var(--green);
}

.qa-badge.low {
    background: var(--red-bg);
    color: var(--red);
}

.dl-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.dl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #F2EAFF;
    color: #8C55F2;
    height: 30px;
    padding: 0 18px;
    min-width: 100px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s var(--ease);
    cursor: pointer;
}

// .dl-btn svg {
//     width: 14px;
//     height: 14px;
//     stroke: currentColor;
//     fill: none;
//     stroke-width: 2;
//     stroke-linecap: round;
// }

.dl-btn:hover {
    border-color: var(--color-base);
    background: var(--color-base-bg);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.preview {
    /* Styles moved to inline/container */
}

.preview-container {
    background: #f7f8fb;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    flex: 1;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.preview-result {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f5f5f8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
}

.preview-placeholder {
    color: var(--text-muted);
}

#previewPdfViewer {
    background: #FFFFFF;
    width: 100%;
    height: 100%;
    border: none;
    flex-shrink: 0;
}

/* PDF Viewer Loading Spinner */
.pdf-viewer-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f5f5f8;
    z-index: 10;
    gap: 16px;
}

.pdf-viewer-loading.hidden {
    display: none;
}

.pdf-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(140, 85, 242, 0.2);
    border-top-color: var(--color-base, #8c55f2);
    border-radius: 50%;
    animation: pdf-spin 1s linear infinite;
}

@keyframes pdf-spin {
    to {
        transform: rotate(360deg);
    }
}

.pdf-loading-text {
    color: var(--text-secondary, #5a5a7a);
    font-size: 14px;
    font-family: var(--font);
}

.preview img {
    width: 100%;
    display: block;
    cursor: zoom-in;
    box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.25);
    border-radius: 8px;
}


/* ── FAQ Section ── */
.faq-section {
    margin-top: 80px;
    margin-bottom: 80px;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.faq-title {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 48px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.faq-item {
    border-bottom: 1px solid #e8e5f0;
}

.faq-item:first-of-type {
    border-top: 1px solid #e8e5f0;
}

.faq-question {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 28px 0;
    font-family: var(--font);
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    transition: color 0.2s ease;
    list-style: none;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question:hover {
    color: var(--color-base);
}

.faq-number {
    flex-shrink: 0;
    color: var(--text-primary);
}

.faq-text {
    flex-grow: 1;
    padding-right: 24px;
    line-height: 1.4;
}

.faq-icon {
    position: relative;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 6px;
    margin-right: 8px;
}

.faq-icon::before,
.faq-icon::after {
    content: '';
    position: absolute;
    background-color: #8c55f2;
    /* Purple icon like in screenshot */
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 1px;
}

/* Horizontal line */
.faq-icon::before {
    top: 7px;
    left: 0;
    width: 16px;
    height: 2px;
}

/* Vertical line */
.faq-icon::after {
    top: 0;
    left: 7px;
    width: 2px;
    height: 16px;
}

/* When expanded, hide the vertical line to form a minus */
details[open] .faq-question .faq-icon::after {
    transform: rotate(90deg);
    opacity: 0;
}

.faq-answer {
    padding-bottom: 28px;
}

.faq-answer p {
    margin: 0;
    padding-bottom: 28px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
    padding-left: 32px;
}

@media (max-width: 768px) {
    .faq-title {
        font-size: 28px;
        margin-bottom: 32px;
    }

    .faq-question {
        font-size: 17px;
        padding: 24px 0;
    }

    .faq-answer p {
        font-size: 15px;
        padding-left: 28px;
    }
}

#historyCard {
    border: 1px solid #f1edf8;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.7);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    margin-bottom: 12px;
}

.history-toggle-icon {
    display: none;
}

.history-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    height: 0;
    overflow-y: auto;
    transition: max-height 0.3s var(--ease);
    padding-right: 10px;
    border-radius: 10px;
}

.history-content::-webkit-scrollbar {
    width: 6px;
}

.history-content::-webkit-scrollbar-track {
    background: #F2EAFF;
    border-radius: 4px;
}

.history-content::-webkit-scrollbar-thumb {
    background: #8C55F2;
    border-radius: 4px;
}

.history-content.collapsed {
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
}

.history-item {
    display: flex;
    align-items: stretch;
    cursor: pointer;
    gap: 12px;
    padding: 8px 12px;
    box-sizing: border-box;
    width: 100%;
    background: rgba(245, 246, 250, 0.70);
    border-radius: 12px;
    transition: background 0.2s var(--ease);
    position: relative;
    margin-bottom: 12px;
}

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

.history-item:hover {
    background: var(--color-base-bg);
}

.history-thumb {
    border: 1px solid #e7e7e7;
    width: 60px;
    height: 80px;
    border-radius: 6px;
    background: #D9D9D9;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.history-thumb:hover {
    opacity: 0.8;
}

.history-mode-badge {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1;
    white-space: nowrap;
}

.history-mode-badge.mode-quick {
    background: var(--green-bg);
    color: var(--green);
}

.history-mode-badge.mode-deep {
    background: rgba(140, 85, 242, 0.12);
    color: var(--color-base);
}

.history-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-title {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.19;
    font-family: var(--font-sf);
}

.history-date {
    font-size: 10px;
    font-weight: 510;
    color: #8E8E93;
    line-height: 1.19;
    font-family: var(--font-sf);
}

.history-links {
    display: flex;
    gap: 8px;
}

.history-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 12px;
    background: #F2EAFF;
    border-radius: 30px;
    font-size: 10px;
    font-weight: 600;
    color: #8C55F2;
    text-decoration: none;
    transition: all 0.2s var(--ease);
    line-height: 1.19;
    height: auto;
    font-family: var(--font-display);
}

.history-links a:hover {
    background: #E8D3FF;
    text-decoration: none;
}

.history-links a svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* ── Lightbox ── */
/* Using Fancybox 5 - styles handled by plugin */

/* ── Footer ── */
.footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.footer a {
    color: var(--color-base);
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

.footer-dot {
    color: var(--line-1);
}

/* ── Responsive ── */
@media (max-width: 992px) {
    .main-layout {
        flex-direction: column;
        gap: 16px;
    }

    .form-column,
    .history-column {
        width: 100%;
        flex: none;
    }

    .history-content {
        min-height: 50vh;
    }

    .result-menu {
        flex-wrap: wrap;
    }

    .result-menu #assignmentTitle {
        margin-bottom: 10px;
    }

    #previewPdfViewer {
        flex-grow: 1;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 20px 48px;
    }

    .hero {
        padding: 30px 0 20px;
    }

    .hero h1 {
        font-size: 34px;
    }

    .hero p {
        font-size: 16px;
        font-weight: 590;
        line-height: 1.35;
    }

    .hero-icon {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        margin-bottom: 16px;
        display: none;
    }

    .hero-icon svg {
        width: 24px;
        height: 24px;
    }

    .card {
        padding: 22px;
        border-radius: var(--radius-md);
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .loading-card {
        padding: 32px 20px 24px;
    }

    .step-label {
        font-size: 9px;
    }

    .stepper-track {
        left: 20px;
        right: 20px;
    }

    .header-link {
        display: none;
    }

    .bg-blob-1 {
        width: 250px;
        height: 250px;
    }

    .bg-blob-2 {
        width: 200px;
        height: 200px;
    }
}

/* ── 1024 Mini Game (desktop only, inside loading overlay) ── */
.game-wrapper {
    margin-top: 20px;
    text-align: center;
}

.game-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    background-color: #F2EAFF;
    padding: 0 20px;
    border-radius: 17px;
    transition: all 0.2s var(--ease);
    color: #8C55F2;
    height: 34px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.game-trigger:hover {
    opacity: .8;
}

.game-container {
    display: none;
    margin-top: 12px;
}

.game-container.open {
    display: block;
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 0 4px;
}

.game-score {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: var(--font-display);
}

.game-score span {
    color: var(--color-base);
}

.game-restart {
    background: none;
    border: none;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: var(--font);
}

.game-restart:hover {
    background: var(--color-base-bg);
    color: var(--color-base);
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 6px;
    max-width: 280px;
    margin: 0 auto;
    aspect-ratio: 1;
}

.game-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    transition: all 0.1s ease;
    user-select: none;
    aspect-ratio: 1;
}

.game-cell[data-val="2"] {
    background: #f0e6ff;
    color: #7a3de8;
}

.game-cell[data-val="4"] {
    background: #e4d4fc;
    color: #6b2ed4;
}

.game-cell[data-val="8"] {
    background: #d1b8f7;
    color: #fff;
}

.game-cell[data-val="16"] {
    background: #b88ef0;
    color: #fff;
}

.game-cell[data-val="32"] {
    background: #a06ae8;
    color: #fff;
}

.game-cell[data-val="64"] {
    background: #8c55f2;
    color: #fff;
}

.game-cell[data-val="128"] {
    background: #7a3de8;
    color: #fff;
    font-size: 15px;
}

.game-cell[data-val="256"] {
    background: #6b2ed4;
    color: #fff;
    font-size: 15px;
}

.game-cell[data-val="512"] {
    background: #5a1fc0;
    color: #fff;
    font-size: 15px;
}

.game-cell[data-val="1024"] {
    background: linear-gradient(135deg, #8c55f2, #c294ff);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 0 12px rgba(140, 85, 242, 0.4);
}

.game-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

.game-hint kbd {
    display: inline-block;
    padding: 1px 5px;
    font-size: 11px;
    font-family: var(--font);
    background: var(--bg-tertiary);
    border: 1px solid var(--line-1);
    border-radius: 3px;
    line-height: 1.4;
}

.game-over-msg {
    font-size: 13px;
    font-weight: 600;
    color: var(--red);
    margin-top: 6px;
}

.game-win-msg {
    font-size: 13px;
    font-weight: 600;
    color: var(--green);
    margin-top: 6px;
}

@media (max-width: 768px) {
    .game-wrapper {
        display: none;
    }
}