/* =====================================================================
   UNIT PAGE — oyun teması (play ekranı ile uyumlu)
   ===================================================================== */

:root {
    --game-frame-dark: #2d1a0c;
    --game-frame-mid: #6b4423;
    --game-frame-light: #a67c52;
    --game-paper: #fff9eb;
    --game-paper-deep: #f3e6c8;
    --game-ink: #5d4037;
    --game-green: #5fa56b;
    --game-green-dark: #3f7a48;
    --game-gold: #f1b04a;
    --game-gold-dark: #c98a1f;
    --game-sky-top: #87ceeb;
    --game-sky-mid: #b8e4f5;
    --game-grass: #7cb342;
    --game-shadow: 0 6px 0 var(--game-frame-dark), 0 12px 28px rgba(45, 26, 12, 0.22);
    --game-shadow-sm: 0 3px 0 var(--game-frame-dark), 0 8px 18px rgba(45, 26, 12, 0.14);
    --font-game: 'Fredoka', 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.unit-page {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--game-ink);
    background: linear-gradient(180deg, var(--game-sky-top) 0%, var(--game-sky-mid) 38%, #d4e8c2 72%, var(--game-grass) 100%);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.unit-modal-open {
    overflow: hidden;
}

.unit-page__bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.unit-page__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(48px);
    opacity: 0.45;
}

.unit-page__orb--1 {
    width: 320px;
    height: 320px;
    top: -80px;
    right: -40px;
    background: rgba(255, 213, 79, 0.55);
}

.unit-page__orb--2 {
    width: 280px;
    height: 280px;
    bottom: 10%;
    left: -60px;
    background: rgba(95, 165, 107, 0.45);
}

.unit-page__orb--3 {
    width: 200px;
    height: 200px;
    top: 42%;
    left: 48%;
    background: rgba(255, 255, 255, 0.35);
}

/* ---------- Top bar ---------- */
.unit-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 16px;
}

.unit-topbar__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border: 3px solid var(--game-frame-dark);
    border-radius: 999px;
    background: linear-gradient(180deg, var(--game-paper) 0%, var(--game-paper-deep) 100%);
    box-shadow: var(--game-shadow-sm);
}

.unit-topbar__logo {
    min-width: 0;
    flex-shrink: 1;
}

.unit-topbar__logo.game-brand-mark .game-brand-mark__main {
    max-width: min(28vw, 220px);
}

.unit-topbar__logo.game-brand-mark:hover {
    transform: translateY(-1px);
}

.unit-topbar__nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.unit-topbar__home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 12px;
    border: 2px solid var(--game-frame-dark);
    background: linear-gradient(180deg, #fff8eb 0%, #fdecc8 100%);
    color: var(--game-frame-dark);
    text-decoration: none;
    font-size: 1rem;
    box-shadow: 0 2px 0 var(--game-frame-dark);
    transition: transform 0.15s ease, background 0.15s ease;
}

.unit-topbar__home:hover {
    background: linear-gradient(180deg, #fff 0%, #fdecc8 100%);
    transform: translateY(-1px);
}

.unit-topbar__home:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 var(--game-frame-dark);
}

.unit-topbar__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--game-ink);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
}

.unit-topbar__link:hover {
    background: rgba(45, 26, 12, 0.06);
}

.unit-topbar__btn {
    padding: 8px 16px;
    border-radius: 999px;
    border: 2px solid var(--game-frame-dark);
    background: linear-gradient(180deg, var(--game-green), var(--game-green-dark));
    color: #fff;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 800;
    box-shadow: 0 3px 0 var(--game-frame-dark);
}

.unit-topbar__btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

/* ---------- Main layout ---------- */
.unit-main {
    position: relative;
    z-index: 1;
    padding: 8px 16px 48px;
}

.unit-shell {
    max-width: 1100px;
    margin: 0 auto;
}

/* ---------- Hero ---------- */
.unit-hero {
    display: grid;
    grid-template-columns: 1fr minmax(140px, 220px);
    gap: 20px;
    align-items: stretch;
    margin-bottom: 28px;
    padding: 28px 28px 24px;
    border: 4px solid var(--game-frame-dark);
    border-radius: 28px;
    background:
        repeating-linear-gradient(
            -8deg,
            rgba(255, 255, 255, 0.04) 0 6px,
            transparent 6px 14px
        ),
        linear-gradient(165deg, var(--game-frame-mid) 0%, #4a3018 45%, var(--game-frame-dark) 100%);
    box-shadow: var(--game-shadow);
    color: #fff;
    overflow: hidden;
    position: relative;
}

.unit-hero__meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 14px;
}

.unit-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    padding: 6px 14px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 213, 79, 0.55);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.2);
    font-family: var(--font-game);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffe8a8;
}

.unit-hero__title {
    margin: 0 0 10px;
    font-family: var(--font-game);
    font-size: clamp(1.65rem, 4vw, 2.35rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.unit-hero__desc {
    margin: 0 0 16px;
    max-width: 560px;
    font-size: 0.98rem;
    line-height: 1.55;
    color: rgba(255, 248, 235, 0.88);
}

.unit-hero__stats {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 5px 6px 5px 4px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
}

.unit-stat {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.unit-stat + .unit-stat {
    border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.unit-stat i {
    color: var(--game-gold);
}

.unit-hero__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.unit-hero__toolbar-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
}

.unit-code-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border: 3px solid var(--game-frame-dark);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--game-paper) 0%, var(--game-paper-deep) 100%);
    box-shadow: 0 4px 0 var(--game-frame-dark);
}

.unit-code-chip__label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--game-frame-mid);
}

.unit-code-chip__value {
    font-family: var(--font-game);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--game-frame-dark);
}

.unit-share-btn,
.unit-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border: 3px solid var(--game-frame-dark);
    border-radius: 16px;
    font-family: var(--font-game);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--game-frame-dark);
    transition: transform 0.15s ease, filter 0.15s ease;
    white-space: nowrap;
}

.unit-share-btn {
    background: linear-gradient(180deg, #7eb8ff, #4a90d9);
    color: #fff;
}

.unit-share-btn:hover,
.unit-reset-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-2px);
}

.unit-share-btn:active,
.unit-reset-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--game-frame-dark);
}

.unit-reset-btn {
    background: linear-gradient(180deg, #ff8a8a, #e05252);
    color: #fff;
}

.unit-hero__art {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    min-height: 120px;
}

.unit-hero__card-img {
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(200px, 42%);
    max-height: 85%;
    object-fit: contain;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35));
    z-index: 1;
}

.unit-hero__code-watermark {
    position: absolute;
    right: 48px;
    bottom: -12px;
    font-family: var(--font-game);
    font-size: clamp(3.5rem, 8vw, 5.5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    color: transparent;
    -webkit-text-stroke: 2px rgba(255, 255, 255, 0.12);
    pointer-events: none;
    user-select: none;
}

.unit-hero__teacher-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 0;
    padding: 8px 14px;
    border: 2px solid rgba(255, 213, 79, 0.45);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
    color: #ffe8a8;
    font-size: 0.82rem;
    font-weight: 700;
}

/* ---------- Course cards ---------- */
.unit-courses {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.course-card {
    border: 4px solid var(--game-frame-dark);
    border-radius: 24px;
    background: linear-gradient(180deg, var(--game-paper) 0%, #f8edd4 100%);
    box-shadow: var(--game-shadow);
    overflow: hidden;
}

.course-card--completed {
    background: linear-gradient(rgb(255, 249, 235), rgb(199, 255, 223));
}

.course-card__head {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 14px;
    padding: 20px 22px 12px;
}

.course-card__icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--game-frame-dark);
    border-radius: 16px;
    background: linear-gradient(145deg, var(--game-gold), var(--game-gold-dark));
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 3px 0 var(--game-frame-dark);
}

.course-card__titles h2 {
    margin: 0 0 4px;
    font-family: var(--font-game);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--game-frame-dark);
    line-height: 1.15;
}

.course-card__titles p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--game-ink);
    opacity: 0.85;
    line-height: 1.45;
}

.course-card__scores {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.course-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 2px solid var(--game-frame-dark);
    border-radius: 999px;
    background: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--game-frame-dark);
    box-shadow: 0 2px 0 var(--game-frame-dark);
}

.course-pill--points .fa-award { color: var(--game-gold-dark); }
.course-pill--stars .fa-star { color: #e6a817; }

.course-reset-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(180, 60, 60, 0.45);
    border-radius: 12px;
    background: rgba(214, 86, 101, 0.12);
    color: #b8434f;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.course-reset-btn:hover {
    background: rgba(214, 86, 101, 0.22);
    transform: scale(1.05);
}

.course-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 22px 14px;
    padding: 10px 18px;
    border: 3px solid var(--game-frame-dark);
    border-radius: 999px;
    background: linear-gradient(180deg, var(--game-green), var(--game-green-dark));
    color: #fff;
    font-family: var(--font-game);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 0 var(--game-frame-dark);
}

.course-toggle:hover {
    filter: brightness(1.05);
}

.course-toggle i {
    transition: transform 0.25s ease;
}

.course-toggle:not(.active) i {
    transform: rotate(180deg);
}

.course-levels {
    padding: 0 18px 20px;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 10px;
    padding: 16px;
    border: 3px dashed rgba(107, 68, 35, 0.35);
    border-radius: 18px;
    background:
        radial-gradient(circle at 20% 0%, rgba(124, 179, 66, 0.12), transparent 50%),
        rgba(255, 255, 255, 0.45);
}

/* ---------- Level tiles ---------- */
.level-tile {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    border: 3px solid var(--game-frame-dark);
    border-radius: 18px;
    background: linear-gradient(180deg, #fffef8 0%, var(--game-paper-deep) 100%);
    cursor: pointer;
    box-shadow: 0 4px 0 var(--game-frame-dark);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.level-tile:not(.locked):not(.completed):hover {
    transform: translateY(-4px);
    box-shadow: 0 7px 0 var(--game-frame-dark);
    background: linear-gradient(180deg, #fff 0%, #fff3d6 100%);
}

.level-tile.completed:not(.locked):hover {
    transform: translateY(-4px);
    border-color: var(--game-green-dark);
    background: linear-gradient(165deg, #6fbf7a, var(--game-green-dark));
    box-shadow: 0 7px 0 #2d5a34;
}

.level-tile--info:not(.locked):not(.completed):hover {
    border-color: #7c3aed;
}

.level-tile--info.completed:not(.locked):hover {
    border-color: var(--game-green-dark);
    background: linear-gradient(165deg, var(--game-green), var(--game-green-dark));
}

.level-tile:active:not(.locked) {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--game-frame-dark);
}

.level-tile.completed:active:not(.locked) {
    box-shadow: 0 1px 0 #2d5a34;
}

.level-tile__num {
    font-family: var(--font-game);
    font-size: clamp(1.75rem, 4vw, 2.2rem);
    font-weight: 700;
    line-height: 1;
    color: var(--game-frame-mid);
}

.level-tile--info {
    background: linear-gradient(180deg, #f5f3ff, #e9e0ff);
    border-color: #6d28d9;
    box-shadow: 0 4px 0 #5b21b6;
}

.level-tile--info:not(.locked):hover {
    border-color: #7c3aed;
}

.level-tile__info-icon {
    font-size: 1.6rem;
    color: #7c3aed;
}

.level-tile__info-label {
    font-size: 0.58rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6d28d9;
}

.level-tile.locked {
    background: #e8e4dc;
    border-color: #a89f94;
    box-shadow: 0 3px 0 #8a8278;
    cursor: not-allowed;
    opacity: 0.92;
}

.level-tile.locked::before {
    content: '\f023';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #9a9288;
    z-index: 2;
}

.level-tile.locked .level-tile__num,
.level-tile.locked .level-tile__info-icon,
.level-tile.locked .level-tile__info-label {
    visibility: hidden;
}

.level-tile.completed {
    border-color: var(--game-green-dark);
    background: linear-gradient(165deg, var(--game-green), var(--game-green-dark));
    box-shadow: 0 4px 0 #2d5a34;
}

.level-tile.completed .level-tile__num,
.level-tile.completed .level-tile__info-icon {
    color: #fff;
}

.level-tile.completed .level-tile__info-label {
    color: rgba(255, 255, 255, 0.9);
}

.level-tile--cert {
    background: linear-gradient(165deg, #f5d76e, #d4a017);
    border-color: #b8860b;
    box-shadow: 0 4px 0 #8b6914;
}

.level-tile--cert:not(.locked):hover {
    transform: translateY(-4px);
    border-color: #9a7209;
    background: linear-gradient(165deg, #ffe08a, #e0b020);
    box-shadow: 0 7px 0 #8b6914;
}

.level-tile--cert:active:not(.locked) {
    box-shadow: 0 1px 0 #8b6914;
}

.level-tile__cert-icon {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    color: #5c4033;
    line-height: 1;
}

.level-tile--cert::after {
    display: none;
}

.level-tile.completed::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 0.6rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Share modal ---------- */
.unit-share-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.unit-share-modal[hidden] {
    display: none !important;
}

.unit-share-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.unit-share-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 12, 6, 0.72);
    backdrop-filter: blur(4px);
}

.unit-share-modal__panel {
    position: relative;
    width: 100%;
    max-width: 480px;
    padding: 32px 28px 28px;
    border: 4px solid var(--game-frame-dark);
    border-radius: 28px;
    background: linear-gradient(180deg, var(--game-paper) 0%, var(--game-paper-deep) 100%);
    box-shadow: 0 12px 0 var(--game-frame-dark), 0 24px 60px rgba(0, 0, 0, 0.35);
    text-align: center;
    transform: scale(0.92) translateY(12px);
    transition: transform 0.32s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.unit-share-modal.is-open .unit-share-modal__panel {
    transform: scale(1) translateY(0);
}

.unit-share-modal__close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--game-frame-dark);
    border-radius: 50%;
    background: linear-gradient(180deg, #ff6b6b, #e04545);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--game-frame-dark);
}

.unit-share-modal__close:hover {
    filter: brightness(1.08);
}

.unit-share-modal__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--game-frame-dark);
    border-radius: 18px;
    background: linear-gradient(145deg, #7eb8ff, #4a90d9);
    color: #fff;
    font-size: 1.35rem;
    box-shadow: 0 4px 0 var(--game-frame-dark);
}

.unit-share-modal__title {
    margin: 0 0 6px;
    font-family: var(--font-game);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--game-frame-dark);
}

.unit-share-modal__subtitle {
    margin: 0 0 16px;
    font-size: 0.92rem;
    color: var(--game-ink);
    opacity: 0.9;
}

.unit-share-modal__code {
    margin: 0 0 12px;
    padding: 16px 20px;
    border: 3px dashed var(--game-frame-mid);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.65);
    font-family: var(--font-game);
    font-size: clamp(2.2rem, 8vw, 3rem);
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--game-frame-dark);
    line-height: 1;
}

.unit-share-modal__hint {
    margin: 0 0 18px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--game-ink);
    opacity: 0.8;
}

.unit-share-modal__field-label {
    display: block;
    margin-bottom: 8px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--game-frame-mid);
}

.unit-share-modal__field {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.unit-share-modal__input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 2px solid var(--game-frame-dark);
    border-radius: 14px;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--game-ink);
}

.unit-share-modal__copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border: 2px solid var(--game-frame-dark);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--game-green), var(--game-green-dark));
    color: #fff;
    font-family: var(--font-game);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 0 var(--game-frame-dark);
    white-space: nowrap;
}

.unit-share-modal__copy:hover {
    filter: brightness(1.05);
}

.unit-share-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.unit-share-modal__action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border: 2px solid var(--game-frame-dark);
    border-radius: 14px;
    background: #fff;
    color: var(--game-frame-dark);
    font-family: var(--font-game);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 0 var(--game-frame-dark);
}

.unit-share-modal__action:hover {
    background: #fffef8;
}

.unit-share-modal__action--native {
    background: linear-gradient(180deg, #7eb8ff, #4a90d9);
    color: #fff;
}

.unit-share-modal__toast {
    margin: 14px 0 0;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(95, 165, 107, 0.2);
    border: 2px solid var(--game-green-dark);
    color: var(--game-green-dark);
    font-size: 0.88rem;
    font-weight: 700;
}

.unit-share-modal__toast[hidden] {
    display: none !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .unit-hero {
        grid-template-columns: 1fr;
        padding: 22px 20px 20px;
    }

    .unit-hero__art {
        display: none;
    }

    .course-card__head {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
    }

    .course-card__scores {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .unit-share-modal__field {
        flex-direction: column;
    }

    .unit-share-modal__copy {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .unit-hero__meta-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .unit-hero__stats {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 10px;
        border-radius: 16px;
    }

    .unit-stat + .unit-stat {
        border-left: none;
        padding-left: 0;
    }

    .unit-stat {
        padding: 2px 0;
    }
}

@media (max-width: 480px) {
    .unit-hero__toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .unit-hero__toolbar-actions {
        width: 100%;
    }

    .unit-share-btn,
    .unit-reset-btn {
        flex: 1;
        justify-content: center;
    }

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

/* ---------- Course hub (ders.php) ---------- */
body.course-page .unit-hero__badge--course {
    background: linear-gradient(180deg, #7eb8ff 0%, #5a9fd4 100%);
    color: #fff;
}

.unit-hero__parent-unit {
    margin: 0 0 14px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.unit-hero__parent-unit a {
    color: var(--game-green-dark);
    font-weight: 700;
    text-decoration: none;
}

.unit-hero__parent-unit a:hover {
    text-decoration: underline;
}

.unit-hero__parent-code {
    font-family: ui-monospace, monospace;
    font-size: 0.82rem;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(93, 64, 55, 0.08);
    color: var(--game-ink);
}

.course-card--solo {
    margin-top: 0;
}

.course-card--solo .course-card__head h2 {
    margin: 0;
    font-size: 1.15rem;
}
