/*
 * GoFlow - Shared Styles
 * =====================
 * This stylesheet contains all shared styles for GoFlow pages:
 * - Dashboard
 * - Exercise
 * - Upgrade
 * - Profile
 */

/* =========================
   CSS Variables
   ========================= */
:root {
    --goflow-bg: #111827;
    --goflow-card: #1f2937;
    --goflow-border: #374151;
    --goflow-border-light: #4b5563;
    --goflow-green: #58cc02;
    --goflow-green-dark: #46a302;
    --goflow-green-shadow: #3d8a02;
    --goflow-red: #ff4b4b;
    --goflow-red-dark: #e63c3c;
    --goflow-yellow: #ffc107;
    --goflow-orange: #ff9600;
    --goflow-blue: #1cb0f6;
    --goflow-blue-dark: #1899d6;
    --goflow-purple: #ce82ff;
    --goflow-text: #fff;
    --goflow-text-muted: #8899a6;
    --goflow-text-light: #e6edf3;
    --goflow-font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --goflow-font-mono: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
}

/* =========================
   Base Styles
   ========================= */
* {
    font-family: var(--goflow-font);
}

/* Code stays monospace all the way down: without this the rule above sets every
   highlight.js token span inside a code block back to Outfit. */
code,
pre,
kbd,
samp {
    font-family: var(--goflow-font-mono);
}

code *,
pre * {
    font-family: inherit;
}

body {
    background: var(--goflow-bg);
    color: var(--goflow-text);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================
   Common Layout
   ========================= */
.goflow-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 1rem 1rem 1rem;
}

.exercise-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Prevent flash of unstyled content */
.exercise-container {
    opacity: 0;
    transition: opacity 0.15s ease-in;
}
.exercise-container.ready {
    opacity: 1;
}

/* =========================
   Back Links
   ========================= */
.back-link {
    color: var(--goflow-text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--goflow-green);
}

/* =========================
   Stats Display (Hearts, Energy, XP)
   ========================= */
.stats-display {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Hearts Display */
.hearts-display {
    display: flex;
    gap: 0.25rem;
    position: relative;
    cursor: help;
}

.hearts-display::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--goflow-card);
    color: var(--goflow-text-light);
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--goflow-border-light);
}

.hearts-display::before {
    content: '';
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--goflow-border-light);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1001;
}

.hearts-display:hover::after,
.hearts-display:hover::before {
    opacity: 1;
    visibility: visible;
}

.heart {
    font-size: 1.4rem;
}

.heart.empty {
    opacity: 0.3;
    filter: grayscale(100%);
}

.heart-icon {
    width: 22px;
    height: 22px;
    transition: all 0.3s ease;
}

.heart-icon.empty {
    opacity: 0.3;
    filter: grayscale(100%);
}

.heart-icon.breaking {
    animation: heartBreak 0.5s ease-out forwards;
}

@keyframes heartBreak {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: none;
    }
    20% {
        transform: scale(1.3);
        filter: brightness(1.2);
    }
    40% {
        transform: scale(0.9) rotate(-10deg);
    }
    60% {
        transform: scale(1.1) rotate(10deg);
        opacity: 0.7;
    }
    80% {
        transform: scale(0.5);
        opacity: 0.4;
        filter: grayscale(50%);
    }
    100% {
        transform: scale(0.8);
        opacity: 0.3;
        filter: grayscale(100%);
    }
}

.hearts-count {
    color: var(--goflow-red);
    font-weight: 700;
    font-size: 0.95rem;
    margin-left: 0.25rem;
}

.hearts-count.infinite {
    color: var(--goflow-green);
}

/* Energy Display */
.energy-display {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 193, 7, 0.15);
    padding: 0.35rem 0.65rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 193, 7, 0.3);
    position: relative;
    cursor: help;
}

.energy-display::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    transform: translateX(0);
    background: var(--goflow-card);
    color: var(--goflow-text-light);
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--goflow-border-light);
}

.energy-display::before {
    content: '';
    position: absolute;
    top: calc(100% + 2px);
    left: 20px;
    transform: translateX(0);
    border: 6px solid transparent;
    border-bottom-color: var(--goflow-border-light);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1001;
}

.energy-display:hover::after,
.energy-display:hover::before {
    opacity: 1;
    visibility: visible;
}

.energy-icon {
    font-size: 1.1rem;
}

.energy-icon-img {
    width: 20px;
    height: 20px;
}

.energy-count {
    color: var(--goflow-yellow);
    font-weight: 700;
    font-size: 0.95rem;
}

.energy-count.low {
    color: #ff6b6b;
}

.energy-count.infinite {
    color: var(--goflow-green);
}

/* =========================
   Exercise Header
   ========================= */
.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--goflow-card);
    border-radius: 12px;
}

/* =========================
   Exercise Card
   ========================= */
.exercise-card {
    background: var(--goflow-card);
    border-radius: 20px;
    padding: 2rem;
    border: 2px solid var(--goflow-border);
}

/* =========================
   Mascot Section
   ========================= */
.mascot-section {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.mascot-avatar {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    z-index: 1;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    animation: float 3s ease-in-out infinite;
    margin-bottom: -60px;
    margin-left: -10px;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.mascot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.speech-bubble {
    position: relative;
    background: linear-gradient(180deg, var(--goflow-border) 0%, var(--goflow-card) 100%);
    border: 3px solid var(--goflow-border-light);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    color: var(--goflow-text-light);
    font-size: 1rem;
    line-height: 1.5;
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    left: -16px;
    bottom: 20px;
    border-width: 12px 16px 12px 0;
    border-style: solid;
    border-color: transparent var(--goflow-border-light) transparent transparent;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    left: -10px;
    bottom: 23px;
    border-width: 9px 12px 9px 0;
    border-style: solid;
    border-color: transparent var(--goflow-border) transparent transparent;
}

.speech-bubble .highlight {
    color: var(--goflow-green);
    font-weight: 600;
}

.speech-bubble .speech-learning {
    margin-bottom: 0.75rem;
}

.speech-bubble .speech-task {
    font-weight: 700;
    color: #fff;
}

/* =========================
   Code Blocks
   ========================= */
.code-block {
    position: relative;
    z-index: 10;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #3c3f41;
}

.code-block pre {
    margin: 0;
    padding: 0;
}

.code-block pre code {
    font-family: var(--goflow-font-mono);
    font-size: 0.95rem;
    line-height: 1.8;
    display: block;
    padding: 1.5rem !important;
}

/* Display Code Block (visual puzzle) */
.display-code-section {
    position: relative;
    z-index: 10;
    margin-bottom: 1.5rem;
}

.display-code-section pre {
    margin: 0;
    border-radius: 12px;
    border: 2px solid #3c3f41;
}

.display-code-section pre code {
    font-family: var(--goflow-font-mono);
    font-size: 0.95rem;
    line-height: 1.8;
}

.display-code-section .missing {
    display: inline-block;
    background: linear-gradient(135deg, #3a3f44 0%, #2a2f34 100%);
    color: var(--goflow-green);
    padding: 0.15rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    border: 2px dashed var(--goflow-green);
    min-width: 1.5em;
    text-align: center;
    animation: blink 1s infinite;
    box-shadow: 0 0 8px rgba(88, 204, 2, 0.3);
}

.display-code-section .missing::before {
    content: "___";
    letter-spacing: 2px;
}

@keyframes blink {
    0%, 100% { border-color: var(--goflow-green); box-shadow: 0 0 8px rgba(88, 204, 2, 0.3); }
    50% { border-color: #78d32e; box-shadow: 0 0 12px rgba(88, 204, 2, 0.5); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Code completion blanks */
.blank-input {
    background: #3c3f41;
    border: 2px solid var(--goflow-green);
    border-radius: 4px;
    color: var(--goflow-green);
    padding: 0.1rem 0.4rem;
    font-family: var(--goflow-font-mono);
    font-size: inherit;
    width: 60px;
    vertical-align: baseline;
    line-height: inherit;
    margin: 0;
}

.blank-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(88, 204, 2, 0.3);
}

.blank-input.correct {
    border-color: var(--goflow-green);
    background: #1a4a2a;
}

.blank-input.incorrect {
    border-color: var(--goflow-red);
    background: #4a1a1a;
}

.code-completion-code {
    background: #282c34;
    padding: 1.5rem;
    border-radius: 10px;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 0.95rem;
    line-height: 1.8;
    white-space: pre;
    overflow-x: auto;
}

/* Override highlight.js background */
.hljs {
    background: #282c34 !important;
}

/* Keep code completion syntax highlighting inline */
#code-template .inline-code,
#code-template .inline-code.hljs {
    display: inline !important;
    padding: 0 !important;
    background: transparent !important;
}

/* =========================
   Multiple Choice Options
   ========================= */
.options-list {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-btn {
    display: block;
    width: 100%;
    padding: 1.1rem 1.5rem;
    background: var(--goflow-card);
    border: 3px solid var(--goflow-border-light);
    border-radius: 16px;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover {
    background: var(--goflow-border);
    border-color: var(--goflow-green);
    transform: scale(1.02);
}

.option-btn.selected {
    background: #1a3a2a;
    border-color: var(--goflow-green);
    box-shadow: 0 0 0 2px rgba(88, 204, 2, 0.2);
}

.option-btn.correct {
    background: #1a4a2a;
    border-color: var(--goflow-green);
}

.option-btn.incorrect {
    background: #4a1a1a;
    border-color: var(--goflow-red);
}

/* Code options - syntax highlighted */
.option-btn.code-option {
    font-family: var(--goflow-font-mono);
    font-size: 0.9rem;
    padding: 0.9rem 1.2rem;
    line-height: 1.5;
}

.option-btn.code-option code {
    background: transparent;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
}

.option-btn.code-option .hljs {
    background: transparent !important;
    padding: 0 !important;
}

/* =========================
   Code Order (Drag & Drop)
   ========================= */
.instruction-text {
    position: relative;
    z-index: 10;
    color: var(--goflow-text-muted);
    margin-bottom: 1rem;
    margin-top: 2.5rem;
    font-size: 0.95rem;
    clear: both;
}

.code-blocks-container {
    position: relative;
    z-index: 10;
    min-height: 200px;
    padding: 1rem;
    background: #0d1117;
    border: 2px dashed var(--goflow-border-light);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.draggable-block {
    margin-bottom: 0.6rem;
    cursor: grab;
    user-select: none;
    transition: all 0.2s;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #3c3f41;
    touch-action: none;
    -webkit-touch-callout: none;
}

.draggable-block pre {
    margin: 0;
    padding: 0;
}

.draggable-block pre code {
    font-family: var(--goflow-font-mono);
    font-size: 0.9rem;
    padding: 0.85rem 1.25rem !important;
    display: block;
}

.draggable-block:hover {
    border-color: var(--goflow-green);
    transform: translateX(4px);
}

.draggable-block.dragging {
    opacity: 0.5;
}

.draggable-block.correct {
    border-left: 4px solid var(--goflow-green);
}

.draggable-block.incorrect {
    border-left: 4px solid var(--goflow-red);
}

/* =========================
   Match Pairs
   ========================= */
.match-container {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
}

.match-column-label {
    display: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--goflow-border);
}

.instruction-mobile {
    display: none;
}

.match-column {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.match-item {
    padding: 1rem;
    background: var(--goflow-card);
    border: 3px solid var(--goflow-border-light);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
    font-size: 0.95rem;
    position: relative;
}

.match-item:hover:not(.matched) {
    border-color: var(--goflow-green);
    background: #2a3a42;
}

.match-item.selected {
    background: #1a3a2a;
    border-color: var(--goflow-green);
    box-shadow: 0 0 0 2px rgba(88, 204, 2, 0.3);
}

.match-item.matched {
    cursor: default;
}

/* Color-coded matched pairs */
.match-item.matched.pair-0 { border-color: var(--goflow-green); background: rgba(88, 204, 2, 0.15); }
.match-item.matched.pair-1 { border-color: var(--goflow-blue); background: rgba(28, 176, 246, 0.15); }
.match-item.matched.pair-2 { border-color: #2dd4bf; background: rgba(45, 212, 191, 0.15); }
.match-item.matched.pair-3 { border-color: #e879f9; background: rgba(232, 121, 249, 0.15); }
.match-item.matched.pair-4 { border-color: #a560e8; background: rgba(165, 96, 232, 0.15); }
.match-item.matched.pair-5 { border-color: #ffc800; background: rgba(255, 200, 0, 0.15); }

.match-item .pair-indicator {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.match-item.matched .pair-indicator {
    opacity: 1;
}

.match-item.matched.pair-0 .pair-indicator { background: var(--goflow-green); }
.match-item.matched.pair-1 .pair-indicator { background: var(--goflow-blue); }
.match-item.matched.pair-2 .pair-indicator { background: #2dd4bf; }
.match-item.matched.pair-3 .pair-indicator { background: #e879f9; }
.match-item.matched.pair-4 .pair-indicator { background: #a560e8; }
.match-item.matched.pair-5 .pair-indicator { background: #ffc800; }

/* Code-style match items */
.match-item.code-match {
    font-family: var(--goflow-font-mono);
    font-size: 0.95rem;
    padding: 0.75rem 0.9rem;
    line-height: 1.4;
}

.match-item.code-match code {
    background: transparent;
    padding: 0;
    font-family: var(--goflow-font-mono);
    font-size: inherit;
    color: #9cdcfe;
}

.match-item.code-match .hljs {
    background: transparent !important;
    padding: 0 !important;
    color: #9cdcfe;
}

/* hljs colors for match items */
.match-item.code-match .hljs-keyword { color: #c586c0; }
.match-item.code-match .hljs-built_in { color: #dcdcaa; }
.match-item.code-match .hljs-type { color: #4ec9b0; }
.match-item.code-match .hljs-literal { color: #569cd6; }
.match-item.code-match .hljs-number { color: #b5cea8; }
.match-item.code-match .hljs-string { color: #ce9178; }
.match-item.code-match .hljs-title { color: #dcdcaa; }
.match-item.code-match .hljs-function { color: #dcdcaa; }

/* =========================
   Spot Error
   ========================= */
.code-lines {
    position: relative;
    z-index: 10;
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 2px solid #3c3f41;
    background: #2b2b2b;
}

.code-line {
    display: flex;
    width: max-content;
    min-width: 100%;
    cursor: pointer;
    transition: background 0.2s;
    background: #2b2b2b;
}

.code-line:hover {
    background: #333a46;
}

.code-line.selected {
    background: #214283;
}

.code-line.correct {
    background: #1a4a2a;
}

.code-line.incorrect {
    background: #4a1a1a;
}

.line-number {
    width: 50px;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 0.3rem 0.5rem;
    text-align: right;
    color: #606366;
    font-family: var(--goflow-font-mono);
    font-size: 0.85rem;
    user-select: none;
    background: transparent;
}

.code-line.selected .line-number {
    color: #fff;
}

.line-content {
    flex: 1;
    padding: 0.3rem 1rem;
    font-family: var(--goflow-font-mono);
    font-size: 0.9rem;
    white-space: pre;
    background: transparent;
}

/* =========================
   Code Exec - Monaco Editor
   ========================= */
.code-editor-container {
    position: relative;
    z-index: 10;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #3c3f41;
    margin-bottom: 1rem;
}

#monaco-editor {
    width: 100%;
    height: 300px;
}

.editor-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.run-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(180deg, #4a9eff 0%, #2d7dd2 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 0 #1a5fa8;
}

.run-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #1a5fa8;
}

.run-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #1a5fa8;
}

.run-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.run-btn.running {
    background: linear-gradient(180deg, #6b7280 0%, #4b5563 100%);
    box-shadow: 0 4px 0 var(--goflow-border);
}

.run-icon {
    font-size: 0.9rem;
}

.output-container {
    background: #1e1e1e;
    border-radius: 12px;
    border: 2px solid #3c3f41;
    overflow: hidden;
    margin-bottom: 1rem;
}

.output-header {
    background: #2d2d2d;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--goflow-text-muted);
    font-weight: 600;
    border-bottom: 1px solid #3c3f41;
}

.output-content {
    padding: 1rem;
    margin: 0;
    font-family: var(--goflow-font-mono);
    font-size: 0.9rem;
    color: var(--goflow-text-light);
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

.output-content.error {
    color: #ff6b6b;
}

.output-content.success {
    color: var(--goflow-green);
}

/* =========================
   Buttons
   ========================= */
.submit-section {
    margin-top: 2rem;
    text-align: center;
}

.submit-btn {
    background: linear-gradient(180deg, #78d32e 0%, #58cc02 50%, #46a302 100%);
    color: white;
    padding: 1rem 4rem;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 6px 0 var(--goflow-green-shadow);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 var(--goflow-green-shadow);
}

.submit-btn:active {
    transform: translateY(2px);
    box-shadow: 0 4px 0 var(--goflow-green-shadow);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 6px 0 var(--goflow-green-shadow);
}

.clear-btn {
    background: linear-gradient(180deg, #4a5d66 0%, #4b5563 50%, #374151 100%);
    color: white;
    padding: 1rem 4rem;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 6px 0 #1f2d35;
    margin-right: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clear-btn:hover {
    background: linear-gradient(180deg, #5a6d76 0%, #4c5d66 50%, #3a4b54 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #1f2d35;
}

.clear-btn:active {
    transform: translateY(2px);
    box-shadow: 0 4px 0 #1f2d35;
}

/* =========================
   Feedback Panel
   ========================= */
.feedback-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.feedback-overlay.show {
    transform: translateY(0);
}

body.feedback-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.feedback {
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    box-sizing: border-box;
    width: 100%;
}

.feedback.correct {
    background: linear-gradient(180deg, #10B981 0%, #059669 100%);
    border-top: 4px solid #34D399;
}

.feedback.incorrect {
    background: linear-gradient(180deg, #ff4b4b 0%, #e63c3c 100%);
    border-top: 4px solid #ff6b6b;
}

.feedback-content {
    flex: 1;
}

.feedback-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.feedback-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.feedback-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.feedback-icon {
    font-size: 2rem;
    animation: celebratePop 0.5s ease-out;
}

@keyframes celebratePop {
    0% { transform: scale(0) rotate(-15deg); }
    50% { transform: scale(1.3) rotate(10deg); }
    100% { transform: scale(1) rotate(0); }
}

.feedback h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}

.feedback p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    font-size: 1rem;
}

.hearts-warning {
    display: block;
    margin-top: 0.75rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 75, 75, 0.2);
    border: 1px solid rgba(255, 75, 75, 0.4);
    border-radius: 8px;
    font-size: 0.9rem;
    color: #ff9999;
}

@keyframes xpPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.xp-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    animation: xpPop 0.4s ease-out forwards;
}

.xp-earned {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    margin-top: 0.75rem;
    font-size: 0.95rem;
    animation: xpPop 0.6s ease-out 0.3s both;
}

.feedback-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.next-btn {
    display: inline-block;
    background: #fff;
    color: var(--goflow-green-dark);
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--goflow-font);
}

.feedback.incorrect .next-btn {
    color: var(--goflow-red-dark);
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15);
}

.next-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}

.next-btn.upgrade-btn {
    background: linear-gradient(180deg, #ffd700 0%, #ffb700 50%, #ff9500 100%) !important;
    color: #1a1a1a !important;
    box-shadow: 0 4px 0 #cc7700 !important;
    animation: upgradeGlow 2s ease-in-out infinite;
}

.next-btn.upgrade-btn:hover {
    box-shadow: 0 6px 0 #cc7700, 0 0 20px rgba(255, 215, 0, 0.4) !important;
}

@keyframes upgradeGlow {
    0%, 100% { box-shadow: 0 4px 0 #cc7700, 0 0 10px rgba(255, 215, 0, 0.2); }
    50% { box-shadow: 0 4px 0 #cc7700, 0 0 20px rgba(255, 215, 0, 0.5); }
}

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* Profile Link */
.profile-link {
    color: #1cb0f6;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
}

.profile-link:hover {
    text-decoration: underline;
}

/* =========================
   Dashboard - Top Stats Bar
   ========================= */
.top-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--goflow-card);
    border-radius: 12px 12px 0 0;
    margin: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    position: relative;
    cursor: help;
}

.stat-item::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--goflow-card);
    color: var(--goflow-text-light);
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--goflow-border-light);
}

.stat-item::before {
    content: '';
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--goflow-border-light);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1001;
}

.stat-item:hover::after,
.stat-item:hover::before {
    opacity: 1;
    visibility: visible;
}

.stat-icon {
    font-size: 1.2rem;
}

.stat-value {
    color: #fff;
}

.hearts-stat .stat-value { color: var(--goflow-red); }
.energy-stat .stat-value { color: var(--goflow-yellow); }
.energy-stat .stat-value.low { color: #ff6b6b; }
.energy-stat .stat-value.infinite { color: var(--goflow-green); }

/* Energy tooltip position */
.energy-stat::after {
    left: 0;
    transform: translateX(0);
}
.energy-stat::before {
    left: 20px;
    transform: translateX(0);
}

.xp-stat .stat-value { color: #ffc800; }
.streak-stat .stat-value { color: var(--goflow-orange); }
.level-stat .stat-value { color: var(--goflow-blue); }

.stat-icon-img {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

.stat-icon-img.flame {
    width: 32px;
    height: 32px;
    margin-bottom: -10px;
}

.stat-icon-img.star {
    width: 32px;
    height: 32px;
    margin-bottom: -8px;
}

.stat-icon-img.level {
    width: 32px;
    height: 32px;
    margin-bottom: -8px;
}

/* =========================
   Dashboard - Premium Banner
   ========================= */
.premium-banner {
    background: linear-gradient(135deg, var(--goflow-green), var(--goflow-green-dark));
    border-radius: 16px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* =========================
   Dashboard - Promo Banner
   ========================= */
.promo-banner {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    margin: 0.75rem 0 2.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 5;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.25);
}

.promo-banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.promo-headline {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.promo-headline strong {
    font-size: 1.1rem;
    font-weight: 800;
}

.promo-headline .original-price {
    text-decoration: line-through;
    opacity: 0.75;
    font-size: 0.85rem;
}

.promo-countdown {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.promo-countdown-timer {
    display: flex;
    gap: 0.25rem;
}

.countdown-segment {
    background: rgba(0,0,0,0.2);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    min-width: 1.75rem;
    text-align: center;
}

.promo-cta {
    display: inline-block;
    background: #fff;
    color: #d97706;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.promo-cta:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* =========================
   Dashboard - Section Divider
   ========================= */
.section-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 0 1.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--goflow-green), var(--goflow-green-dark));
    border-radius: 0 0 16px 16px;
    color: #fff;
    position: sticky;
    top: 52px;
    z-index: 99;
}

/* Unit Completion Celebration */
.section-divider.celebrating {
    animation: celebrateUnit 1s ease-out;
    box-shadow: 0 0 30px rgba(88, 204, 2, 0.6), 0 0 60px rgba(88, 204, 2, 0.3);
}

@keyframes celebrateUnit {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    30% {
        transform: scale(1.05);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

.section-group {
    padding-top: 1.5rem;
}

.section-group + .section-divider {
    margin-top: 2rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    flex: 1;
}

/* Section Color Themes */
.section-color-0, .section-divider[data-color="0"] { background: linear-gradient(135deg, #58cc02, #46a302); }
.section-color-1, .section-divider[data-color="1"] { background: linear-gradient(135deg, #1cb0f6, #1899d6); }
.section-color-2, .section-divider[data-color="2"] { background: linear-gradient(135deg, #ff9600, #e68600); }
.section-color-3, .section-divider[data-color="3"] { background: linear-gradient(135deg, #ce82ff, #a855f7); }
.section-color-4, .section-divider[data-color="4"] { background: linear-gradient(135deg, #ff4b4b, #e63c3c); }
.section-color-5, .section-divider[data-color="5"] { background: linear-gradient(135deg, #2dd4bf, #14b8a6); }
.section-color-6, .section-divider[data-color="6"] { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.section-color-7, .section-divider[data-color="7"] { background: linear-gradient(135deg, #f472b6, #ec4899); }

/* =========================
   Dashboard - Exercise Path
   ========================= */
.exercise-path {
    position: relative;
    padding: 0;
    margin-top: -36px;
    overflow: visible;
}

.path-row {
    display: flex;
    justify-content: center;
    height: 100px;
    align-items: center;
    position: relative;
    overflow: visible;
}

.path-row.after-section {
    margin-top: 1rem;
}

/* Snake pattern positions */
.path-row.pos-0 .exercise-node { transform: translateX(0); }
.path-row.pos-1 .exercise-node { transform: translateX(70px); }
.path-row.pos-2 .exercise-node { transform: translateX(100px); }
.path-row.pos-3 .exercise-node { transform: translateX(70px); }
.path-row.pos-4 .exercise-node { transform: translateX(0); }
.path-row.pos-5 .exercise-node { transform: translateX(-70px); }
.path-row.pos-6 .exercise-node { transform: translateX(-100px); }
.path-row.pos-7 .exercise-node { transform: translateX(-70px); }

/* Exercise Node */
.exercise-node {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    text-decoration: none;
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 4px solid transparent;
    overflow: visible;
}

.exercise-node:hover:not(.locked) {
    scale: 1.05;
}

.exercise-node:active:not(.locked) {
    scale: 0.98;
}

/* Exercise Node States */
.exercise-node.completed {
    background: linear-gradient(180deg, #78d32e 0%, #58cc02 50%, #46a302 100%);
    box-shadow: 0 6px 0 var(--goflow-green-shadow), inset 0 2px 0 rgba(255,255,255,0.2);
    color: #fff;
    border-color: var(--goflow-green-dark);
    font-weight: 800;
    font-size: 2rem;
    line-height: 1;
}

.exercise-node.completed:hover {
    box-shadow: 0 8px 0 var(--goflow-green-shadow), inset 0 2px 0 rgba(255,255,255,0.2), 0 0 20px rgba(88, 204, 2, 0.4);
}

.exercise-node.current {
    background: linear-gradient(180deg, #78d32e 0%, #58cc02 50%, #46a302 100%);
    box-shadow: 0 6px 0 var(--goflow-green-shadow), inset 0 2px 0 rgba(255,255,255,0.2);
    color: #fff;
    border-color: var(--goflow-green-dark);
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.exercise-node.available {
    background: linear-gradient(180deg, #4a5d66 0%, #4b5563 50%, #374151 100%);
    box-shadow: 0 6px 0 #1f2d35, inset 0 2px 0 rgba(255,255,255,0.05);
    color: var(--goflow-text-muted);
    border-color: var(--goflow-border-light);
}

.exercise-node.available:hover {
    background: linear-gradient(180deg, #5a6d76 0%, #4c5d66 50%, #3a4b54 100%);
    box-shadow: 0 6px 0 #1f2d35, inset 0 2px 0 rgba(255,255,255,0.05), 0 0 15px rgba(88, 204, 2, 0.2);
}

.exercise-node.locked {
    background: linear-gradient(180deg, #2f3d45 0%, #374151 50%, #1f2d35 100%);
    box-shadow: 0 6px 0 #161f25, inset 0 2px 0 rgba(255,255,255,0.02);
    color: #4a5a64;
    cursor: not-allowed;
    border-color: var(--goflow-border);
}

.exercise-node.locked:hover {
    background: linear-gradient(180deg, #3a4850 0%, #354550 50%, #2a3a42 100%);
    border-color: #3d4f5f;
}

.exercise-star {
    width: 38px;
    height: 38px;
    filter: brightness(0) invert(1);
}

.exercise-lock {
    width: 28px;
    height: 28px;
    opacity: 0.6;
}

/* Progress Ring */
.progress-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    border-radius: 50%;
    border: 5px solid rgba(88, 204, 2, 0.3);
    border-top-color: var(--goflow-green);
    border-right-color: var(--goflow-green);
    animation: spin 2s linear infinite;
    pointer-events: none;
}

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

/* =========================
   Dashboard - Exercise Popup
   ========================= */
.exercise-popup {
    position: absolute;
    top: calc(100% + 16px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: linear-gradient(135deg, var(--goflow-green), var(--goflow-green-dark));
    border-radius: 16px;
    padding: 1rem 1.25rem;
    min-width: 260px;
    max-width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    text-align: center;
}

.exercise-node.popup-active {
    z-index: 500 !important;
}

.path-row.popup-active {
    z-index: 500 !important;
}

.exercise-popup.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

.exercise-popup::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-bottom-color: var(--goflow-green);
}

.popup-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.popup-start-btn {
    display: block;
    width: 100%;
    background: #fff;
    color: var(--goflow-green-dark);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popup-start-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.popup-start-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.popup-start-btn .btn-text {
    display: inline;
}

.popup-start-btn .btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

.popup-start-btn.loading .btn-spinner {
    display: inline-block;
}

.popup-start-btn.loading .btn-text {
    opacity: 0.7;
}

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

.popup-start-btn.review {
    color: #666;
}

/* Out of Energy Popup */
.exercise-popup.no-energy {
    background: linear-gradient(135deg, var(--goflow-border) 0%, var(--goflow-card) 100%) !important;
    border: 2px solid var(--goflow-yellow);
}

.exercise-popup.no-energy::before {
    border-bottom-color: var(--goflow-yellow) !important;
}

.no-energy-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.no-energy-icon-img {
    width: 48px;
    height: 48px;
    margin-bottom: 0.5rem;
}

.no-energy-title {
    color: var(--goflow-yellow);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.energy-countdown {
    color: var(--goflow-text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.energy-countdown-time {
    color: #fff;
    font-weight: 700;
    font-family: monospace;
}

.popup-upgrade-btn {
    display: block;
    width: 100%;
    background: linear-gradient(180deg, #ffd700 0%, #ffb700 50%, #ff9500 100%);
    color: #1a1a1a;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 3px 0 #cc7700;
}

.popup-upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 0 #cc7700;
}

/* Locked Exercise Popup */
.exercise-popup.locked-popup {
    background: linear-gradient(135deg, var(--goflow-border) 0%, var(--goflow-card) 100%) !important;
    border: 2px solid var(--goflow-green);
}

.exercise-popup.locked-popup::before {
    border-bottom-color: var(--goflow-green) !important;
}

.locked-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.locked-title {
    color: var(--goflow-green);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.locked-subtitle {
    color: var(--goflow-text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

/* =========================
   Dashboard - Coming Soon Banner
   ========================= */
.coming-soon-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 2rem 1rem;
    padding: 1.25rem 2rem;
    background: linear-gradient(145deg, #1c2631 0%, #151d27 100%);
    border: 2px dashed var(--goflow-border-light);
    border-radius: 16px;
    color: var(--goflow-text-muted);
    font-size: 1rem;
    font-weight: 600;
}

.coming-soon-banner .lock-icon {
    font-size: 1.25rem;
}

.coming-soon-banner .lock-icon-img {
    width: 24px;
    height: 24px;
}

.coming-soon-banner .banner-text {
    color: var(--goflow-text-muted);
}

.coming-soon-banner .highlight {
    color: var(--goflow-green);
}

/* =========================
   Free Content Complete Banner
   ========================= */
.free-content-complete-banner {
    margin: 2rem 1rem;
    padding: 1.5rem;
    background: linear-gradient(145deg, #1a3a2e 0%, #0f2a1f 100%);
    border: 2px solid var(--goflow-green);
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(88, 204, 2, 0.2);
}

.free-content-complete-banner .banner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.free-content-complete-banner .banner-icon {
    font-size: 2.5rem;
    animation: bounce 1s ease infinite;
}

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

.free-content-complete-banner .banner-text h3 {
    color: var(--goflow-green);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.free-content-complete-banner .banner-text p {
    color: var(--goflow-text-secondary);
    font-size: 0.95rem;
    margin: 0;
    max-width: 400px;
}

.free-content-complete-banner .banner-upgrade-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(145deg, var(--goflow-green) 0%, #4CAF50 100%);
    color: #0a1628;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(88, 204, 2, 0.4);
    transition: all 0.2s ease;
}

.free-content-complete-banner .banner-upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(88, 204, 2, 0.5);
}

/* =========================
   Dashboard - Path Gopher
   ========================= */
.path-gopher {
    position: absolute;
    width: 110px;
    height: 110px;
    object-fit: contain;
    opacity: 0.9;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.35));
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.path-gopher.left-side {
    left: calc(50% - 200px);
}

.path-gopher.right-side {
    right: calc(50% - 200px);
}

/* =========================
   Dashboard - Jump To Current Button
   ========================= */
.jump-to-current {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--goflow-card);
    border: 2px solid var(--goflow-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(10px);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.jump-to-current.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.jump-to-current:hover {
    background: #243640;
    border-color: var(--goflow-blue);
    transform: scale(1.05) translateY(0);
    box-shadow: 0 6px 20px rgba(28, 176, 246, 0.3);
}

.jump-to-current:active {
    transform: scale(0.95) translateY(0);
}

.jump-to-current svg {
    width: 24px;
    height: 24px;
    stroke: var(--goflow-blue);
    stroke-width: 2.5;
    fill: none;
    transition: transform 0.2s ease;
}

.jump-to-current:hover svg {
    transform: translateY(-2px);
}

.jump-to-current.down svg {
    transform: rotate(180deg);
}

.jump-to-current.down:hover svg {
    transform: rotate(180deg) translateY(-2px);
}

/* =========================
   Media Queries
   ========================= */
@media (max-width: 640px) {
    .exercise-card {
        padding: 1.5rem;
    }

    .match-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .match-column-label {
        display: block;
    }

    .instruction-desktop {
        display: none;
    }

    .instruction-mobile {
        display: block;
    }

    #left-column .match-item {
        border-left: 3px solid #3b82f6;
        background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, transparent 20%);
    }

    #right-column .match-item {
        border-left: 3px solid #8b5cf6;
        background: linear-gradient(90deg, rgba(139, 92, 246, 0.1) 0%, transparent 20%);
    }

    #left-column .match-column-label {
        color: #3b82f6;
    }

    #right-column .match-column-label {
        color: #8b5cf6;
    }

    .submit-section {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .submit-btn,
    .clear-btn {
        padding: 1rem 2rem;
        width: 100%;
        margin-right: 0;
    }

    .feedback {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem 1rem;
        gap: 0.75rem;
        max-width: 100vw;
        max-height: 60vh;
        overflow-y: auto;
    }

    .feedback h3 {
        font-size: 1.25rem;
    }

    .feedback p {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .feedback-icon {
        font-size: 1.5rem;
    }

    .feedback-actions {
        width: 100%;
        align-items: center;
    }

    .next-btn {
        width: 100%;
        max-width: 280px;
    }

    .feedback-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .feedback-header-right {
        width: 100%;
        justify-content: flex-start;
    }

    .xp-badge {
        font-size: 0.9rem;
        padding: 0.3rem 0.6rem;
    }

    /* Dashboard mobile */
    .top-stats {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .stat-item {
        font-size: 0.85rem;
    }

    .path-row.pos-0 .exercise-node { transform: translateX(0); }
    .path-row.pos-1 .exercise-node { transform: translateX(40px); }
    .path-row.pos-2 .exercise-node { transform: translateX(60px); }
    .path-row.pos-3 .exercise-node { transform: translateX(40px); }
    .path-row.pos-4 .exercise-node { transform: translateX(0); }
    .path-row.pos-5 .exercise-node { transform: translateX(-40px); }
    .path-row.pos-6 .exercise-node { transform: translateX(-60px); }
    .path-row.pos-7 .exercise-node { transform: translateX(-40px); }

    .path-gopher {
        width: 70px;
        height: 70px;
    }

    .path-gopher.left-side {
        left: calc(50% - 120px);
    }

    .path-gopher.right-side {
        right: calc(50% - 120px);
    }

    .exercise-node {
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
    }

    .path-row {
        height: 85px;
    }

    .path-row.after-section {
        margin-top: 1.25rem;
    }

    .section-group {
        padding-top: 2rem;
    }

    .jump-to-current {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }

    .promo-banner {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.6rem 1rem;
    }
    
    .promo-headline {
        font-size: 0.9rem;
        text-align: center;
    }
    
    .promo-cta {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .feedback-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .feedback-header-right {
        width: 100%;
        justify-content: flex-start;
    }

    .xp-badge {
        font-size: 0.9rem;
        padding: 0.3rem 0.6rem;
    }
}

@media (max-width: 400px) {
    .path-row.pos-1 .exercise-node { transform: translateX(30px); }
    .path-row.pos-2 .exercise-node { transform: translateX(45px); }
    .path-row.pos-3 .exercise-node { transform: translateX(30px); }
    .path-row.pos-5 .exercise-node { transform: translateX(-30px); }
    .path-row.pos-6 .exercise-node { transform: translateX(-45px); }
    .path-row.pos-7 .exercise-node { transform: translateX(-30px); }

    .path-gopher {
        width: 55px;
        height: 55px;
    }

    .path-gopher.left-side {
        left: calc(50% - 95px);
    }

    .path-gopher.right-side {
        right: calc(50% - 95px);
    }

    .exercise-node {
        width: 54px;
        height: 54px;
        font-size: 1.3rem;
    }
}

/* =========================
   Dashboard - Streak Modal
   ========================= */
.streak-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.streak-modal-overlay.hidden {
    display: none;
}

.streak-modal {
    background: var(--goflow-card);
    border-radius: 24px;
    padding: 2rem;
    max-width: 380px;
    width: 100%;
    text-align: center;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.streak-modal-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 150, 0, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.streak-modal-icon.sad-gopher {
    width: 120px;
    height: 120px;
    background: none;
    border-radius: 0;
}

.streak-modal-icon.sad-gopher img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.streak-modal-icon .streak-flame {
    width: 48px;
    height: 48px;
}

.streak-modal-icon .streak-flame.broken {
    filter: grayscale(50%) opacity(0.7);
}

.streak-modal-icon.repaired {
    animation: iconPulse 0.6s ease-out;
}

.streak-modal-icon .flame-animate {
    animation: flameGlow 1s ease-in-out infinite;
}

@keyframes flameGlow {
    0%, 100% { 
        filter: drop-shadow(0 0 8px rgba(255, 150, 0, 0.6));
        transform: scale(1);
    }
    50% { 
        filter: drop-shadow(0 0 16px rgba(255, 100, 0, 0.9));
        transform: scale(1.1);
    }
}

@keyframes iconPulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.streak-counter-container {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.streak-counter-number {
    font-size: 4rem;
    font-weight: 800;
    color: var(--goflow-orange);
    text-shadow: 0 0 20px rgba(255, 150, 0, 0.5);
    transition: transform 0.1s ease-out;
    font-variant-numeric: tabular-nums;
}

.streak-counter-label {
    font-size: 1.5rem;
    color: #8b9aa5;
    font-weight: 600;
}

.streak-counter-number.streak-final {
    animation: finalCelebration 0.5s ease-out forwards;
}

@keyframes finalCelebration {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); color: var(--goflow-green); text-shadow: 0 0 30px rgba(88, 204, 2, 0.8); }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); color: var(--goflow-orange); text-shadow: 0 0 20px rgba(255, 150, 0, 0.5); }
}

.streak-modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
}

.streak-modal-title.streak-repaired {
    color: var(--goflow-green);
    animation: titlePop 0.4s ease-out;
}

@keyframes titlePop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.streak-modal-subtitle {
    font-size: 1rem;
    color: var(--goflow-text-muted);
    margin-bottom: 1rem;
}

.streak-modal-subtitle .streak-count {
    color: var(--goflow-orange);
    font-weight: 700;
}

.streak-modal-text {
    font-size: 0.95rem;
    color: var(--goflow-text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.pro-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--goflow-green), var(--goflow-green-dark));
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}

.streak-modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    margin-bottom: 0.75rem;
    text-decoration: none;
    transition: all 0.2s;
}

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

.streak-modal-btn.primary {
    background: linear-gradient(135deg, var(--goflow-green), var(--goflow-green-dark));
    color: #fff;
}

.streak-modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(88, 204, 2, 0.3);
}

.streak-modal-btn.secondary {
    background: var(--goflow-border);
    color: var(--goflow-text-muted);
}

.streak-modal-btn.secondary:hover {
    background: var(--goflow-border-light);
    color: #fff;
}

.streak-modal-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.streak-repaired {
    color: var(--goflow-green);
}

/* =========================
   Dashboard - Upgrade Celebration
   ========================= */
.stat-item.upgraded {
    animation: statPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stat-item.upgraded .stat-value {
    animation: statGlow 2s ease-in-out 3;
}

@keyframes statPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes statGlow {
    0%, 100% { 
        text-shadow: none;
        color: inherit;
    }
    50% { 
        text-shadow: 0 0 20px var(--goflow-green), 0 0 40px var(--goflow-green);
        color: var(--goflow-green);
    }
}

.upgrade-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: linear-gradient(135deg, var(--goflow-card) 0%, var(--goflow-bg) 100%);
    border: 2px solid var(--goflow-green);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10000;
    box-shadow: 0 8px 32px rgba(88, 204, 2, 0.3);
    opacity: 0;
    animation: toastSlideIn 0.5s ease forwards, toastSlideOut 0.5s ease 4s forwards;
}

@keyframes toastSlideIn {
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

.upgrade-toast-icon {
    font-size: 1.5rem;
    animation: bounce 0.5s ease infinite alternate;
}

.upgrade-toast-text {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

.upgrade-toast-tier {
    color: var(--goflow-green);
    font-weight: 700;
}

/* =========================
   Upgrade Page
   ========================= */
.upgrade-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    border-radius: 50px;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 2px solid;
    position: relative;
    overflow: hidden;
}

/* Shimmer effect on hover */
.status-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.status-badge.hearts {
    background: linear-gradient(135deg, rgba(255, 75, 75, 0.28) 0%, rgba(180, 40, 40, 0.18) 100%);
    border-color: #ff5252;
    border-width: 2px;
    color: #fff;
    box-shadow: 
        0 0 35px rgba(255, 75, 75, 0.55),
        0 0 70px rgba(255, 75, 75, 0.25),
        0 4px 20px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    animation: heartbeat 1.4s ease-in-out infinite;
    padding-left: 3.2rem;
    font-size: 1.05rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

@keyframes heartbeat {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 
            0 0 35px rgba(255, 75, 75, 0.55),
            0 0 70px rgba(255, 75, 75, 0.25),
            0 4px 20px rgba(0, 0, 0, 0.45);
    }
    14% { 
        transform: scale(1.045);
        box-shadow: 
            0 0 45px rgba(255, 75, 75, 0.75),
            0 0 90px rgba(255, 75, 75, 0.35),
            0 4px 20px rgba(0, 0, 0, 0.45);
    }
    28% { 
        transform: scale(1);
        box-shadow: 
            0 0 35px rgba(255, 75, 75, 0.55),
            0 0 70px rgba(255, 75, 75, 0.25),
            0 4px 20px rgba(0, 0, 0, 0.45);
    }
    42% { 
        transform: scale(1.025);
        box-shadow: 
            0 0 40px rgba(255, 75, 75, 0.65),
            0 0 80px rgba(255, 75, 75, 0.3),
            0 4px 20px rgba(0, 0, 0, 0.45);
    }
}

.status-badge.energy {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.28) 0%, rgba(180, 140, 0, 0.18) 100%);
    border-color: #ffc107;
    border-width: 2px;
    color: #fff;
    box-shadow: 
        0 0 35px rgba(255, 193, 7, 0.55),
        0 0 70px rgba(255, 193, 7, 0.25),
        0 4px 20px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    animation: energy-flicker 2s ease-in-out infinite;
    padding-left: 3.2rem;
    font-size: 1.05rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.status-badge.energy::after {
    content: '⚡';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.65rem;
    filter: drop-shadow(0 0 14px rgba(255, 193, 7, 0.85)) grayscale(50%) brightness(0.7);
    animation: energy-dim-pulse 2s ease-in-out infinite;
}

.status-badge.energy img {
    display: none;
}

@keyframes energy-dim-pulse {
    0%, 100% { 
        transform: translateY(-50%) scale(1);
        filter: drop-shadow(0 0 14px rgba(255, 193, 7, 0.85)) grayscale(50%) brightness(0.7);
    }
    50% { 
        transform: translateY(-50%) scale(1.1);
        filter: drop-shadow(0 0 18px rgba(255, 193, 7, 0.95)) grayscale(30%) brightness(0.8);
    }
}

@keyframes energy-flicker {
    0%, 100% { 
        box-shadow: 
            0 0 35px rgba(255, 193, 7, 0.55),
            0 0 70px rgba(255, 193, 7, 0.25),
            0 4px 20px rgba(0, 0, 0, 0.45);
    }
    50% { 
        box-shadow: 
            0 0 45px rgba(255, 193, 7, 0.7),
            0 0 90px rgba(255, 193, 7, 0.35),
            0 4px 20px rgba(0, 0, 0, 0.45);
    }
}

.status-badge.streak {
    background: linear-gradient(135deg, rgba(255, 150, 0, 0.2) 0%, rgba(255, 150, 0, 0.1) 100%);
    border-color: var(--goflow-orange);
    color: #fff;
    box-shadow: 
        0 0 25px rgba(255, 150, 0, 0.4),
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    animation: flame-flicker 1s ease-in-out infinite;
}

@keyframes flame-flicker {
    0%, 100% { 
        box-shadow: 0 0 25px rgba(255, 150, 0, 0.4), 0 4px 15px rgba(0, 0, 0, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 30px rgba(255, 150, 0, 0.5), 0 4px 15px rgba(0, 0, 0, 0.3);
        transform: scale(1.01);
    }
}

.status-badge img {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 0 6px currentColor);
    animation: icon-pulse 1.5s ease-in-out infinite;
}

/* Broken heart emoji for hearts badge */
.status-badge.hearts::after {
    content: '💔';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.65rem;
    filter: drop-shadow(0 0 14px rgba(255, 75, 75, 0.85));
    animation: heart-icon-beat 1.4s ease-in-out infinite;
}

/* Hide the original img when we have emoji */
.status-badge.hearts img {
    display: none;
}

/* Energy badge - dim lightning */
.status-badge.energy img {
    filter: 
        brightness(0) saturate(100%)
        invert(77%) sepia(56%) saturate(497%) hue-rotate(359deg) brightness(103%) contrast(104%)
        drop-shadow(0 0 8px rgba(255, 193, 7, 0.8));
    animation: icon-pulse 2s ease-in-out infinite;
}

/* Streak badge - keep flame orange */
.status-badge.streak img {
    filter: 
        brightness(0) saturate(100%)
        invert(61%) sepia(78%) saturate(1426%) hue-rotate(1deg) brightness(104%) contrast(105%)
        drop-shadow(0 0 8px rgba(255, 150, 0, 0.8));
    animation: flame-icon 1s ease-in-out infinite;
}

@keyframes heart-icon-beat {
    0%, 100% { transform: translateY(-50%) scale(1); }
    15% { transform: translateY(-50%) scale(1.15); }
    30% { transform: translateY(-50%) scale(1); }
    45% { transform: translateY(-50%) scale(1.08); }
}

@keyframes icon-pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
}

@keyframes flame-icon {
    0%, 100% { transform: scale(1) rotate(-2deg); }
    50% { transform: scale(1.05) rotate(2deg); }
}

/* Upgrade Promo Banner */
.promo-banner-upgrade {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: promo-pulse 3s ease-in-out infinite;
}

@keyframes promo-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4); }
    50% { box-shadow: 0 0 30px 8px rgba(255, 107, 107, 0.3); }
}

.promo-badge {
    display: inline-block;
    background: #fff;
    color: #ee5a24;
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.promo-title {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.promo-countdown-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.promo-countdown-label {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    font-weight: 600;
}

.promo-subtext {
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.price-original {
    text-decoration: line-through;
    color: #6b7280;
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.price-discounted {
    color: var(--goflow-green);
}

/* Hero Section */
.upgrade-hero {
    text-align: center;
    margin-bottom: 3rem;
    width: 100%;
}

.hero-gopher {
    width: 200px;
    height: auto;
    margin-bottom: 1.5rem;
}

.upgrade-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.upgrade-hero h1 span {
    background: linear-gradient(135deg, var(--goflow-green), var(--goflow-green-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.upgrade-hero p {
    color: var(--goflow-text-muted);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Benefits Grid */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 3rem;
    width: 100%;
}

.benefit-card {
    background: var(--goflow-card);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
}

.benefit-icon {
    width: 48px;
    height: 48px;
    background: rgba(88, 204, 2, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.benefit-icon img {
    width: 28px;
    height: 28px;
}

.benefit-icon.hearts { background: rgba(255, 75, 75, 0.15); }
.benefit-icon.energy { background: rgba(255, 193, 7, 0.15); }
.benefit-icon.units { background: rgba(28, 176, 246, 0.15); }
.benefit-icon.streak { background: rgba(255, 150, 0, 0.15); }

.benefit-content h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #fff;
}

.benefit-content p {
    font-size: 0.85rem;
    color: var(--goflow-text-muted);
    line-height: 1.4;
}

/* Pricing Section */
.pricing-section {
    margin-bottom: 3rem;
    width: 100%;
}

.pricing-header {
    text-align: center;
    margin-bottom: 2rem;
}

.pricing-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Billing Toggle */
.billing-toggle {
    display: inline-flex;
    justify-content: center;
    gap: 0.5rem;
    background: var(--goflow-card);
    padding: 0.4rem;
    border-radius: 12px;
}

.billing-option {
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: transparent;
    color: var(--goflow-text-muted);
}

.billing-option.active {
    background: var(--goflow-green);
    color: #fff;
}

.billing-option .save-badge {
    font-size: 0.75rem;
    background: rgba(255, 200, 0, 0.2);
    color: #ffc800;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.4rem;
}

/* Pricing Cards */
.pricing-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 700px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--goflow-card);
    border: 2px solid var(--goflow-border);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    transition: all 0.2s;
}

.pricing-card:hover {
    border-color: var(--goflow-green);
}

.pricing-card.featured {
    border-color: var(--goflow-green);
    background: linear-gradient(180deg, var(--goflow-card) 0%, rgba(88, 204, 2, 0.08) 100%);
}

.pricing-card.featured::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--goflow-green), var(--goflow-green-dark));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-card.current-plan {
    border-color: #3b82f6;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
}

.pricing-card.current-plan:hover {
    border-color: #3b82f6;
}

.plan-badge-area {
    height: 28px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-plan-badge {
    display: inline-block;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.plan-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.plan-description {
    color: var(--goflow-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.plan-price {
    margin-bottom: 1.5rem;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 800;
}

.price-period {
    color: var(--goflow-text-muted);
    font-size: 0.95rem;
}

.plan-features {
    list-style: none;
    margin-bottom: 1.5rem;
    padding: 0;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    color: var(--goflow-text-light);
}

.plan-features li img {
    width: 18px;
    height: 18px;
}

.plan-cta {
    display: block;
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.plan-cta.primary {
    background: linear-gradient(135deg, var(--goflow-green), var(--goflow-green-dark));
    color: #fff;
}

.plan-cta.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(88, 204, 2, 0.3);
}

.plan-cta.secondary {
    background: var(--goflow-border);
    color: #fff;
}

.plan-cta.secondary:hover {
    background: var(--goflow-border-light);
}

.plan-cta:disabled,
.plan-cta.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    background: var(--goflow-border-light) !important;
    color: #9ca3af !important;
}

.plan-cta.current {
    background: linear-gradient(135deg, var(--goflow-green), var(--goflow-green-dark)) !important;
    color: #fff !important;
    opacity: 1 !important;
}

.plan-cta.upgrade-btn {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #fff !important;
    animation: pulse-glow 2s infinite;
}

.plan-cta.upgrade-btn:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 20px 4px rgba(16, 185, 129, 0.2); }
}

.plan-cta.current-btn {
    background: var(--goflow-border-light) !important;
    color: #9ca3af !important;
}

.plan-cta.current-btn:hover {
    background: #6b7280 !important;
    color: #fff !important;
}

.plan-cta.downgrade {
    background: var(--goflow-border) !important;
    color: #f59e0b !important;
    border: 1px solid #f59e0b;
}

.plan-cta.downgrade:hover {
    background: var(--goflow-border-light) !important;
}

/* Comparison Table */
.comparison-section {
    margin-bottom: 3rem;
    width: 100%;
}

.comparison-section h2 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.comparison-table {
    background: var(--goflow-card);
    border-radius: 16px;
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

.comparison-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    border-bottom: 1px solid var(--goflow-border);
}

.comparison-row:last-child {
    border-bottom: none;
}

.comparison-row.header {
    background: var(--goflow-border);
    font-weight: 700;
}

.comparison-cell {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.comparison-cell:first-child {
    justify-content: flex-start;
}

.comparison-cell img {
    width: 20px;
    height: 20px;
}

.comparison-cell .limited {
    color: var(--goflow-text-muted);
}

.comparison-cell .basic {
    color: #ffc800;
    font-weight: 600;
}

.comparison-cell .unlimited {
    color: var(--goflow-green);
    font-weight: 600;
}

/* Upgrade Footer */
.upgrade-footer {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--goflow-border);
    width: 100%;
}

.upgrade-footer p {
    color: var(--goflow-text-muted);
    font-size: 0.9rem;
}

.upgrade-footer a {
    color: var(--goflow-green);
}

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

/* Upgrade Page Mobile */
@media (max-width: 768px) {
    .upgrade-container {
        padding: 1.5rem 1rem;
    }

    .hero-gopher {
        width: 120px;
    }

    .upgrade-hero h1 {
        font-size: 1.8rem;
    }

    .upgrade-hero p {
        font-size: 1rem;
    }

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

    .benefit-card {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
    }

    .benefit-icon {
        width: 40px;
        height: 40px;
    }

    .benefit-icon img {
        width: 24px;
        height: 24px;
    }

    .pricing-cards {
        grid-template-columns: 1fr;
        max-width: none;
    }

    .comparison-table {
        max-width: none;
    }

    .comparison-row {
        grid-template-columns: 1.5fr 1fr 1fr 1fr;
    }

    .comparison-cell {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
}

/* =========================
   Dashboard - Unit Unlock Celebration
   ========================= */
.unit-unlock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.unit-unlock-overlay.show {
    opacity: 1;
    visibility: visible;
}

.unit-unlock-card {
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    border: 3px solid #58cc02;
    border-radius: 24px;
    padding: 2.5rem 3rem;
    text-align: center;
    max-width: 420px;
    width: 90%;
    transform: scale(0.8) translateY(30px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 100px rgba(88, 204, 2, 0.3);
    position: relative;
    overflow: visible;
}

.unit-unlock-overlay.show .unit-unlock-card {
    transform: scale(1) translateY(0);
}

/* Celebrating gopher */
.unlock-gopher-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin: -1rem auto 0.5rem;
}

.unlock-gopher {
    width: 220px;
    height: 220px;
    object-fit: contain;
    transform: scale(1.5);
    animation: gopherCelebrate 0.8s ease-out 0.2s both;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
}

@keyframes gopherCelebrate {
    0% { transform: scale(0) rotate(-20deg); }
    40% { transform: scale(1.7) rotate(10deg); }
    60% { transform: scale(1.4) rotate(-5deg); }
    80% { transform: scale(1.6) rotate(3deg); }
    100% { transform: scale(1.5) rotate(0); }
}

/* Sparkles around gopher */
.sparkle {
    position: absolute;
    font-size: 1.3rem;
    animation: sparkle 1s ease-in-out infinite;
    z-index: 10;
}

.sparkle:nth-child(1) { top: 15%; left: 5%; animation-delay: 0s; }
.sparkle:nth-child(2) { top: 10%; right: 8%; animation-delay: 0.2s; }
.sparkle:nth-child(3) { bottom: 25%; left: 2%; animation-delay: 0.4s; }
.sparkle:nth-child(4) { bottom: 20%; right: 5%; animation-delay: 0.6s; }
.sparkle:nth-child(5) { top: 45%; left: -5%; animation-delay: 0.3s; }
.sparkle:nth-child(6) { top: 40%; right: 0%; animation-delay: 0.5s; }

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Trophy badge */
.unlock-badge {
    position: absolute;
    top: -15px;
    right: -15px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5);
    animation: badgePop 0.5s ease-out 0.5s both;
}

@keyframes badgePop {
    0% { transform: scale(0) rotate(-180deg); }
    70% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0); }
}

.unlock-title {
    font-size: 2rem;
    font-weight: 800;
    color: #58cc02;
    margin: 0 0 0.5rem 0;
    animation: titleSlide 0.5s ease-out 0.3s both;
}

@keyframes titleSlide {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.unlock-subtitle {
    font-size: 1.1rem;
    color: #8899a6;
    margin: 0 0 1.5rem 0;
    animation: titleSlide 0.5s ease-out 0.4s both;
}

.unlock-xp-earned {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 183, 0, 0.1) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 30px;
    padding: 0.6rem 1.2rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffd700;
    animation: xpPulse 0.5s ease-out 0.6s both;
}

@keyframes xpPulse {
    0% { opacity: 0; transform: scale(0.8); }
    50% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

.unlock-next-unit {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 1.5rem 0;
    padding: 1rem;
    background: rgba(88, 204, 2, 0.1);
    border: 2px solid rgba(88, 204, 2, 0.3);
    border-radius: 12px;
    animation: titleSlide 0.5s ease-out 0.5s both;
}

.unlock-next-label {
    font-size: 0.85rem;
    color: #8899a6;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 0.3rem;
}

.unlock-continue-btn {
    display: inline-block;
    background: linear-gradient(180deg, #78d32e 0%, #58cc02 50%, #46a302 100%);
    color: white;
    padding: 1rem 3rem;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 6px 0 #3d8a02;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: btnAppear 0.5s ease-out 0.7s both;
}

@keyframes btnAppear {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.unlock-continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #3d8a02;
}

.unlock-continue-btn:active {
    transform: translateY(2px);
    box-shadow: 0 4px 0 #3d8a02;
}

/* Upgrade CTA in celebration modal */
.unlock-upgrade-cta {
    margin: 1rem 0;
    text-align: center;
}

.unlock-upgrade-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--goflow-green);
    font-weight: 600;
    font-size: 1rem;
}

.unlock-upgrade-icon {
    font-size: 1.5rem;
}

.unlock-upgrade-btn {
    display: inline-block;
    background: linear-gradient(180deg, #ffd700 0%, #ffb700 50%, #ff9500 100%);
    color: #1a1a1a;
    padding: 1rem 2rem;
    border: none;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 0 #cc7700;
    transition: all 0.15s ease;
    text-decoration: none;
    animation: btnAppear 0.4s ease-out 0.6s both;
}

.unlock-upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #cc7700;
}

.unlock-upgrade-btn:active {
    transform: translateY(2px);
    box-shadow: 0 4px 0 #cc7700;
}

/* Share section */
.unlock-share-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    animation: titleSlide 0.5s ease-out 0.8s both;
}

.unlock-share-label {
    font-size: 0.85rem;
    color: #8899a6;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.unlock-share-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.share-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1.2rem;
}

.share-btn-x {
    background: #000;
    color: #fff;
}

.share-btn-x:hover {
    background: #1a1a1a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.share-btn-facebook {
    background: #1877f2;
    color: #fff;
}

.share-btn-facebook:hover {
    background: #1664d9;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.4);
}

.share-btn-linkedin {
    background: #0a66c2;
    color: #fff;
}

.share-btn-linkedin:hover {
    background: #0958a8;
    box-shadow: 0 4px 12px rgba(10, 102, 194, 0.4);
}

.share-btn-copy {
    background: #3c3f41;
    color: #fff;
}

.share-btn-copy:hover {
    background: #4a4d4f;
    box-shadow: 0 4px 12px rgba(60, 63, 65, 0.4);
}

.share-btn-copy.copied {
    background: #58cc02;
}

.share-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Confetti canvas for dashboard */
#dashboard-confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1999;
}

/* =========================
   Guest Mode (first unit without an account)
   ========================= */
.guest-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.guest-status-progress {
    padding: 0.4rem 0.75rem;
    color: var(--goflow-text-light);
    background: var(--goflow-card);
    border: 1px solid var(--goflow-border);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.guest-save-link {
    padding: 0.45rem 0.9rem;
    color: #0b1a00;
    background: var(--goflow-green);
    border-radius: 12px;
    box-shadow: 0 3px 0 var(--goflow-green-shadow);
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.guest-save-link:hover {
    background: var(--goflow-green-dark);
}

.guest-feedback-save {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 480px) {
    .guest-status-progress {
        display: none;
    }
}

/* =========================
   Small-screen fixes
   ========================= */

/* The hearts sit at the right edge of the exercise header, so a centered tooltip
   hangs off the screen; anchor it to the right instead. */
.stats-display .hearts-display::after {
    left: auto;
    right: 0;
    transform: none;
}

.stats-display .hearts-display::before {
    left: auto;
    right: 18px;
    transform: none;
}

/* Hover tooltips can't be triggered on touch screens, and while hidden they still
   take up layout space past the edge of narrow screens, making the whole page
   scroll sideways. Take them out of layout on touch devices. */
@media (hover: none) {
    .hearts-display::before,
    .hearts-display::after,
    .energy-display::before,
    .energy-display::after,
    .stat-item::before,
    .stat-item::after {
        display: none;
    }
}

/* Order-the-code blocks can't scroll (dragging owns touch input), so long lines
   wrap on phones instead of being cut off. */
@media (max-width: 640px) {
    /* A smaller gopher gives the speech bubble room, instead of squeezing it into
       a one-word-per-line column that spills out of the card. */
    .mascot-section {
        align-items: flex-start;
    }

    .mascot-avatar {
        width: 64px;
        height: 64px;
        margin-bottom: 0;
        margin-left: -4px;
    }

    .speech-bubble {
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
    }

    .speech-bubble::before {
        top: 20px;
        bottom: auto;
    }

    .speech-bubble::after {
        top: 23px;
        bottom: auto;
    }

    .display-code-section pre code,
    .code-completion-code {
        font-size: 0.8rem;
    }

    .code-completion-code {
        padding: 1rem;
    }

    .line-number {
        width: 38px;
        padding: 0.3rem 0.4rem;
        font-size: 0.75rem;
    }

    .line-content {
        padding: 0.3rem 0.75rem;
        font-size: 0.8rem;
    }

    .draggable-block pre code {
        padding: 0.7rem 0.9rem !important;
        font-size: 0.82rem;
        white-space: pre-wrap;
        word-break: break-word;
    }
}

/* On the narrowest phones the winding path's outermost nodes (and their shadows)
   poke a couple of pixels past the edge; clip that sideways overflow rather than
   letting the whole dashboard scroll horizontally. */
@media (max-width: 400px) {
    .exercise-path {
        overflow-x: clip;
    }
}

/* =========================
   Dashboard: labelled stats, Continue card, daily goal, collapsible units
   ========================= */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.goflow-container {
    --stats-height: 60px;
}

.top-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
    align-items: center;
    gap: 0.25rem;
    min-height: var(--stats-height);
    box-sizing: border-box;
    border-radius: 0 0 16px 16px;
}

.stat-item {
    min-width: 0;
    justify-content: center;
    gap: 0.45rem;
}

.stat-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.1;
}

.stat-item .stat-value {
    font-size: 1rem;
    font-weight: 800;
}

.stat-label {
    color: var(--goflow-text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}

.top-stats .stat-icon-img,
.top-stats .stat-icon-img.star,
.top-stats .stat-icon-img.level,
.top-stats .stat-icon-img.flame {
    width: 26px;
    height: 26px;
    margin: 0;
}

.profile-link {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 0.35rem;
    padding: 0.45rem 0.65rem;
    background: rgba(28, 176, 246, 0.12);
    border-radius: 10px;
}

.profile-link svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.continue-card {
    margin: 1rem 0 1.25rem;
    padding: 1.25rem 1.25rem 1.1rem;
    background: linear-gradient(180deg, var(--goflow-card) 0%, #18212f 100%);
    border: 2px solid var(--goflow-border);
    border-radius: 18px;
}

.continue-eyebrow {
    margin: 0 0 0.3rem;
    color: var(--goflow-green);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.continue-title {
    margin: 0;
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
}

.continue-progress {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0.85rem 0 1rem;
}

.continue-bar {
    flex: 1;
    height: 10px;
    overflow: hidden;
    background: var(--goflow-border);
    border-radius: 999px;
}

.continue-bar span {
    display: block;
    height: 100%;
    background: var(--goflow-green);
    border-radius: inherit;
}

.continue-count {
    color: var(--goflow-text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.continue-btn {
    display: flex;
    width: 100%;
    min-height: 52px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0 1.25rem;
    color: #0b1a00;
    background: var(--goflow-green);
    border: 0;
    border-radius: 14px;
    box-shadow: 0 4px 0 var(--goflow-green-shadow);
    font: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.continue-btn:hover {
    transform: translateY(-1px);
}

.continue-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--goflow-green-shadow);
}

.continue-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.continue-btn.secondary {
    color: #fff;
    background: transparent;
    border: 2px solid var(--goflow-border-light);
    box-shadow: none;
}

.continue-xp {
    padding: 0.15rem 0.5rem;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    font-size: 0.78rem;
    text-transform: none;
}

.continue-note {
    margin: 0.75rem 0 0;
    color: var(--goflow-text-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.continue-note strong {
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.continue-actions {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.continue-card .practice-panel {
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--goflow-border);
}

.daily-goal {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.goal-ring {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    transform: rotate(-90deg);
}

.goal-ring circle {
    fill: none;
    stroke-width: 5;
}

.goal-ring-track {
    stroke: var(--goflow-border);
}

.goal-ring-fill {
    stroke: var(--goflow-orange);
    stroke-linecap: round;
}

.goal-ring-fill.is-met {
    stroke: var(--goflow-green);
}

.goal-text strong {
    display: block;
    color: #fff;
    font-size: 0.98rem;
}

.goal-text span {
    color: var(--goflow-text-muted);
    font-size: 0.82rem;
}

.practice-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.25rem;
    margin: 0.9rem 0 0;
    padding: 0;
    list-style: none;
}

.practice-week li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.practice-dot {
    display: flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    background: var(--goflow-border);
    border-radius: 50%;
}

.practice-week li.is-done .practice-dot {
    background: var(--goflow-orange);
}

.practice-week li.is-done .practice-dot::after {
    color: #fff;
    content: "✓";
    font-size: 0.75rem;
    font-weight: 900;
}

.practice-week li.is-today .practice-dot {
    box-shadow: 0 0 0 2px var(--goflow-bg), 0 0 0 4px var(--goflow-orange);
}

.practice-day {
    color: var(--goflow-text-muted);
    font-size: 0.7rem;
    font-weight: 700;
}

.goflow-container .exercise-path {
    margin-top: 0;
}

.section-divider {
    top: var(--stats-height);
    padding: 0;
    border-radius: 16px;
}

.section-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    color: inherit;
    background: none;
    border: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.section-toggle:focus-visible {
    border-radius: 14px;
    outline: 3px solid #fff;
    outline-offset: -4px;
}

.section-number {
    flex: 0 0 auto;
    padding: 0.15rem 0.55rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
}

.section-summary {
    flex: 0 0 auto;
    font-size: 0.82rem;
    font-weight: 800;
}

.section-chevron {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    margin: -4px 0.1rem 0 0.25rem;
    border-right: 3px solid currentColor;
    border-bottom: 3px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.section-toggle[aria-expanded="true"] .section-chevron {
    margin-top: 5px;
    transform: rotate(-135deg);
}

.section-group.collapsed {
    display: none;
}

.section-group.collapsed + .section-divider {
    margin-top: 0.6rem;
}

.section-divider.state-locked {
    filter: grayscale(0.55) brightness(0.8);
}

.goflow-aside {
    display: none;
}

.aside-card {
    padding: 1.1rem 1.2rem;
    background: var(--goflow-card);
    border: 2px solid var(--goflow-border);
    border-radius: 16px;
}

.aside-title {
    margin: 0 0 0.85rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
}

.aside-streak {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.aside-flame {
    width: 40px;
    height: 40px;
}

.aside-streak strong {
    display: block;
    color: #fff;
    font-size: 1.05rem;
}

.aside-streak span {
    color: var(--goflow-text-muted);
    font-size: 0.85rem;
}

.aside-upgrade p {
    margin: 0 0 1rem;
    color: var(--goflow-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Desktop: use the width for a side panel instead of one narrow column. */
@media (min-width: 1100px) {
    .goflow-layout {
        display: grid;
        grid-template-columns: minmax(0, 520px) 300px;
        align-items: start;
        justify-content: center;
        gap: 2rem;
        padding: 0 1.5rem;
    }

    .goflow-layout .goflow-container {
        max-width: none;
        margin: 0;
        padding: 0 0 1rem;
    }

    .goflow-aside {
        position: sticky;
        top: 1rem;
        display: grid;
        gap: 1rem;
        margin-top: 1rem;
        /* Taller than the window, it scrolls on its own, so the bottom card is
           always reachable. */
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: none;
    }

    .goflow-aside::-webkit-scrollbar {
        display: none;
    }

    .continue-card .practice-panel {
        display: none;
    }
}

@media (max-width: 640px) {
    .goflow-container {
        --stats-height: 64px;
    }

    .top-stats {
        flex-wrap: nowrap;
        gap: 0.1rem;
        padding: 0.55rem 0.5rem;
    }

    .top-stats .stat-item {
        flex-direction: column;
        gap: 0.15rem;
        text-align: center;
    }

    .stat-text {
        align-items: center;
    }

    .top-stats .stat-icon-img,
    .top-stats .stat-icon-img.star,
    .top-stats .stat-icon-img.level,
    .top-stats .stat-icon-img.flame {
        width: 22px;
        height: 22px;
    }

    .stat-label {
        font-size: 0.62rem;
    }

    .profile-link {
        padding: 0.5rem;
    }

    .profile-link-text {
        display: none;
    }

    .continue-card {
        padding: 1.1rem 1rem 1rem;
    }

    .continue-title {
        font-size: 1.2rem;
    }

    .section-toggle {
        gap: 0.5rem;
        padding: 0.9rem 1rem;
    }

    .section-title {
        font-size: 1rem;
    }
}

/* =========================
   Exercise page: progress, hints, answer marking, keyboard keys
   ========================= */
.exercise-progress {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin: -0.75rem 0 1.25rem;
}

.exercise-progress-bar {
    flex: 1 1 160px;
    height: 12px;
    overflow: hidden;
    background: var(--goflow-border);
    border-radius: 999px;
}

.exercise-progress-fill {
    display: block;
    height: 100%;
    min-width: 12px;
    background: var(--goflow-green);
    border-radius: inherit;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.exercise-progress-label {
    color: var(--goflow-text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.exercise-free-energy {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem 0.2rem 0.35rem;
    color: var(--goflow-yellow);
    background: rgba(255, 200, 0, 0.1);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.exercise-free-energy .energy-icon-img {
    width: 14px;
    height: 14px;
}

/* Grey, not faded green, so it reads as "not ready yet". */
.submit-btn:disabled {
    color: var(--goflow-text-muted);
    background: var(--goflow-border);
    box-shadow: 0 6px 0 #1f2937;
    opacity: 1;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.option-text {
    min-width: 0;
    flex: 1;
    overflow-wrap: anywhere;
}

.option-btn.code-option .option-text {
    font-family: inherit;
    white-space: pre-wrap;
}

.option-key {
    display: none;
    width: 1.6rem;
    height: 1.6rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    color: var(--goflow-text-muted);
    border: 2px solid var(--goflow-border-light);
    border-radius: 8px;
    font-family: var(--goflow-font);
    font-size: 0.8rem;
    font-weight: 700;
}

@media (hover: hover) and (pointer: fine) {
    .option-key {
        display: inline-flex;
    }
}

.option-btn.selected .option-key {
    color: var(--goflow-green);
    border-color: var(--goflow-green);
}

.option-code-fragment {
    padding: 0.05em 0.35em;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    font-family: var(--goflow-font-mono);
    font-size: 0.92em;
}

.option-btn.eliminated,
.code-line.eliminated {
    cursor: not-allowed;
}

/* Fade the content, not the element, so nothing behind it shows through. */
.option-btn.eliminated > *,
.code-line.eliminated > * {
    opacity: 0.4;
}

.option-btn.eliminated {
    border-color: var(--goflow-border);
}

.option-btn.eliminated {
    text-decoration: line-through;
    text-decoration-color: var(--goflow-red);
}

.option-btn.eliminated:hover {
    background: var(--goflow-card);
    border-color: var(--goflow-border-light);
    transform: none;
}

.option-btn.incorrect,
.code-line.incorrect,
.blank-input.incorrect,
.match-item.incorrect {
    animation: goflow-shake 0.4s ease;
}

@keyframes goflow-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

@media (prefers-reduced-motion: reduce) {
    .option-btn.incorrect,
    .code-line.incorrect,
    .blank-input.incorrect,
    .match-item.incorrect {
        animation: none;
    }
}

.match-item.matched.correct {
    border-color: var(--goflow-green);
}

.match-item.matched.incorrect {
    border-color: var(--goflow-red);
    background: rgba(255, 75, 75, 0.15);
}

.draggable-block.in-place {
    border-left: 4px solid var(--goflow-green);
}

.hint-panel {
    margin-top: 1.25rem;
}

.hint-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    color: var(--goflow-blue);
    background: rgba(28, 176, 246, 0.1);
    border: 2px solid rgba(28, 176, 246, 0.3);
    border-radius: 12px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.hint-btn:hover {
    background: rgba(28, 176, 246, 0.18);
}

/* The display rules above would otherwise override the hidden attribute. */
.hint-btn[hidden],
.hint-list[hidden] {
    display: none;
}

.hint-list {
    display: grid;
    gap: 0.5rem;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
    counter-reset: hint;
}

.hint-list li {
    position: relative;
    padding: 0.7rem 0.9rem 0.7rem 2.4rem;
    color: #e5e7eb;
    background: rgba(28, 176, 246, 0.08);
    border-left: 3px solid var(--goflow-blue);
    border-radius: 8px;
    counter-increment: hint;
    font-size: 0.92rem;
    line-height: 1.5;
}

.hint-list li::before {
    position: absolute;
    top: 0.7rem;
    left: 0.9rem;
    color: var(--goflow-blue);
    content: counter(hint);
    font-weight: 800;
}

.hint-list code {
    padding: 0.05em 0.35em;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    font-family: var(--goflow-font-mono);
    font-size: 0.9em;
}

.hearts-lost {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.5rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.daily-goal-note {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.92rem;
}

.daily-goal-note[hidden] {
    display: none;
}

.goal-dots {
    display: inline-flex;
    gap: 0.25rem;
}

.goal-dot {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
}

.goal-dot.is-done {
    background: var(--goflow-orange);
}

.daily-goal-note.is-met strong {
    color: var(--goflow-orange);
}

/* Long unit names truncate instead of wrapping the header onto two lines. */
.exercise-header {
    gap: 0.75rem;
}

.exercise-header .back-link {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exercise-header .stats-display,
.exercise-header .guest-status {
    flex-shrink: 0;
}

/* Spot the bug: each line is highlighted separately, so drop highlight.js's
   per-element background (it drew a box behind every line, even empty ones). */
.code-line .line-content .hljs,
.code-line .line-content code {
    padding: 0;
    background: transparent !important;
}

@media (max-width: 640px) {
    .daily-goal-note {
        justify-content: center;
    }
}

/* Upgrade page: out-of-energy panel */
.energy-wait {
    width: 100%;
    max-width: 560px;
    box-sizing: border-box;
    margin: 0 0 2rem;
    padding: 1.4rem 1.5rem;
    background: var(--goflow-card);
    border: 2px solid var(--goflow-border);
    border-radius: 18px;
}

.energy-wait-title {
    margin: 0 0 0.4rem;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 800;
}

.energy-wait-title .energy-countdown-time {
    color: var(--goflow-yellow);
    font-variant-numeric: tabular-nums;
}

.energy-wait-text {
    margin: 0 0 1rem;
    color: var(--goflow-text-muted);
    line-height: 1.5;
}

.energy-wait-actions {
    display: grid;
    gap: 0.6rem;
}

.energy-wait-actions .continue-btn {
    font-size: 0.95rem;
}

.energy-wait-actions .continue-btn:disabled {
    cursor: default;
    opacity: 0.8;
}

.energy-wait-status {
    margin: 0.75rem 0 0;
    color: var(--goflow-green);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Feedback panel: level-up and achievement unlocks */
.feedback-rewards {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.feedback-rewards[hidden] {
    display: none;
}

.reward-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.22);
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 14px;
    text-align: left;
    animation: reward-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.reward-card + .reward-card {
    animation-delay: 0.15s;
}

.reward-card.achievement {
    border-color: #ffc800;
}

.reward-icon {
    display: flex;
    width: 2.4rem;
    height: 2.4rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    font-size: 1.35rem;
}

.reward-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.1rem;
}

.reward-text strong {
    font-size: 0.98rem;
}

.reward-text span {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
}

@keyframes reward-pop {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .reward-card {
        animation: none;
    }
}

/* Dashboard side panel: next achievement */
.aside-achievement {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease;
}

.aside-achievement:hover {
    border-color: var(--goflow-border-light);
}

.aside-achievement-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.aside-achievement-icon {
    display: flex;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    background: rgba(88, 204, 2, 0.15);
    border: 2px solid var(--goflow-green);
    border-radius: 14px;
    font-size: 1.35rem;
}

.aside-achievement-row strong {
    display: block;
    color: #fff;
    font-size: 0.95rem;
}

.aside-achievement-row span {
    color: var(--goflow-text-muted);
    font-size: 0.85rem;
}

.aside-achievement-progress {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.85rem;
}

.aside-achievement .continue-bar span {
    background: var(--goflow-yellow);
}

/* =========================
   Exercise page: lesson header (close · progress · hearts)
   ========================= */
.lesson-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 0 0 1.25rem;
    padding: 0.35rem 0;
}

.lesson-close {
    display: flex;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    margin-left: -8px;
    color: var(--goflow-text-muted);
    border-radius: 12px;
    transition: color 0.15s ease, background 0.15s ease;
}

.lesson-close:hover {
    color: #fff;
    background: var(--goflow-card);
}

.lesson-close:focus-visible {
    outline: 3px solid var(--goflow-blue);
    outline-offset: 1px;
}

.lesson-close svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 3;
}

.lesson-progress {
    height: 16px;
    flex: 1;
    overflow: hidden;
    background: var(--goflow-border);
    border-radius: 999px;
}

.lesson-progress-fill {
    position: relative;
    display: block;
    height: 100%;
    min-width: 16px;
    background: var(--goflow-green);
    border-radius: inherit;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* The highlight Duolingo's bar has along its top edge */
.lesson-progress-fill::after {
    position: absolute;
    top: 4px;
    right: 8px;
    left: 8px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    content: "";
}

.lesson-count {
    flex: 0 0 auto;
    color: var(--goflow-text-muted);
    font-size: 0.85rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.lesson-hearts {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.35rem;
    color: #4fd1c5; /* matches heart.svg */
    font-size: 1.05rem;
    font-weight: 800;
}

.lesson-hearts .heart-icon {
    width: 26px;
    height: 26px;
}

.lesson-hearts.empty {
    color: var(--goflow-text-muted);
}

.lesson-hearts.empty .heart-icon {
    filter: grayscale(1);
    opacity: 0.5;
}

.lesson-hearts.losing .heart-icon {
    animation: heart-lose 0.5s ease;
}

@keyframes heart-lose {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.35) rotate(-12deg); }
    60% { transform: scale(0.8) rotate(8deg); }
}

@media (prefers-reduced-motion: reduce) {
    .lesson-hearts.losing .heart-icon {
        animation: none;
    }
}

.lesson-save {
    flex: 0 0 auto;
    padding: 0.4rem 0.8rem;
    color: #0b1a00;
    background: var(--goflow-green);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
}

/* Phones: Check (and Clear) live in a bar pinned to the bottom of the screen,
   like Duolingo's, so the button never scrolls out of reach. The feedback panel
   slides up over the same spot. */
@media (max-width: 640px) {
    .exercise-container {
        padding-bottom: 7.5rem;
    }

    .exercise-card > .submit-section {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 900;
        display: flex;
        flex-direction: row;
        gap: 0.75rem;
        margin: 0;
        padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
        background: var(--goflow-bg);
        border-top: 2px solid var(--goflow-border);
    }

    .exercise-card > .submit-section .clear-btn {
        width: auto;
        flex: 0 0 auto;
        padding: 1rem 1.25rem;
    }

    .exercise-card > .submit-section .submit-btn {
        width: auto;
        flex: 1;
        padding: 1rem;
    }
}

/* Exercise page: the task as the heading, then the gopher's teaching text */
.exercise-task {
    margin: 0 0 1.1rem;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.3;
}

.exercise-task .highlight {
    color: var(--goflow-green);
}

.speech-more {
    margin-top: 0.4rem;
    padding: 0;
    color: var(--goflow-blue);
    background: none;
    border: 0;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
}

.speech-more:focus-visible {
    border-radius: 4px;
    outline: 2px solid var(--goflow-blue);
    outline-offset: 2px;
}

.speech-more[hidden] {
    display: none;
}

@media (max-width: 640px) {
    .exercise-task {
        margin-bottom: 0.9rem;
        font-size: 1.2rem;
    }

    .speech-bubble .speech-learning:not(.expanded) {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 4;
    }

    /* The two groups of a match exercise, without the old fixed labels */
    .match-container .match-column + .match-column {
        margin-top: 0.5rem;
        padding-top: 1rem;
        border-top: 2px dashed var(--goflow-border);
    }
}

/* The correct answer, shown in the feedback panel after two misses */
.feedback-answer {
    margin-top: 0.85rem;
    padding: 0.75rem 0.9rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 12px;
    text-align: left;
}

.feedback-answer[hidden] {
    display: none;
}

.feedback-answer-label {
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.feedback-answer-body {
    max-height: 9.5rem;
    margin: 0;
    overflow: auto;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.5;
    white-space: pre-wrap;
}

.feedback-answer-body.code {
    font-family: var(--goflow-font-mono);
    font-size: 0.85rem;
    font-weight: 500;
}

.feedback-answer-note {
    margin-top: 0.4rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
}

/* On the page: the option or line the answer points to */
.option-btn.revealed,
.code-line.revealed {
    border-color: var(--goflow-green);
    border-style: dashed;
}

.code-line.revealed {
    background: rgba(88, 204, 2, 0.12);
    outline: 2px dashed var(--goflow-green);
    outline-offset: -2px;
}

/* Code challenges: Run Code is the main (green, full-width) button, and the
   editor gets a small toolbar with Reset code. */
.editor-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.editor-reset {
    padding: 0.3rem 0.65rem;
    color: var(--goflow-text-muted);
    background: transparent;
    border: 2px solid var(--goflow-border);
    border-radius: 10px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.editor-reset:hover {
    color: #fff;
    border-color: var(--goflow-border-light);
}

.editor-controls .run-btn {
    justify-content: center;
    width: 100%;
    padding: 1rem;
    color: #0b1a00;
    background: var(--goflow-green);
    border-radius: 16px;
    box-shadow: 0 5px 0 var(--goflow-green-shadow);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.editor-controls .run-btn:hover {
    background: #61d90a;
}

.editor-controls .run-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--goflow-green-shadow);
}

.editor-controls .run-btn:disabled {
    color: var(--goflow-text-muted);
    background: var(--goflow-border);
    box-shadow: 0 5px 0 #1f2937;
    cursor: not-allowed;
    opacity: 1 !important;
}

@media (max-width: 640px) {
    .exercise-card .editor-controls {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 900;
        margin: 0;
        padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
        background: var(--goflow-bg);
        border-top: 2px solid var(--goflow-border);
    }
}

/* =========================
   Session screens: streak extended, lesson complete
   ========================= */
.session-screen {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    overflow-y: auto;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
    background: var(--goflow-bg);
    animation: session-in 0.3s ease both;
}

.session-screen[hidden] {
    display: none;
}

@keyframes session-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.session-inner {
    display: flex;
    width: 100%;
    max-width: 440px;
    min-height: min(640px, 100%);
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.session-art {
    width: 210px;
    height: auto;
    margin-top: auto;
    animation: session-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes session-pop {
    from { opacity: 0; transform: scale(0.6); }
    to { opacity: 1; transform: scale(1); }
}

.session-title {
    margin: 1.25rem 0 0.35rem;
    color: var(--goflow-yellow);
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.15;
}

.session-subtitle {
    margin: 0 0 1.5rem;
    color: var(--goflow-text-muted);
    font-size: 1rem;
}

.session-tiles {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.session-tile {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid;
    border-radius: 16px;
    animation: session-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.session-tile:nth-child(2) { animation-delay: 0.1s; }
.session-tile:nth-child(3) { animation-delay: 0.2s; }

.session-tile-label {
    padding: 0.3rem 0.25rem;
    color: var(--goflow-bg);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.session-tile-value {
    padding: 0.7rem 0.25rem 0.8rem;
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.session-tile.xp { border-color: var(--goflow-yellow); }
.session-tile.xp .session-tile-label { background: var(--goflow-yellow); }
.session-tile.xp .session-tile-value { color: var(--goflow-yellow); }
.session-tile.time { border-color: var(--goflow-blue); }
.session-tile.time .session-tile-label { background: var(--goflow-blue); }
.session-tile.time .session-tile-value { color: var(--goflow-blue); }
.session-tile.accuracy { border-color: var(--goflow-green); }
.session-tile.accuracy .session-tile-label { background: var(--goflow-green); }
.session-tile.accuracy .session-tile-value { color: var(--goflow-green); }

.session-actions {
    display: grid;
    width: 100%;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 2rem;
}

.session-primary {
    width: 100%;
    min-height: 54px;
    color: #0b1a00;
    background: var(--goflow-green);
    border: 0;
    border-radius: 16px;
    box-shadow: 0 5px 0 var(--goflow-green-shadow);
    font: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

.session-primary:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--goflow-green-shadow);
}

.session-primary:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.session-secondary {
    color: var(--goflow-text-muted);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-transform: uppercase;
}

.session-secondary:hover {
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    .session-screen,
    .session-art,
    .session-tile {
        animation: none;
    }
}

/* Streak extended */
.session-inner.streak {
    justify-content: center;
}

.streak-flame {
    width: 120px;
    height: 120px;
    margin-top: auto;
    animation: streak-flame 1.2s ease-in-out both;
}

@keyframes streak-flame {
    0% { opacity: 0; transform: scale(0.3) translateY(30px); }
    55% { opacity: 1; transform: scale(1.15); }
    75% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.streak-count {
    margin-top: 0.5rem;
    color: var(--goflow-orange);
    font-size: 5.5rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    animation: session-pop 0.6s 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.streak-label {
    margin-bottom: 1.75rem;
    color: var(--goflow-orange);
    font-size: 1.6rem;
    font-weight: 800;
}

.streak-week {
    display: grid;
    width: 100%;
    max-width: 340px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
    margin: 0 0 1.25rem;
    padding: 1rem 0.75rem;
    list-style: none;
    background: var(--goflow-card);
    border: 2px solid var(--goflow-border);
    border-radius: 16px;
}

.streak-week li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.streak-dot {
    width: 28px;
    height: 28px;
    background: var(--goflow-border);
    border-radius: 50%;
}

.streak-week li.done .streak-dot {
    background: var(--goflow-orange);
}

.streak-week li.today .streak-dot {
    box-shadow: 0 0 0 3px var(--goflow-card), 0 0 0 5px var(--goflow-orange);
    animation: streak-today 0.7s 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes streak-today {
    from { background: var(--goflow-border); transform: scale(0.6); }
    to { background: var(--goflow-orange); transform: scale(1); }
}

.streak-day {
    color: var(--goflow-text-muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.streak-week li.today .streak-day {
    color: var(--goflow-orange);
}

@media (prefers-reduced-motion: reduce) {
    .streak-flame,
    .streak-count,
    .streak-week li.today .streak-dot {
        animation: none;
    }
}

/* Combo: consecutive answers right first time */
.combo-badge {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.3rem 0.65rem;
    color: #fff;
    background: var(--goflow-orange);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 800;
    animation: reward-pop 0.45s 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.combo-badge.milestone {
    font-size: 1rem;
    box-shadow: 0 0 0 3px rgba(255, 150, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    .combo-badge {
        animation: none;
    }
}

/* =========================
   Path: exercise type icons, START label, unit trophies
   ========================= */
.node-icons {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.node-icon {
    width: 32px;
    height: 32px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.4;
}

.exercise-node.current .node-icon,
.exercise-node.available .node-icon {
    color: #fff;
}

.exercise-node.locked.upcoming {
    color: #66778a;
}

/* The bouncing START label marks where to go next, as on Duolingo's path. The
   node itself stays put, so it keeps its place in the zig-zag. */
.exercise-node.current {
    animation: none;
}

.node-start {
    position: absolute;
    top: -40px;
    left: 50%;
    z-index: 3;
    padding: 0.3rem 0.65rem;
    color: var(--goflow-green);
    background: var(--goflow-card);
    border: 2px solid var(--goflow-border-light);
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
    transform: translateX(-50%);
    animation: node-start-bounce 1.2s ease-in-out infinite;
}

.node-start::after {
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 12px;
    height: 12px;
    background: var(--goflow-card);
    border-right: 2px solid var(--goflow-border-light);
    border-bottom: 2px solid var(--goflow-border-light);
    content: "";
    transform: translateX(-50%) rotate(45deg);
}

@keyframes node-start-bounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -6px); }
}

@media (prefers-reduced-motion: reduce) {
    .node-start {
        animation: none;
    }
}

.path-row.trophy-row {
    height: 132px;
}

.unit-trophy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
}

.unit-trophy-cup {
    display: flex;
    width: 86px;
    height: 86px;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #3a4757 0%, #2a3644 100%);
    border-radius: 50%;
    box-shadow: 0 6px 0 #161f25;
    font-size: 2.6rem;
    filter: grayscale(1);
    opacity: 0.55;
    transition: transform 0.15s ease;
}

.unit-trophy:hover .unit-trophy-cup {
    transform: translateY(-2px);
}

.unit-trophy-label {
    color: var(--goflow-text-muted);
    font-size: 0.8rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.unit-trophy.earned .unit-trophy-cup {
    background: linear-gradient(180deg, #ffd84d 0%, #ffc800 55%, #e0a800 100%);
    box-shadow: 0 6px 0 #a67c00, 0 0 0 6px rgba(255, 200, 0, 0.18);
    filter: none;
    opacity: 1;
}

.unit-trophy.earned .unit-trophy-label {
    color: var(--goflow-yellow);
}

/* Path gophers: one thinks it over beside the current exercise, one celebrates
   each finished unit's trophy. */
.path-gopher img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.path-gopher.thinking,
.path-gopher.celebrating {
    opacity: 1;
}

.path-gopher.thinking img {
    transform-origin: 50% 100%;
    animation: gopher-ponder 3.2s ease-in-out infinite;
}

@keyframes gopher-ponder {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

.gopher-thought {
    position: absolute;
    top: -10px;
    right: -14px;
    display: flex;
    gap: 4px;
    padding: 7px 9px;
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 14px;
}

.gopher-thought::after {
    content: "";
    position: absolute;
    bottom: -9px;
    left: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1e293b;
    border: 2px solid #334155;
}

.path-gopher.right-side .gopher-thought {
    right: auto;
    left: -14px;
}

.path-gopher.right-side .gopher-thought::after {
    left: auto;
    right: 6px;
}

.gopher-thought i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    animation: thought-dot 1.4s ease-in-out infinite;
}

.gopher-thought i:nth-child(2) { animation-delay: 0.2s; }
.gopher-thought i:nth-child(3) { animation-delay: 0.4s; }

@keyframes thought-dot {
    0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

.path-gopher.celebrating img {
    animation: gopher-hop 2.4s ease-in-out infinite;
}

@keyframes gopher-hop {
    0%, 70%, 100% { transform: translateY(0); }
    80% { transform: translateY(-12px); }
    90% { transform: translateY(0); }
}

@media (max-width: 480px) {
    .path-gopher.thinking,
    .path-gopher.celebrating {
        width: 72px;
        height: 72px;
    }

    .trophy-row .path-gopher.left-side {
        left: calc(50% - 140px);
    }

    .trophy-row .path-gopher.right-side {
        right: calc(50% - 140px);
    }

    .gopher-thought {
        top: -14px;
        right: -18px;
        gap: 3px;
        padding: 5px 7px;
    }

    .path-gopher.right-side .gopher-thought {
        left: -18px;
    }

    .gopher-thought i {
        width: 5px;
        height: 5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .path-gopher img,
    .gopher-thought i {
        animation: none;
    }
}

/* Phones: the practice panel folds into one tappable strip in the Continue card,
   and the path starts closer to the unit header, so the path shows above the fold. */
.practice-strip {
    display: none;
}

@media (max-width: 640px) {
    .practice-strip {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        margin-top: 0.85rem;
        padding: 0.55rem 0.75rem;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--goflow-border);
        border-radius: 12px;
        color: var(--goflow-text-muted);
        font: inherit;
        font-size: 0.9rem;
        font-weight: 700;
        cursor: pointer;
    }

    .practice-strip strong {
        color: #fff;
    }

    .strip-item {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
    }

    .strip-flame {
        width: 18px;
        height: 18px;
    }

    .goal-ring.mini {
        width: 20px;
        height: 20px;
        flex: 0 0 20px;
    }

    .goal-ring.mini circle {
        stroke-width: 7;
    }

    .strip-week {
        display: flex;
        gap: 4px;
        margin-left: auto;
    }

    .strip-week i {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--goflow-border);
    }

    .strip-week i.is-done {
        background: var(--goflow-orange);
    }

    .strip-week i.is-today:not(.is-done) {
        background: transparent;
        box-shadow: inset 0 0 0 2px var(--goflow-orange);
    }

    .strip-chevron {
        width: 7px;
        height: 7px;
        margin: -4px 2px 0 4px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg);
        transition: transform 0.2s ease;
    }

    .practice-strip[aria-expanded="true"] .strip-chevron {
        margin-top: 4px;
        transform: rotate(-135deg);
    }

    .continue-practice {
        display: none;
    }

    .continue-practice.is-open {
        display: block;
    }

    .continue-card .continue-practice .practice-panel {
        margin-top: 0.85rem;
        padding-top: 0.85rem;
    }

    .section-group {
        padding-top: 1.25rem;
    }

    .path-row.after-section {
        margin-top: 0.5rem;
    }
}

/* Daily quests (views/goflow/quests.gohtml): the dashboard side panel and the
   Practice tab. */
.quests-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.quests-title {
    margin: 0;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
}

.practice-card .quests-title {
    font-size: 1.25rem;
}

.quests-done {
    color: var(--goflow-text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.quest-list {
    display: grid;
    gap: 0.85rem;
    margin: 0.9rem 0 0;
    padding: 0;
    list-style: none;
}

.quest {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quest-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 200, 0, 0.12);
    font-size: 1.2rem;
}

.quest-body {
    display: grid;
    flex: 1;
    gap: 0.35rem;
    min-width: 0;
}

.quest-body strong {
    color: #fff;
    font-size: 0.92rem;
}

.quest-progress {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.quest-bar {
    position: relative;
    flex: 1;
    height: 12px;
    overflow: hidden;
    border-radius: 6px;
    background: var(--goflow-border);
}

.quest-bar span {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 6px;
    background: var(--goflow-yellow);
    transition: width 0.4s ease;
}

.quest-count {
    min-width: 2.6rem;
    color: var(--goflow-text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-align: right;
}

.quest.done .quest-icon {
    background: rgba(88, 204, 2, 0.15);
}

.quest.done .quest-bar span {
    background: var(--goflow-green);
}

.quest-check {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--goflow-green);
    color: #0b1a00;
    font-size: 0.85rem;
    font-weight: 800;
}

.quests-note {
    margin: 0.9rem 0 0;
    color: var(--goflow-text-muted);
    font-size: 0.78rem;
}

/* "No energy used": under the lesson header for exercises that don't spend energy. */
.lesson-energy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin: -0.85rem 0 0.9rem;
    color: var(--goflow-text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.lesson-energy-note img {
    width: 14px;
    height: 14px;
}

/* First-run welcome (views/goflow/onboarding.gohtml): full screen and opaque,
   so a new learner's first paint is the welcome, not the path behind it. */
body.welcome-open {
    overflow: hidden;
}

.welcome {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding: max(1rem, env(safe-area-inset-top)) 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
    background: radial-gradient(ellipse at 50% 0%, rgba(88, 204, 2, 0.12), transparent 60%), var(--goflow-bg);
    transition: opacity 0.25s ease;
}

.welcome.closing {
    opacity: 0;
    pointer-events: none;
}

.welcome-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 460px;
    min-height: 44px;
}

.welcome-dots {
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.welcome-dots li {
    width: 28px;
    height: 6px;
    border-radius: 3px;
    background: var(--goflow-border);
    transition: background 0.2s ease;
}

.welcome-dots li.active {
    background: var(--goflow-green);
}

.welcome-skip,
.welcome-link {
    padding: 0.6rem 0.4rem;
    border: 0;
    background: none;
    color: var(--goflow-text-muted);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.welcome-skip:hover,
.welcome-link:hover {
    color: #fff;
}

.welcome-step {
    display: none;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 460px;
    padding: 1rem 0;
    text-align: center;
}

.welcome-step.active {
    display: flex;
    animation: welcome-in 0.3s ease both;
}

@keyframes welcome-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

.welcome-art {
    width: min(260px, 70vw);
    height: auto;
    margin: 0 auto 1.5rem;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.4));
}

.welcome-title {
    margin: 0 0 0.75rem;
    color: #fff;
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.15;
    text-wrap: balance;
    outline: none;
}

.welcome-text {
    margin: 0 0 1.5rem;
    color: var(--goflow-text-light);
    font-size: 1.05rem;
    line-height: 1.5;
}

.welcome-text strong {
    color: #fff;
}

.welcome-saved {
    align-self: center;
    margin: -0.5rem 0 1.5rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: rgba(88, 204, 2, 0.15);
    color: var(--goflow-green);
    font-size: 0.92rem;
    font-weight: 800;
}

.welcome-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    margin-top: auto;
    border: 0;
    border-radius: 16px;
    background: var(--goflow-green);
    box-shadow: 0 4px 0 var(--goflow-green-shadow);
    color: #0b1a00;
    font: inherit;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
}

.welcome-step .welcome-btn {
    margin-top: 1rem;
}

.welcome-btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 var(--goflow-green-shadow);
}

.welcome-link {
    margin-top: 0.5rem;
}

.welcome-rules {
    display: grid;
    gap: 0.75rem;
    margin: 0.5rem 0 1rem;
    padding: 0;
    list-style: none;
    text-align: left;
}

.welcome-rules li {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem;
    border: 2px solid var(--goflow-border);
    border-radius: 16px;
    background: var(--goflow-card);
}

.welcome-rule-icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
}

.welcome-rules strong {
    display: block;
    margin-bottom: 0.2rem;
    color: #fff;
    font-size: 1.05rem;
}

.welcome-rules span {
    color: var(--goflow-text-light);
    font-size: 0.95rem;
    line-height: 1.45;
}

.welcome-lesson {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0 1rem;
    padding: 1.1rem;
    border: 2px solid var(--goflow-green);
    border-radius: 18px;
    background: var(--goflow-card);
    text-align: left;
}

.welcome-lesson-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(88, 204, 2, 0.14);
    font-size: 2rem;
}

.welcome-lesson-text {
    display: grid;
    flex: 1;
    gap: 0.2rem;
    min-width: 0;
}

.welcome-lesson-unit {
    color: var(--goflow-green);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.welcome-lesson-text strong {
    color: #fff;
    font-size: 1.15rem;
}

.welcome-lesson .continue-progress {
    margin: 0.35rem 0 0;
}

@media (prefers-reduced-motion: reduce) {
    .welcome-step.active {
        animation: none;
    }
}

/* Guest progress import: the path is out of date until the page reloads with
   it, so it's hidden behind a short "saving" state. If the import never
   finishes, it shows again after four seconds. */
.goflow-importing .goflow-layout,
.goflow-importing .goflow-nav,
.goflow-importing .jump-to-current {
    visibility: hidden;
    animation: goflow-reveal 0s 4s forwards;
}

@keyframes goflow-reveal {
    to { visibility: visible; }
}

.goflow-importing body:not(.welcome-open)::before {
    content: "Saving your progress…";
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--goflow-text-muted);
    font-weight: 700;
    animation: goflow-hide 0s 4s forwards;
}

@keyframes goflow-hide {
    to { visibility: hidden; }
}

/* Pro offer in a lesson (showProScreen): out of hearts, and after a session. */
.session-inner.pro {
    justify-content: center;
}

.pro-chip {
    margin-top: auto;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #ce82ff, #8b5cf6);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.session-inner.pro .session-title {
    margin-top: 1rem;
    color: #fff;
}

.session-inner.pro .session-subtitle {
    color: var(--goflow-text-light);
    font-size: 1.02rem;
    line-height: 1.45;
}

.pro-hearts-art {
    position: relative;
    margin-top: 1.25rem;
    animation: session-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.pro-hearts-art img {
    width: 96px;
    height: 96px;
    filter: grayscale(1) brightness(0.7);
}

.pro-hearts-count {
    position: absolute;
    right: -10px;
    bottom: -4px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 3px solid var(--goflow-bg);
    border-radius: 50%;
    background: var(--goflow-red);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
}

.pro-countdown {
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.pro-benefits {
    display: grid;
    gap: 0.6rem;
    width: 100%;
    margin: 0;
    padding: 1rem;
    border: 2px solid rgba(206, 130, 255, 0.45);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(206, 130, 255, 0.1), rgba(206, 130, 255, 0.02));
    list-style: none;
    text-align: left;
}

.pro-benefits li {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.pro-benefit-icon {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
}

.pro-benefits strong {
    display: block;
    color: #fff;
    font-size: 0.98rem;
}

.pro-benefits span {
    color: var(--goflow-text-muted);
    font-size: 0.86rem;
}

.session-inner.pro .session-primary {
    background: linear-gradient(135deg, #ce82ff, #8b5cf6);
    box-shadow: 0 5px 0 #6d28d9;
    color: #fff;
}

/* Dashboard side panel Pro card: the learner's own limits next to Pro's. */
.aside-upgrade .pro-chip {
    display: inline-block;
    margin: 0 0 0.6rem;
}

.aside-limits {
    display: grid;
    gap: 0.5rem;
    margin: 0.4rem 0 0.8rem;
    padding: 0;
    list-style: none;
}

.aside-limits li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--goflow-text-muted);
    font-size: 0.88rem;
}

.aside-limits img {
    width: 20px;
    height: 20px;
}

.aside-limits strong {
    color: #fff;
}

.aside-limit-pro {
    margin-left: auto;
    color: var(--goflow-purple);
    font-weight: 800;
}

.continue-btn.pro {
    background: linear-gradient(135deg, #ce82ff, #8b5cf6);
    box-shadow: 0 4px 0 #6d28d9;
    color: #fff;
}

/* Upgrade page: personal headline, the plan picker first (Pro first), what the
   plan unlocks. Pro is purple across GoFlow. */
.checkout-note {
    width: 100%;
    max-width: 700px;
    margin: 0 auto 1.5rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--goflow-border-light);
    border-radius: 14px;
    background: var(--goflow-card);
    color: var(--goflow-text-light);
    text-align: center;
}

.upgrade-hero {
    margin-bottom: 2rem;
}

.upgrade-hero .hero-gopher {
    width: 150px;
    margin-bottom: 0.75rem;
}

.upgrade-hero .pro-chip {
    display: inline-block;
    margin-bottom: 0.9rem;
}

.upgrade-hero h1 {
    color: #fff;
    text-wrap: balance;
}

.upgrade-hero p {
    max-width: 560px;
    color: var(--goflow-text-light);
    line-height: 1.5;
    text-wrap: pretty;
}

.pricing-section {
    margin-bottom: 2.5rem;
}

.pricing-card.featured {
    border-color: var(--goflow-purple);
    background: linear-gradient(180deg, var(--goflow-card) 0%, rgba(206, 130, 255, 0.1) 100%);
}

.pricing-card.featured::before {
    background: linear-gradient(135deg, #ce82ff, #8b5cf6);
}

.pricing-card:hover {
    border-color: var(--goflow-border-light);
}

.pricing-card.featured:hover {
    border-color: var(--goflow-purple);
}

.pricing-card.featured .plan-cta.primary:not(.manage-link) {
    background: linear-gradient(135deg, #ce82ff, #8b5cf6);
    box-shadow: 0 4px 0 #6d28d9;
    color: #fff;
}

.plan-description {
    margin-bottom: 1rem;
}

.plan-price {
    margin-bottom: 0.35rem;
}

.plan-per-month {
    min-height: 1.4em;
    margin-bottom: 1rem;
    color: var(--goflow-green);
    font-size: 0.88rem;
    font-weight: 700;
}

.plan-features li strong {
    color: #fff;
}

.upgrade-trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1.25rem;
    margin: 1.5rem 0 0;
    color: var(--goflow-text-muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.upgrade-unlock {
    width: 100%;
    max-width: 760px;
    margin: 0 auto 3rem;
    text-align: center;
}

.upgrade-unlock h2 {
    margin-bottom: 0.4rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.upgrade-unlock > p {
    margin: 0 0 1.25rem;
    color: var(--goflow-text-muted);
}

.unlock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.unlock-grid li {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--goflow-border);
    border-radius: 14px;
    background: var(--goflow-card);
}

.unlock-icon {
    flex: 0 0 auto;
    font-size: 1.6rem;
}

.unlock-text {
    display: grid;
    min-width: 0;
}

.unlock-text strong {
    color: #fff;
    font-size: 0.95rem;
}

.unlock-text span {
    color: var(--goflow-text-muted);
    font-size: 0.82rem;
}

@media (max-width: 768px) {
    .upgrade-hero {
        margin-bottom: 1.5rem;
    }

    .upgrade-hero .hero-gopher {
        display: none;
    }

    .upgrade-hero h1 {
        font-size: 1.75rem;
    }

    .pricing-header {
        margin-bottom: 1.5rem;
    }

    .pricing-card {
        padding: 1.5rem;
    }

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

    .unlock-grid li {
        padding: 0.75rem;
    }
}

.billing-option.active .save-badge {
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
}

/* The badge slot is only for "Your current plan". */
.plan-badge-area:empty {
    height: 0;
    margin: 0;
}
