.sg-page {
    position: relative;
    touch-action: manipulation;
}

.sg-hero {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    padding: 2rem;
    margin: 1.25rem 0 2rem;
    background: linear-gradient(135deg, #5a8dff, #58d8a4);
    box-shadow: 0 14px 35px rgba(70, 116, 220, 0.25);
}

.sg-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    color: #ffffff;
}

.sg-tag {
    display: inline-block;
    margin-bottom: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
    font-size: 0.9rem;
}

.sg-hero h1 {
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: clamp(1.9rem, 4vw, 2.7rem);
}

.sg-hero p {
    margin-bottom: 1rem;
}

.sg-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1.3rem;
}

.sg-hero-badges span {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-weight: 600;
}

.sg-orb {
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    z-index: 1;
}

.sg-orb-a {
    width: 160px;
    height: 160px;
    top: -40px;
    right: -25px;
    background: rgba(255, 255, 255, 0.24);
    animation: sgFloat 5s ease-in-out infinite;
}

.sg-orb-b {
    width: 120px;
    height: 120px;
    bottom: -35px;
    left: -25px;
    background: rgba(255, 255, 255, 0.2);
    animation: sgFloat 6s ease-in-out infinite reverse;
}

.sg-board-wrapper {
    position: relative;
}

.sg-board {
    background: #ffffff;
    border-radius: 18px;
    border: 2px solid rgba(59, 129, 253, 0.16);
    box-shadow: 0 14px 36px rgba(24, 35, 63, 0.12);
    padding: 1.4rem;
}

.sg-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.sg-stat-card {
    padding: 0.75rem;
    border-radius: 12px;
    background: linear-gradient(145deg, #f6fbff, #ecf6ff);
    border: 1px solid rgba(59, 129, 253, 0.2);
    text-align: center;
}

.sg-stat-label {
    display: block;
    font-size: 0.8rem;
    color: #61718f;
    margin-bottom: 0.25rem;
}

.sg-stat-card strong {
    color: #1f366d;
    font-size: 1.1rem;
}

.sg-stars-row {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
    margin-bottom: 0.9rem;
}

.sg-star {
    font-size: 1.5rem;
    color: #d4d9e4;
    transition: transform 0.25s ease, color 0.25s ease, filter 0.25s ease;
}

.sg-star.is-earned {
    color: #ffc83d;
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(255, 198, 58, 0.5));
}

.sg-progress-track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #edf2ff;
    border: 1px solid rgba(59, 129, 253, 0.15);
    overflow: hidden;
}

.sg-progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #67e0a6, #3b81fd);
    transition: width 0.35s ease;
}

.sg-round-text {
    text-align: center;
    color: #5f6e88;
    margin: 0.55rem 0 1rem;
    font-weight: 600;
}

.sg-question-card {
    border-radius: 16px;
    border: 1px solid rgba(59, 129, 253, 0.2);
    background: linear-gradient(135deg, #ffffff, #f4f8ff);
    padding: 1rem;
    text-align: center;
    margin-bottom: 1rem;
}

.sg-question-card.sg-correct-pulse {
    animation: sgPulseGood 0.5s ease;
}

.sg-question-card.sg-wrong-shake {
    animation: sgShakeBad 0.45s ease;
}

.sg-mode-label {
    color: #2f66cf;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.sg-prompt {
    margin: 0;
    color: #1d2f5f;
    font-size: clamp(1.1rem, 2.8vw, 1.5rem);
}

.sg-word-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0.9rem 0 0.6rem;
    min-height: 72px;
    min-width: min(310px, 100%);
    max-width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: #ffffff;
    border: 2px solid rgba(59, 129, 253, 0.25);
    box-shadow: inset 0 -6px 12px rgba(59, 129, 253, 0.08);
    font-size: clamp(1.45rem, 4.2vw, 2rem);
    font-weight: 700;
    color: #2a4080;
    text-transform: lowercase;
}

.sg-hint {
    color: #5f6e88;
    margin-bottom: 0.65rem;
}

.sg-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.sg-option-btn {
    border: 0;
    border-radius: 14px;
    padding: 0.8rem;
    background: linear-gradient(140deg, #ffffff, #f2f8ff);
    color: #1f3569;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 15px rgba(24, 35, 63, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    min-height: 56px;
    touch-action: manipulation;
}

.sg-option-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(24, 35, 63, 0.12);
}

.sg-option-btn:disabled {
    cursor: default;
    opacity: 0.88;
}

.sg-option-btn.is-correct {
    background: linear-gradient(135deg, #ccf9e4, #a7efcd);
    color: #124a36;
}

.sg-option-btn.is-wrong {
    background: linear-gradient(135deg, #ffe2e6, #ffcfd7);
    color: #7b2032;
}

.sg-feedback {
    min-height: 2rem;
    margin: 1rem 0 0;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2a4080;
}

.sg-feedback.is-success {
    color: #1f7d4f;
}

.sg-feedback.is-error {
    color: #b12f4a;
}

.sg-summary-card {
    margin-top: 1.2rem;
    border-radius: 16px;
    padding: 1.2rem;
    text-align: center;
    border: 2px solid rgba(59, 129, 253, 0.2);
    background: linear-gradient(135deg, #f9fcff, #f1f7ff);
}

.sg-summary-card h3 {
    margin-top: 0;
    color: #1f366d;
}

.sg-summary-stars {
    margin: 0.8rem 0 1rem;
    font-size: 1.7rem;
    color: #ffc83d;
}

.sg-instructions {
    margin-top: 1.3rem;
    border: 1px solid rgba(59, 129, 253, 0.2);
}

.sg-instructions ul {
    margin-left: 1rem;
}

.sg-custom-words {
    margin-top: 1rem;
    border: 1px solid rgba(59, 129, 253, 0.2);
}

.sg-custom-status {
    margin-top: 0.65rem;
    color: #2a4080;
    font-weight: 600;
    min-height: 1.2rem;
}

.sg-seo-content {
    margin-top: 1rem;
    border: 1px solid rgba(59, 129, 253, 0.18);
}

.sg-settings-panel,
.sg-rewards-panel,
.sg-dashboard-panel {
    margin-top: 1rem;
    border: 1px solid rgba(59, 129, 253, 0.18);
}

.sg-touch-tip {
    color: #5f6e88;
    font-size: 0.95rem;
}

.sg-learner-status {
    margin-top: 0.45rem;
    color: #2a4080;
    font-size: 0.9rem;
    min-height: 1.2rem;
}

.sg-teacher-status {
    margin-top: 0.45rem;
    color: #2a4080;
    font-size: 0.9rem;
    min-height: 1.2rem;
}

.sg-skin-list,
.sg-badges-list,
.sg-level-map {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sg-skin-btn {
    border: 2px solid rgba(59, 129, 253, 0.2);
    background: #f6faff;
    border-radius: 10px;
    padding: 0.45rem 0.6rem;
    font-size: 1.2rem;
    min-width: 52px;
    min-height: 52px;
    cursor: pointer;
    touch-action: manipulation;
}

.sg-skin-btn.is-selected {
    border-color: #3b81fd;
    box-shadow: 0 0 0 2px rgba(59, 129, 253, 0.15);
}

.sg-skin-btn.is-locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.sg-badge-chip {
    border-radius: 999px;
    background: #eef4ff;
    border: 1px solid rgba(59, 129, 253, 0.2);
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.sg-badge-chip.is-new {
    background: #d5f8e6;
    border-color: #67e0a6;
}

.sg-level-node {
    border-radius: 10px;
    border: 1px solid rgba(59, 129, 253, 0.22);
    background: #f4f8ff;
    padding: 0.5rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #2a4080;
}

.sg-level-node.is-unlocked {
    background: #dff6ec;
    border-color: #67e0a6;
    color: #1d6a4a;
}

.sg-level-node.is-current {
    border-width: 2px;
    border-color: #3b81fd;
}

.sg-mini-stat {
    border: 1px solid rgba(59, 129, 253, 0.2);
    background: #f7fbff;
    border-radius: 12px;
    padding: 0.7rem;
    text-align: center;
}

.sg-mini-stat span {
    display: block;
    color: #61718f;
    font-size: 0.82rem;
    margin-bottom: 0.2rem;
}

.sg-mini-stat strong {
    color: #1f366d;
    font-size: 1.1rem;
}

.sg-confetti-layer {
    pointer-events: none;
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.sg-confetti-piece {
    position: absolute;
    top: -16px;
    width: 10px;
    height: 14px;
    border-radius: 2px;
    animation: sgConfettiDrop linear forwards;
}

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

@keyframes sgPulseGood {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes sgShakeBad {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-8px);
    }
    50% {
        transform: translateX(8px);
    }
    75% {
        transform: translateX(-5px);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes sgConfettiDrop {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(520px) rotate(540deg);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .sg-board {
        padding: 1rem;
    }

    .sg-options {
        grid-template-columns: 1fr;
    }

    .sg-word-bubble {
        min-width: 100%;
    }
}
