:root {
    color-scheme: dark;
    --bg: #07111f;
    --panel: rgba(255, 255, 255, 0.09);
    --panel-strong: rgba(255, 255, 255, 0.14);
    --line: rgba(255, 255, 255, 0.18);
    --text: #e5edf8;
    --muted: #9fb0c8;
    --brand-text: #ffffff;
    --input-bg: rgba(2, 8, 23, 0.62);
    --input-text: #ffffff;
    --button-bg: rgba(255, 255, 255, 0.1);
    --button-text: #ffffff;
    --nav-bg: rgba(255, 255, 255, 0.07);
    --mobile-nav-bg: #0c1728;
    --nav-hover: rgba(255, 255, 255, 0.12);
    --row-bg: rgba(255, 255, 255, 0.07);
    --metric-bg: rgba(255, 255, 255, 0.08);
    --scanner-bg: rgba(2, 8, 23, 0.72);
    --chart-text: #c7d4e8;
    --chart-grid: rgba(255, 255, 255, 0.06);
    --shadow: rgba(0, 0, 0, 0.24);
    --glow-a: rgba(45, 212, 191, 0.08);
    --glow-b: rgba(251, 191, 36, 0.07);
    --grid-line: rgba(255, 255, 255, 0.03);
    --teal: #2dd4bf;
    --amber: #fbbf24;
    --rose: #fb7185;
    --blue: #60a5fa;
    --green: #34d399;
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #eef5fb;
    --panel: rgba(255, 255, 255, 0.74);
    --panel-strong: rgba(255, 255, 255, 0.86);
    --line: rgba(15, 23, 42, 0.12);
    --text: #132033;
    --muted: #5d6b7f;
    --brand-text: #0f172a;
    --input-bg: rgba(255, 255, 255, 0.82);
    --input-text: #0f172a;
    --button-bg: rgba(15, 23, 42, 0.06);
    --button-text: #152238;
    --nav-bg: rgba(255, 255, 255, 0.66);
    --mobile-nav-bg: #f7fbff;
    --nav-hover: rgba(15, 23, 42, 0.08);
    --row-bg: rgba(255, 255, 255, 0.68);
    --metric-bg: rgba(255, 255, 255, 0.7);
    --scanner-bg: rgba(241, 245, 249, 0.9);
    --chart-text: #475569;
    --chart-grid: rgba(15, 23, 42, 0.08);
    --shadow: rgba(15, 23, 42, 0.11);
    --glow-a: rgba(14, 165, 233, 0.14);
    --glow-b: rgba(45, 212, 191, 0.16);
    --grid-line: rgba(15, 23, 42, 0.045);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(115deg, var(--glow-a), transparent 34%),
        linear-gradient(245deg, var(--glow-b), transparent 38%),
        repeating-linear-gradient(90deg, var(--grid-line) 0, var(--grid-line) 1px, transparent 1px, transparent 76px);
}

.grid { display: grid; }
.flex { display: flex; }
.block { display: block; }
.hidden { display: none; }
.flex-1 { flex: 1 1 0%; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.\!grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.space-y-5 > * + * { margin-top: 20px; }
.font-bold { font-weight: 800; }
.text-right { text-align: right; }
.text-sm { font-size: 13px; }
.text-rose-200 { color: #fecdd3; }
.text-amber-100 { color: #fef3c7; }
.text-teal-100 { color: #ccfbf1; }

html[data-theme="light"] .text-rose-200 { color: #be123c; }
html[data-theme="light"] .text-amber-100 { color: #92400e; }
html[data-theme="light"] .text-teal-100 { color: #0f766e; }

.app-shell {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--brand-text);
    text-decoration: none;
    min-width: 160px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-switch {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--nav-bg);
    backdrop-filter: blur(18px);
}

.theme-switch button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.theme-switch button.is-active {
    color: var(--button-text);
    background: var(--nav-hover);
}

.theme-switch svg {
    width: 16px;
    height: 16px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--teal), var(--blue));
    color: #04111f;
    font-weight: 900;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 1px;
}

.site-nav {
    display: flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--nav-bg);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}

.nav-link svg,
.mobile-nav-button svg,
.icon-button svg {
    width: 18px;
    height: 18px;
}

.nav-link.is-active,
.nav-link:hover {
    color: var(--brand-text);
    background: var(--nav-hover);
}

.nav-item {
    position: relative;
    display: inline-flex;
}

.nav-menu-button {
    border: 0;
    appearance: none;
    cursor: pointer;
    font: inherit;
}

.nav-caret {
    width: 15px !important;
    height: 15px !important;
    opacity: .78;
    transition: transform .18s ease;
}

.nav-dropdown.is-open .nav-caret {
    transform: rotate(180deg);
}

.nav-submenu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 90;
    display: none;
    min-width: 172px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--mobile-nav-bg);
    box-shadow: 0 18px 48px var(--shadow);
}

.nav-dropdown.is-open .nav-submenu {
    display: grid;
    gap: 4px;
}

.nav-sub-link {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.nav-sub-link:hover,
.nav-sub-link.is-active {
    background: var(--nav-hover);
    color: var(--brand-text);
}

.nav-sub-link svg {
    width: 16px;
    height: 16px;
}

.mobile-nav-button {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--button-bg);
    color: var(--button-text);
}

.page-main {
    padding: 18px 0 42px;
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    padding: 24px 0 40px;
    color: var(--muted);
    font-size: 13px;
}

.page-title {
    display: grid;
    gap: 8px;
    margin: 18px 0 22px;
}

.app-view {
    display: none;
}

.app-view.is-active {
    display: block;
}

.eyebrow {
    color: var(--teal);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-title h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 52px);
    line-height: 1.05;
    letter-spacing: 0;
}

.page-title p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.glass {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 24px 70px var(--shadow);
    backdrop-filter: blur(18px);
}

.glass-strong {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    backdrop-filter: blur(18px);
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}

.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.panel {
    padding: 18px;
}

.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-title h2,
.panel-title h3 {
    margin: 0;
    font-size: 18px;
}

.muted {
    color: var(--muted);
}

.stat-value {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 900;
    line-height: 1;
}

.ball-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ball {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    color: #06111f;
    font-weight: 900;
    box-shadow: inset 0 -7px 14px rgba(0, 0, 0, 0.16), 0 8px 22px rgba(0, 0, 0, 0.18);
}

.ball.sm {
    width: 30px;
    height: 30px;
    font-size: 13px;
}

.ball.plus {
    background: var(--button-bg);
    color: var(--button-text);
    box-shadow: none;
}

.ball.c1 { background: #facc15; }
.ball.c2 { background: #60a5fa; }
.ball.c3 { background: #fb7185; }
.ball.c4 { background: #9ca3af; }
.ball.c5 { background: #34d399; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    background: var(--button-bg);
    color: var(--button-text);
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--nav-hover);
}

.btn:disabled {
    opacity: 0.68;
    cursor: wait;
}

.btn.is-cooling {
    pointer-events: none;
}

.cooldown-count {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    color: inherit;
    font-size: 12px;
    font-weight: 900;
}

.btn-primary {
    border: 0;
    background: linear-gradient(135deg, var(--teal), var(--blue));
    color: #031322;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5eead4, #93c5fd);
}

.btn-danger {
    background: rgba(251, 113, 133, 0.18);
    color: #fecdd3;
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.input,
.select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--input-text);
    padding: 0 12px;
    outline: none;
}

.input:focus,
.select:focus {
    border-color: var(--teal);
}

.result-list {
    display: grid;
    gap: 10px;
}

.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border-radius: 8px;
    background: var(--row-bg);
}

.draw-result-row {
    position: relative;
    overflow: hidden;
}

.flying-ball-row {
    position: relative;
    overflow: visible;
}

.flying-ball {
    opacity: 0;
    transform: translate3d(var(--start-x, 0), var(--start-y, -180px), 0) scale(.34) rotate(-260deg);
    animation: ballLand .78s cubic-bezier(.17,.84,.31,1.25) forwards;
    animation-delay: var(--land-delay, 0s);
    will-change: transform, opacity;
}

.draw-result-row::before {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(45,212,191,.7), transparent);
    opacity: 0;
    animation: rowSweep .9s ease forwards;
}

@keyframes ballLand {
    0% {
        opacity: 0;
        transform: translate3d(var(--start-x, 0), var(--start-y, -180px), 0) scale(.34) rotate(-260deg);
        filter: blur(8px);
    }
    58% {
        opacity: 1;
        transform: translate3d(8px, 8px, 0) scale(1.16) rotate(18deg);
        filter: blur(.2px);
    }
    78% {
        transform: translate3d(-3px, -3px, 0) scale(.94) rotate(-8deg);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
        filter: blur(0);
    }
}

@keyframes rowSweep {
    0% { opacity: 0; transform: translateX(-40%); }
    40% { opacity: .85; }
    100% { opacity: 0; transform: translateX(40%); }
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.metric {
    padding: 14px;
    border-radius: 8px;
    background: var(--metric-bg);
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.metric strong {
    display: block;
    margin-top: 7px;
    font-size: 22px;
}

.table-list {
    display: grid;
    gap: 8px;
}

.rank-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 80px;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    background: var(--row-bg);
}

.rank-badge {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(45, 212, 191, 0.16);
    color: #99f6e4;
    font-weight: 900;
}

.draw-picker {
    display: grid;
    grid-template-columns: minmax(132px, 160px) auto;
    align-items: end;
    gap: 10px;
    margin: 2px 0 22px;
    max-width: 300px;
}

.draw-picker-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.draw-picker-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.draw-picker .number-stepper {
    width: 100%;
    min-width: 0;
    flex: none;
    grid-template-columns: minmax(0, 1fr) 34px;
}

.draw-picker .number-stepper input {
    min-height: 42px;
    padding-right: 42px;
}

.draw-picker .step-buttons {
    width: 30px;
}

.draw-picker .btn {
    min-width: 82px;
    min-height: 42px;
}

.recommend-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -4px 0 18px;
}

.recommend-tabs .btn.is-active {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.2), rgba(96, 165, 250, 0.2));
    border-color: rgba(45, 212, 191, 0.48);
    color: var(--brand-text);
}

.keyword-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-card {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    width: auto;
    padding: 0 14px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;
    background: var(--row-bg);
    color: var(--button-text);
    text-align: center;
    cursor: pointer;
}

.keyword-card .block {
    display: inline;
}

.keyword-card.is-selected {
    border-color: var(--amber);
    background: rgba(251, 191, 36, 0.16);
}

.scanner-box {
    overflow: hidden;
    min-height: 320px;
    border-radius: 8px;
    background: var(--scanner-bg);
}

.draw-range {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.number-stepper {
    position: relative;
    display: grid;
    grid-template-columns: minmax(96px, 112px) 30px;
    grid-template-rows: 1fr 1fr;
    align-items: stretch;
}

.number-stepper input {
    grid-row: 1 / 3;
    padding-right: 36px;
    font-weight: 900;
}

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

.number-stepper input[type="number"] {
    appearance: textfield;
}

.number-stepper span {
    position: absolute;
    left: 12px;
    bottom: -18px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.step-buttons {
    position: absolute;
    right: 5px;
    top: 5px;
    bottom: 5px;
    display: grid;
    width: 26px;
    overflow: hidden;
    border-radius: 6px;
}

.step-buttons button {
    display: grid;
    place-items: center;
    border: 0;
    background: var(--button-bg);
    color: var(--button-text);
    cursor: pointer;
}

.step-buttons button:hover {
    background: var(--nav-hover);
}

.step-buttons svg {
    width: 14px;
    height: 14px;
}

.range-hint {
    margin: -4px 0 14px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}

.hidden-control {
    display: none !important;
}

.store-filter-panel {
    margin-bottom: 16px;
}

.store-mode-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.store-mode-tabs .btn.is-active {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.2), rgba(96, 165, 250, 0.2));
    border-color: rgba(45, 212, 191, 0.48);
    color: var(--brand-text);
}

.store-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 12px;
    align-items: end;
}

.store-summary {
    margin-bottom: 16px;
}

.sim-fixed-field {
    margin-bottom: 14px;
}

.share-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel-strong);
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.btn-kakao {
    background: #fee500;
    color: #191600;
    border-color: rgba(25, 22, 0, 0.12);
}

.ad-card {
    width: min(460px, 100%);
}

.ad-placeholder {
    display: grid;
    gap: 8px;
    place-items: center;
    min-height: 180px;
    padding: 22px;
    border: 1px dashed rgba(45, 212, 191, 0.65);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(45, 212, 191, 0.16), rgba(96, 165, 250, 0.12)),
        var(--panel-strong);
    text-align: center;
}

.ad-placeholder span {
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.ad-placeholder strong {
    font-size: 22px;
}

.ad-placeholder small {
    color: var(--muted);
    line-height: 1.6;
}

.inline-ad-notice {
    display: grid;
    min-height: 300px;
    place-items: center;
    padding: 8px;
}

.inline-ad-notice .ad-placeholder {
    width: min(100%, 420px);
}

.sim-chart-wrap {
    min-height: 190px;
}

.sim-chart-wrap .inline-ad-notice {
    min-height: 190px;
}

.lotto-machine {
    display: grid;
    gap: 16px;
    place-items: center;
    min-height: 430px;
    padding: 18px 18px 8px;
    text-align: center;
}

.machine-stage {
    position: relative;
    width: min(390px, 84vw);
    height: min(390px, 84vw);
    display: grid;
    place-items: center;
    perspective: 900px;
}

.machine-drum {
    position: relative;
    width: min(340px, 74vw);
    aspect-ratio: 1;
    border-radius: 999px;
    border: 10px solid rgba(255, 255, 255, 0.62);
    background:
        radial-gradient(circle at 30% 23%, rgba(255,255,255,.96), rgba(255,255,255,.18) 24%, transparent 42%),
        radial-gradient(circle at 58% 64%, rgba(45,212,191,.18), rgba(96,165,250,.12) 44%, rgba(255,255,255,.08) 74%),
        var(--panel-strong);
    box-shadow:
        inset 0 0 48px rgba(255,255,255,.34),
        inset 0 -24px 40px rgba(45,212,191,.14),
        0 34px 90px var(--shadow);
    overflow: hidden;
    transform-style: preserve-3d;
    animation: machineBowlShake .78s ease-in-out infinite alternate;
}

.machine-base {
    position: absolute;
    left: 18%;
    right: 18%;
    bottom: 8px;
    height: 38px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(45,212,191,.42), rgba(96,165,250,.35));
    filter: blur(1px);
    box-shadow: 0 24px 46px rgba(15,23,42,.18);
}

.machine-drum::before,
.machine-drum::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.machine-drum::before {
    inset: 7%;
    border: 1px solid rgba(255,255,255,.42);
    background:
        linear-gradient(120deg, rgba(255,255,255,.36), transparent 26%),
        linear-gradient(300deg, transparent 52%, rgba(255,255,255,.18));
    z-index: 7;
}

.machine-drum::after {
    inset: 17%;
    border: 1px solid rgba(255,255,255,.3);
    z-index: 2;
}

.machine-vortex,
.machine-paddle {
    position: absolute;
    inset: 22%;
    border-radius: 999px;
    z-index: 1;
    pointer-events: none;
}

.machine-vortex {
    border: 2px dashed rgba(45,212,191,.26);
    box-shadow: 0 0 28px rgba(96,165,250,.18);
    animation: vortexSpin .82s linear infinite;
}

.machine-paddle {
    inset: 33%;
    border: 3px solid transparent;
    border-left-color: rgba(45,212,191,.42);
    border-right-color: rgba(96,165,250,.36);
    animation: paddleSpin .56s linear infinite;
}

.machine-ball {
    position: absolute;
    display: grid;
    place-items: center;
    left: 50%;
    top: 50%;
    width: var(--size, 40px);
    height: var(--size, 40px);
    border-radius: 999px;
    background:
        radial-gradient(circle at 32% 25%, rgba(255,255,255,.9), rgba(255,255,255,.2) 18%, transparent 34%),
        var(--ball-bg, #facc15);
    color: #0f172a;
    z-index: 4;
    font-weight: 900;
    box-shadow:
        inset -6px -8px 12px rgba(15,23,42,.16),
        0 13px 22px rgba(15,23,42,.22);
    will-change: transform, filter;
    animation: ballWhirl var(--dur, 1s) cubic-bezier(.2,.8,.18,1) infinite;
    animation-delay: var(--delay, 0s);
}

.machine-ball:nth-of-type(2n) {
    filter: blur(.8px);
}

.machine-ball:nth-of-type(3n) {
    animation-direction: reverse;
}

.machine-chute {
    position: absolute;
    right: 19%;
    bottom: 46px;
    z-index: 8;
    display: flex;
    gap: 4px;
    transform: rotate(-18deg);
}

.machine-chute span {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: linear-gradient(135deg, #facc15, #60a5fa);
    box-shadow: 0 10px 18px rgba(15,23,42,.2);
    animation: chutePulse .52s ease-in-out infinite alternate;
}

.machine-chute span:nth-child(2) {
    background: linear-gradient(135deg, #fb7185, #34d399);
    animation-delay: -.16s;
}

.machine-chute span:nth-child(3) {
    background: linear-gradient(135deg, #60a5fa, #facc15);
    animation-delay: -.32s;
}

.machine-caption {
    display: grid;
    gap: 4px;
}

@keyframes machineBowlShake {
    0% { transform: rotate(-1deg) translate3d(-1px, 0, 0); }
    100% { transform: rotate(1.4deg) translate3d(1px, -1px, 0); }
}

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

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

@keyframes ballWhirl {
    0% {
        transform: translate(-50%, -50%) translate3d(var(--x1), var(--y1), 0) rotate(0deg) scale(.88);
        filter: blur(1.2px);
    }
    22% {
        transform: translate(-50%, -50%) translate3d(var(--x2), var(--y2), 0) rotate(140deg) scale(1.08);
        filter: blur(.2px);
    }
    48% {
        transform: translate(-50%, -50%) translate3d(var(--x3), var(--y3), 0) rotate(280deg) scale(.96);
        filter: blur(1px);
    }
    73% {
        transform: translate(-50%, -50%) translate3d(var(--x4), var(--y4), 0) rotate(430deg) scale(1.1);
        filter: blur(.1px);
    }
    100% {
        transform: translate(-50%, -50%) translate3d(var(--x1), var(--y1), 0) rotate(560deg) scale(.9);
        filter: blur(1.1px);
    }
}

@keyframes chutePulse {
    from { transform: translate3d(-8px, 2px, 0) scale(.78); opacity: .55; }
    to { transform: translate3d(8px, -3px, 0) scale(1.08); opacity: 1; }
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0,0,0,0.62);
}

.modal-backdrop.is-open {
    display: flex;
}

.modal-card {
    width: min(560px, 100%);
    max-height: min(86vh, 760px);
    overflow: auto;
    padding: 18px;
}

.confetti {
    animation: flashWin 900ms ease-in-out 2;
}

@keyframes flashWin {
    0% { box-shadow: 0 0 0 rgba(251, 191, 36, 0); }
    50% { box-shadow: 0 0 40px rgba(251, 191, 36, 0.5); }
    100% { box-shadow: 0 0 0 rgba(251, 191, 36, 0); }
}

canvas {
    max-width: 100%;
}

@media (max-width: 920px) {
    .site-header {
        align-items: flex-start;
    }

    .mobile-nav-button {
        display: inline-flex;
    }

    .site-nav {
        position: absolute;
        top: 58px;
        right: 0;
        display: none;
        flex-direction: column;
        width: min(196px, calc(100vw - 136px));
        max-width: 196px;
        gap: 4px;
        padding: 6px;
        z-index: 80;
        background: var(--mobile-nav-bg);
        border-color: var(--line);
        box-shadow: 0 18px 48px var(--shadow);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .theme-switch span {
        display: none;
    }

    .draw-range {
        justify-content: stretch;
        width: 100%;
    }

    .number-stepper {
        flex: 1;
        grid-template-columns: minmax(0, 1fr) 30px;
    }

    .ball-row {
        flex-wrap: nowrap;
        gap: clamp(4px, 1.35vw, 7px);
        min-width: 0;
    }

    .ball-row.has-bonus {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: clamp(3px, 1vw, 5px);
        width: 100%;
        max-width: 100%;
        align-items: center;
    }

    .ball {
        width: clamp(30px, 8.7vw, 36px);
        height: clamp(30px, 8.7vw, 36px);
        font-size: clamp(13px, 3.8vw, 16px);
        flex: 0 0 auto;
    }

    .ball-row.has-bonus .ball {
        width: min(100%, 34px);
        height: auto;
        aspect-ratio: 1;
        justify-self: center;
        font-size: clamp(12px, 3.45vw, 15px);
    }

    .ball.sm {
        width: clamp(26px, 7.4vw, 30px);
        height: clamp(26px, 7.4vw, 30px);
        font-size: 12px;
    }

    .draw-picker {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        max-width: none;
        gap: 8px;
        align-items: end;
    }

    .draw-picker .number-stepper {
        min-width: 0;
        margin-bottom: 0;
    }

    .draw-picker .btn {
        min-width: 76px;
    }

    .recommend-tabs {
        display: grid;
        grid-template-columns: 1fr;
    }

    .keyword-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .keyword-card {
        min-height: 40px;
        padding: 0 13px;
        font-size: 14px;
    }

    #dreamResults .result-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .share-panel {
        display: grid;
        grid-template-columns: 1fr;
    }

    .share-actions {
        justify-content: stretch;
    }

    .share-actions .btn {
        flex: 1 1 96px;
        min-width: 0;
        padding-inline: 8px;
    }

    .lotto-machine {
        min-height: 310px;
        padding: 10px;
    }

    .machine-stage {
        width: min(286px, 72vw);
        height: min(286px, 72vw);
    }

    .machine-drum {
        width: min(252px, 66vw);
        border-width: 6px;
    }

    .machine-ball {
        width: min(var(--size, 34px), 34px);
        height: min(var(--size, 34px), 34px);
        font-size: 13px;
    }

    .machine-chute {
        right: 17%;
        bottom: 38px;
    }

    .machine-chute span {
        width: 18px;
        height: 18px;
    }

    .stats-panel .panel-title {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .stats-panel .panel-title h2 {
        line-height: 1.22;
    }

    .stats-panel .draw-range {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 10px;
        align-items: start;
    }

    .stats-panel .number-stepper {
        width: 100%;
        min-width: 0;
        flex: none;
        grid-template-columns: minmax(0, 1fr) 34px;
        margin-bottom: 10px;
    }

    .stats-panel .number-stepper input {
        min-height: 52px;
        padding-left: 12px;
        padding-right: 42px;
        font-size: 18px;
    }

    .stats-panel .number-stepper span {
        left: 0;
        right: 0;
        bottom: -20px;
        text-align: center;
        font-size: 12px;
    }

    .stats-panel .step-buttons {
        width: 30px;
    }

    .stats-panel .draw-range .btn-primary {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 48px;
        justify-content: center;
    }

    .stats-panel .range-hint {
        margin: 4px 0 14px;
        text-align: left;
        font-size: 13px;
        line-height: 1.55;
    }

    .site-nav.is-open {
        display: flex;
    }

    .nav-link {
        justify-content: flex-start;
        min-height: 42px;
        padding: 9px 12px;
        color: var(--text);
    }

    .nav-item {
        display: block;
        width: 100%;
    }

    .nav-menu-button {
        width: 100%;
    }

    .nav-submenu {
        position: static;
        min-width: 0;
        width: 100%;
        margin-top: 4px;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.04);
    }

    .nav-sub-link {
        min-height: 38px;
        padding-left: 14px;
        font-size: 13px;
    }

    .section-grid,
    .store-filter-grid {
        grid-template-columns: 1fr;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .span-4,
    .span-5,
    .span-6,
    .span-7,
    .span-8,
    .span-12 {
        grid-column: span 1;
    }

    .rank-row {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .rank-row > strong {
        grid-column: 2;
    }

    .store-filter-panel .panel-title {
        display: block;
    }

    .store-mode-tabs {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        width: 100%;
    }

    .store-filter-panel .panel-title h2 {
        margin-bottom: 10px;
        font-size: 17px;
        line-height: 1.25;
    }

    .store-mode-tabs .btn {
        flex: 1 1 0;
        min-width: 0;
        min-height: 38px;
        padding: 0 5px;
        gap: 4px;
        white-space: nowrap;
        font-size: 12px;
        border-radius: 8px;
    }

    .store-mode-tabs .btn svg {
        width: 14px;
        height: 14px;
        flex: 0 0 14px;
    }

    .store-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .store-filter-grid .btn-primary {
        grid-column: 1 / -1;
    }

    .store-rank-list .rank-row {
        grid-template-columns: 34px minmax(0, 1fr) auto;
        gap: 8px;
        padding: 10px;
    }

    .store-rank-list .rank-badge {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .store-rank-list .rank-row > strong {
        grid-column: auto;
        white-space: nowrap;
        font-size: 14px;
    }
}

@media (max-width: 420px) {
    .stats-panel .draw-range {
        grid-template-columns: 1fr;
    }

    .stats-panel .draw-range .btn-primary {
        grid-column: auto;
    }

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

    .store-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .store-mode-tabs {
        gap: 4px;
    }

    .store-mode-tabs .btn {
        min-height: 36px;
        padding: 0 4px;
        gap: 3px;
        font-size: 11px;
    }

    .store-mode-tabs .btn svg {
        width: 13px;
        height: 13px;
        flex-basis: 13px;
    }

    .ball-row.has-bonus {
        gap: 3px;
    }

    .ball-row.has-bonus .ball {
        width: min(100%, 31px);
        font-size: 12px;
    }

    .site-nav {
        width: min(188px, calc(100vw - 124px));
        max-width: 188px;
    }

    .ad-placeholder {
        min-height: 150px;
        padding: 18px;
    }

    .ad-placeholder strong {
        font-size: 18px;
    }
}


/* Lotto board */
.board-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin: 14px 0 16px;
}

.board-page-head h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.05;
}

.board-page-head p {
    margin: 8px 0 0;
    line-height: 1.55;
}

.board-page-actions,
.board-compose-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.board-compose[hidden] {
    display: none !important;
}

#boardWriteToggle.is-active {
    background: rgba(251, 113, 133, 0.18);
    color: #fecdd3;
    border-color: rgba(251, 113, 133, 0.38);
}

html[data-theme="light"] #boardWriteToggle.is-active {
    color: #be123c;
}

.board-shell {
    display: grid;
    gap: 16px;
}

.board-channel-list {
    display: grid;
    gap: 10px;
}

.board-channel-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 78px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    backdrop-filter: blur(18px);
}

.board-channel-card:hover,
.board-channel-card.is-active {
    border-color: rgba(45, 212, 191, 0.62);
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.18), rgba(96, 165, 250, 0.12)), var(--panel-strong);
}

.board-channel-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 24px;
    flex: 0 0 auto;
}

.board-channel-card b,
.board-channel-card small {
    display: block;
}

.board-channel-card b {
    font-size: 18px;
}

.board-channel-card small {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.45;
}

.board-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.board-captcha-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 8px;
}

.board-textarea {
    min-height: 138px;
    padding-top: 12px;
    resize: vertical;
    line-height: 1.65;
}

.board-file-input {
    padding-top: 9px;
}

.board-image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.board-preview-item {
    position: relative;
    width: 96px;
    height: 96px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--row-bg);
}

.board-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.board-preview-remove {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.board-submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.board-feed {
    display: grid;
    gap: 14px;
}

.board-post-card {
    padding: 16px;
}

.board-post-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.board-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.9), rgba(96, 165, 250, 0.86));
    color: #031322;
    font-weight: 900;
    flex: 0 0 auto;
}

.board-post-meta {
    display: grid;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}

.board-post-meta strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-post-meta span {
    color: var(--muted);
    font-size: 12px;
}

.board-post-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.board-post-actions .btn {
    min-height: 34px;
    padding: 0 9px;
    font-size: 12px;
}

.board-post-actions svg {
    width: 14px;
    height: 14px;
}

.board-post-content {
    margin-top: 14px;
    color: var(--text);
    line-height: 1.72;
    word-break: break-word;
    white-space: normal;
}

.board-post-images {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.board-post-images-1 {
    grid-template-columns: minmax(0, 1fr);
}

.board-post-images-2,
.board-post-images-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.board-post-image {
    display: block;
    width: 100%;
    overflow: hidden;
    border: 0;
    border-radius: 8px;
    background: var(--row-bg);
    padding: 0;
    cursor: zoom-in;
}

.board-post-images-1 .board-post-image {
    max-height: 520px;
}

.board-post-images-2 .board-post-image,
.board-post-images-3 .board-post-image {
    height: 220px;
}

.board-post-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.board-sentinel,
.board-empty {
    padding: 16px;
    text-align: center;
}

.board-image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.78);
    cursor: zoom-out;
}

.board-image-lightbox.is-open {
    display: flex;
}

.board-image-lightbox img {
    max-width: min(96vw, 1100px);
    max-height: 92vh;
    border-radius: 10px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    object-fit: contain;
}

@media (max-width: 920px) {
    .board-page-head {
        display: grid;
        align-items: stretch;
    }

    .board-page-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .board-page-actions .btn {
        width: 100%;
    }

    .board-form-grid {
        grid-template-columns: 1fr;
    }

    .board-submit-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .board-submit-row .btn {
        width: 100%;
    }

    .board-compose-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .board-post-head {
        align-items: flex-start;
    }

    .board-post-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, auto));
    }

    .board-post-actions .btn span,
    .board-post-actions .btn:not(.btn-danger) {
        white-space: nowrap;
    }

    .board-post-images-2,
    .board-post-images-3 {
        grid-template-columns: 1fr;
    }

    .board-post-images-2 .board-post-image,
    .board-post-images-3 .board-post-image {
        height: auto;
        max-height: 420px;
    }

    .board-post-image img {
        height: auto;
        max-height: 420px;
        object-fit: contain;
    }
}

@media (max-width: 420px) {
    .board-channel-card {
        padding: 13px;
    }

    .board-channel-icon {
        width: 40px;
        height: 40px;
        font-size: 21px;
    }

    .board-post-card {
        padding: 13px;
    }

    .board-post-head {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .board-post-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .board-post-actions .btn {
        flex: 1 1 0;
    }
}

/* Lotto board v4: lighter action menu, hearts, comments */
.board-post-actions {
    flex: 0 0 auto;
    gap: 4px;
}

.board-mini-action {
    min-height: 28px !important;
    width: auto;
    padding: 0 7px !important;
    border-radius: 999px !important;
    font-size: 11px !important;
    opacity: 0.82;
}

.board-mini-action svg {
    width: 13px !important;
    height: 13px !important;
}

.board-mini-action:hover {
    opacity: 1;
}

.board-post-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .board-post-tools {
    border-top-color: rgba(15, 23, 42, 0.08);
}

.board-tool {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.board-tool:hover,
.board-tool.is-liked {
    color: var(--brand-text);
    background: var(--nav-hover);
}

.board-like.is-liked {
    border-color: rgba(251, 113, 133, 0.48);
    color: #fecdd3;
}

html[data-theme="light"] .board-like.is-liked {
    color: #be123c;
}

.board-heart {
    font-size: 15px;
    line-height: 1;
}

.board-comments {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.board-comments-list {
    display: grid;
    gap: 6px;
}

.board-comment {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px;
    align-items: start;
    gap: 6px;
    padding: 8px 9px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.055);
}

html[data-theme="light"] .board-comment {
    background: rgba(15, 23, 42, 0.045);
}

.board-comment-body {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px 7px;
    min-width: 0;
    line-height: 1.45;
}

.board-comment-body b {
    font-size: 12px;
    white-space: nowrap;
}

.board-comment-body span {
    font-size: 13px;
    word-break: break-word;
}

.board-comment-body small {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.board-comment-delete {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.board-comment-delete:hover {
    background: rgba(251, 113, 133, 0.14);
    color: #fecdd3;
}

html[data-theme="light"] .board-comment-delete:hover {
    color: #be123c;
}

.board-comment-empty {
    padding: 4px 2px;
    font-size: 12px;
}

.board-comment-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
}

.board-comment-input {
    min-height: 36px;
    border-radius: 999px;
    font-size: 13px;
}

.board-comment-submit {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
}

@media (max-width: 920px) {
    .board-post-head {
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr) auto;
        gap: 9px;
        align-items: center;
    }

    .board-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .board-post-actions {
        display: flex !important;
        grid-column: auto !important;
        gap: 3px;
    }

    .board-mini-action {
        width: 30px !important;
        height: 30px !important;
        min-height: 30px !important;
        padding: 0 !important;
        justify-content: center;
    }

    .board-mini-action span {
        display: none;
    }

    .board-post-content {
        margin-top: 10px;
        font-size: 14px;
        line-height: 1.62;
    }

    .board-post-tools {
        gap: 6px;
        margin-top: 10px;
    }

    .board-tool {
        min-height: 29px;
        padding: 0 9px;
        font-size: 12px;
    }

    .board-comments {
        gap: 7px;
    }

    .board-comment {
        padding: 7px 8px;
    }

    .board-comment-form {
        grid-template-columns: minmax(0, 1fr) 54px;
    }

    .board-comment-submit {
        padding: 0 8px;
    }
}

@media (max-width: 420px) {
    .board-post-head {
        grid-template-columns: 34px minmax(0, 1fr) auto !important;
    }

    .board-avatar {
        width: 32px;
        height: 32px;
    }

    .board-post-actions {
        grid-column: auto !important;
        justify-content: flex-end !important;
    }

    .board-mini-action {
        width: 28px !important;
        height: 28px !important;
        min-height: 28px !important;
    }

    .board-post-meta span {
        font-size: 11px;
    }

    .board-comment-body span {
        width: 100%;
    }
}

/* Lotto board v5: 1000 chars, 5-line preview, auto links, YouTube embeds */
.board-post-content {
    margin-top: 14px;
    color: var(--text);
    word-break: break-word;
}

.board-post-text {
    line-height: 1.72;
    white-space: normal;
    overflow-wrap: anywhere;
}

.board-post-content.is-collapsed .board-post-text {
    max-height: calc(1.72em * 5);
    overflow: hidden;
}

.board-more-button {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--teal);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.board-more-button:hover {
    text-decoration: underline;
}

.board-more-button[hidden] {
    display: none !important;
}

.board-auto-link {
    color: var(--blue);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
}

.board-embed-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.board-youtube-frame {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
    aspect-ratio: 16 / 9;
}

.board-youtube-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 920px) {
    .board-post-content {
        margin-top: 10px;
        font-size: 14px;
    }

    .board-post-text {
        line-height: 1.62;
    }

    .board-post-content.is-collapsed .board-post-text {
        max-height: calc(1.62em * 5);
    }

    .board-youtube-frame {
        border-radius: 8px;
    }
}


/* Lotto board v10: safe rich HTML preview, inline images/videos like a light board skin */
.board-post-content.is-rich-html .board-post-text {
    white-space: normal;
}

.board-post-text p,
.board-post-text div {
    margin: 0 0 10px;
}

.board-post-text p:last-child,
.board-post-text div:last-child {
    margin-bottom: 0;
}

.board-post-text strong,
.board-post-text b {
    font-weight: 900;
}

.board-post-text blockquote {
    margin: 10px 0;
    padding: 10px 12px;
    border-left: 3px solid var(--teal);
    border-radius: 8px;
    background: rgba(45, 212, 191, 0.08);
    color: var(--muted);
}

.board-post-text ul,
.board-post-text ol {
    margin: 8px 0 8px 20px;
    padding: 0;
}

.board-post-text img,
.board-post-text video {
    display: block;
    max-width: min(100%, 720px);
    height: auto;
    margin: 10px 0;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--row-bg);
}

.board-post-text iframe {
    display: block;
    width: min(100%, 720px);
    aspect-ratio: 16 / 9;
    height: auto;
    margin: 10px 0;
    border: 0;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
}

.board-post-text hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 12px 0;
}

@media (max-width: 920px) {
    .board-post-text img,
    .board-post-text video,
    .board-post-text iframe {
        max-width: 100%;
        margin: 8px 0;
        border-radius: 10px;
    }
}
