@import url('https://fonts.googleapis.com/css2?family=Nanum+Gothic:wght@400;700;800&display=swap');

:root {
    --bg-1: #030712;
    --bg-2: #0f172a;
    --panel: rgba(15, 23, 42, 0.9);
    --panel-2: rgba(17, 24, 39, 0.94);
    --line: rgba(255, 255, 255, 0.08);
    --text: #f8fafc;
    --muted: #94a3b8;
    --primary: #22c55e;
    --primary-dark: #052e16;
    --warn: #f59e0b;
    --danger: #ef4444;
    --blue: #60a5fa;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: 'Nanum Gothic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top, #172554 0%, var(--bg-2) 38%, var(--bg-1) 100%);
}
html, body {
  min-height: 100%;
}

body.live-page--space,
.live-page--space {
  background:
    radial-gradient(circle at 20% 20%, rgba(88, 132, 255, 0.10), transparent 26%),
    radial-gradient(circle at 80% 25%, rgba(186, 88, 255, 0.08), transparent 24%),
    radial-gradient(circle at 55% 80%, rgba(54, 205, 255, 0.08), transparent 28%),
    linear-gradient(180deg, #03050d 0%, #060915 38%, #091224 100%);
  color: #eef4ff;
}

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

#space-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.space-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.12) 52%, rgba(0,0,0,0.48) 100%),
    linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0) 25%);
  mix-blend-mode: screen;
  opacity: 0.9;
}

.live-page--space main,
.live-page--space section,
.live-page--space .content,
.live-page--space .live-wrap,
.live-page--space .live-container,
.live-page--space .page-wrap,
.live-page--space .roulette-wrap,
.live-page--space .panel,
.live-page--space .card,
.live-page--space .table-wrap,
.live-page--space .history-wrap,
.live-page--space .status-board {
  position: relative;
  z-index: 1;
}

.live-page--space .panel,
.live-page--space .card,
.live-page--space .table-wrap,
.live-page--space .history-wrap,
.live-page--space .status-board {
  background: rgba(10, 15, 30, 0.60);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 12px 35px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.live-page--space .panel h1,
.live-page--space .panel h2,
.live-page--space .card h1,
.live-page--space .card h2,
.live-page--space .status-board h2,
.live-page--space .history-wrap h2 {
  text-shadow: 0 0 18px rgba(114, 176, 255, 0.22);
}

.live-page--space .roulette-wrap,
.live-page--space .wheel-wrap,
.live-page--space .roulette-panel {
  filter: drop-shadow(0 0 24px rgba(92, 144, 255, 0.18))
          drop-shadow(0 0 50px rgba(180, 88, 255, 0.10));
}

@media (max-width: 768px) {
  .space-vignette {
    opacity: 1;
  }

  .live-page--space .panel,
  .live-page--space .card,
  .live-page--space .table-wrap,
  .live-page--space .history-wrap,
  .live-page--space .status-board {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .space-bg {
    opacity: 0.75;
  }
}

@keyframes twinklePulse {
  0% { opacity: 0.4; }
  100% { opacity: 0.9; }
}

/* 기존 카드/패널이 배경 위에서 잘 보이게 */
.panel,
.card,
.table-wrap,
.content-box,
main,
section {
  position: relative;
  z-index: 1;
}

/* 너무 강하면 카드에 살짝 유리 느낌 */
.glass-panel {
  background: rgba(10, 16, 32, 0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.28);
}

@media (max-width: 768px) {
  .space-nebula {
    filter: blur(10px);
  }

  .star-layer.layer-1 { opacity: 0.8; }
  .star-layer.layer-2 { opacity: 0.55; }
  .star-layer.layer-3 { opacity: 0.3; }
}

a { color: inherit; }
button, input { font: inherit; }

.page {
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px;
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: clamp(1.95rem, 3vw, 2.7rem);
}

.muted { color: var(--muted); }
.small-copy { font-size: 0.94rem; }
.tiny-help { font-size: 0.82rem; margin-top: 8px; }

.stats {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.stat-card,
.card,
.auth-card,
.prize-card,
.toast {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.stat-card {
    min-width: 160px;
    padding: 16px;
    display: grid;
    gap: 10px;
}

.stat-card strong {
    font-size: 2rem;
}

.card {
    padding: 20px;
}

.card h2, .card h3 {
    margin-top: 0;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.span-2 { grid-column: 1 / -1; }

.live-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 20px;
    align-items: start;
}

.live-wheel-card, .live-summary-card, .live-history-card {
    padding: 20px;
}

.wheel-shell {
    position: relative;
    min-height: 430px;
    display: grid;
    place-items: center;
    border-radius: 26px;
    overflow: hidden;
    background: radial-gradient(circle, rgba(30,41,59,0.98) 0%, rgba(2,6,23,0.98) 72%);
    border: 1px solid var(--line);
}

.simple-wheel-shell { min-height: 430px; }

.wheel-ring {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    border: 18px solid rgba(96,165,250,0.22);
    background: conic-gradient(
        from 0deg,
        rgba(96,165,250,.6) 0 45deg,
        rgba(34,197,94,.5) 45deg 90deg,
        rgba(245,158,11,.5) 90deg 135deg,
        rgba(168,85,247,.5) 135deg 180deg,
        rgba(239,68,68,.45) 180deg 225deg,
        rgba(96,165,250,.6) 225deg 270deg,
        rgba(34,197,94,.5) 270deg 315deg,
        rgba(245,158,11,.5) 315deg 360deg
    );
    box-shadow: 0 0 60px rgba(96,165,250,0.18);
}

.wheel-ring::after {
    content: '';
    position: absolute;
    inset: 28px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15,23,42,.97) 0%, rgba(2,6,23,.98) 100%);
}

.wheel-number {
    position: relative;
    z-index: 2;
    font-size: clamp(4rem, 9vw, 5.8rem);
    font-weight: 800;
    letter-spacing: -3px;
}

.pointer {
    position: absolute;
    top: 26px;
    z-index: 3;
    font-size: 2rem;
}

.result-box {
    margin-top: 18px;
    display: grid;
    gap: 12px;
}

.result-row {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.05);
}

.result-actions {
    display: flex;
    justify-content: flex-end;
}

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

.inline-stats, .button-row, .control-stack {
    display: grid;
    gap: 12px;
}

.inline-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

button {
    border: none;
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
    background: var(--primary);
    color: var(--primary-dark);
    transition: transform .12s ease, opacity .12s ease, background .12s ease;
}

button:hover { transform: translateY(-1px); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
button.secondary {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}
button.danger-tone {
    background: rgba(239,68,68,0.18);
    color: #fecaca;
}

input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.09);
    background: rgba(2,6,23,.6);
    color: var(--text);
}

label {
    display: block;
    margin: 0 0 8px;
    color: var(--muted);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.prize-tier-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.prize-tier-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.05);
}

.dynamic-prize-tier-card {
    display: grid;
    gap: 8px;
    align-content: start;
}

.prize-tier-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.prize-tier-card-head h3 {
    margin: 0;
}

.prize-tier-delete-button {
    width: auto;
    padding: 10px 14px;
}

.prize-tier-empty {
    grid-column: 1 / -1;
}

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

.prize-card {
    padding: 16px;
    display: grid;
    gap: 6px;
}

.prize-card small { color: var(--muted); }

.draw-result {
    margin-top: 16px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px dashed rgba(255,255,255,0.1);
    min-height: 62px;
}

.compact-result { min-height: 54px; }
.success-panel {
    background: rgba(34,197,94,0.08);
    border-color: rgba(34,197,94,0.25);
}
.error-panel {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.25);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}
.compact-head { margin-bottom: 16px; }
.stacked-mobile { align-items: flex-start; }

.table-shell {
    display: block;
    overflow-x: auto;
}

.table-grid {
    min-width: 760px;
    display: grid;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    overflow: hidden;
}

.table-grid-recent,
.table-grid-live {
    grid-template-columns: 92px 90px 110px minmax(180px, 1.2fr) 130px 160px;
}

.table-grid-audit {
    grid-template-columns: 160px 120px 120px minmax(180px, 1fr) minmax(280px, 1.5fr) 130px;
}

.table-grid-admins {
    grid-template-columns: 160px 140px 120px 150px 180px;
}

.table-head,
.table-cell {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    border-right: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.025);
}

.table-head {
    font-size: 0.85rem;
    font-weight: 800;
    color: #cbd5e1;
    background: rgba(255,255,255,0.045);
}

.table-cell strong { font-size: 1rem; }
.table-cell-stack { display: grid; gap: 8px; }
.table-cell-long { white-space: normal; line-height: 1.5; }
.table-grid > :nth-last-child(-n + 6) { border-bottom: none; }

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 800;
}

.pill-success { background: rgba(34,197,94,.16); color: #bbf7d0; }
.pill-warn { background: rgba(245,158,11,.16); color: #fde68a; }
.pill-muted { background: rgba(148,163,184,.16); color: #e2e8f0; }

.evidence-block code,
.hash-row code,
.evidence-text {
    display: block;
    word-break: break-all;
    color: #bfdbfe;
}

.mini-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .82rem;
}

.empty-state {
    padding: 22px;
    border-radius: 16px;
    border: 1px dashed rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--muted);
    text-align: center;
}

.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1000;
    max-width: min(92vw, 420px);
    padding: 16px 20px;
}

.toast-win { border-color: rgba(34,197,94,.35); }
.toast-lose { border-color: rgba(245,158,11,.35); }
.hidden { display: none !important; }

.auth-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.auth-card {
    width: min(420px, calc(100vw - 32px));
    padding: 28px;
}

.auth-card form {
    display: grid;
    gap: 12px;
}

.error {
    color: #fecaca;
    background: rgba(127, 29, 29, 0.35);
    padding: 10px 12px;
    border-radius: 10px;
}

.spin-animate {
    animation: ringSpin 1.9s cubic-bezier(.18, .84, .29, 1.02);
}

@keyframes ringSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(1440deg); }
}

@media (max-width: 1120px) {
    .live-layout,
    .admin-grid,
    .prize-tier-grid,
    .form-grid,
    .inline-stats,
    .button-row,
    .prize-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        flex-direction: column;
    }

    .span-2 { grid-column: auto; }
    .result-inline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .page { padding: 16px; }
    .wheel-shell, .simple-wheel-shell { min-height: 340px; }
    .wheel-ring { width: 252px; height: 252px; }
    .result-row { grid-template-columns: 1fr; }
    .section-head { flex-direction: column; }
    .button-row.two-up-mobile,
    .form-grid.single-column-mobile,
    .form-grid,
    .inline-stats,
    .prize-grid,
    .result-inline-grid { grid-template-columns: 1fr; }
    button { width: 100%; }
    .toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }
    .table-grid {
        min-width: 100%;
        display: block;
        border: none;
        background: transparent;
    }
    .table-head { display: none; }
    .table-cell {
        display: block;
        border: 1px solid rgba(255,255,255,0.06);
        border-bottom: none;
        border-right: 1px solid rgba(255,255,255,0.06);
    }
    .table-grid .table-cell:nth-child(6n+1),
    .table-grid-admins .table-cell:nth-child(5n+1),
    .table-grid-audit .table-cell:nth-child(6n+1) {
        border-top-left-radius: 14px;
        border-top-right-radius: 14px;
    }
    .table-grid .table-cell:nth-child(6n),
    .table-grid-admins .table-cell:nth-child(5n),
    .table-grid-audit .table-cell:nth-child(6n) {
        border-bottom: 1px solid rgba(255,255,255,0.06);
        margin-bottom: 12px;
        border-bottom-left-radius: 14px;
        border-bottom-right-radius: 14px;
    }
}

.page-wide {
    max-width: 1480px;
}

.hero-actions {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.compact-actions {
    justify-content: flex-end;
}

.text-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
}

.live-layout-wide {
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
}

.live-history-wide,
.wide-shell {
    width: 100%;
}

.table-grid-recent-wide,
.table-grid-live-wide {
    min-width: 1080px;
    grid-template-columns: 100px 100px 130px minmax(260px, 1.45fr) 150px 190px;
}

.live-prize-grid {
    grid-template-columns: 1fr;
}

.live-prize-card {
    align-items: flex-start;
    gap: 16px;
    padding: 20px 20px 18px;
}

.audit-card-list {
    display: grid;
    gap: 14px;
}

.audit-card {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.07);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.audit-card-top,
.audit-summary-box,
.audit-detail-box {
    margin-bottom: 14px;
}

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

.audit-meta-item,
.audit-summary-box,
.audit-detail-item,
.audit-detail-plain {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(2,6,23,0.46);
    border: 1px solid rgba(255,255,255,0.05);
}

.audit-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--muted);
}

.audit-action-pill {
    min-width: 92px;
}

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

.audit-detail-item strong,
.audit-detail-plain {
    word-break: break-word;
    line-height: 1.55;
}

.sample-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.sample-card {
    display: grid;
    gap: 18px;
}

.sample-stage {
    position: relative;
    min-height: 440px;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    background: radial-gradient(circle at 50% 25%, rgba(96,165,250,0.18), rgba(2,6,23,0.98) 62%);
    display: grid;
    place-items: center;
}

.sample-stage-3d::before {
    content: '';
    position: absolute;
    inset: 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
}

.sample-shadow {
    position: absolute;
    width: 330px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,0,0,0.48), transparent 72%);
    transform: translateY(150px) scale(1.1);
}

.sample-wheel-3d,
.parallax-layer {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
}

.sample-wheel-3d {
    transform: perspective(900px) rotateX(16deg);
    background: conic-gradient(from 0deg, rgba(96,165,250,.95), rgba(34,197,94,.92), rgba(245,158,11,.9), rgba(168,85,247,.95), rgba(96,165,250,.95));
    box-shadow: 0 32px 50px rgba(0,0,0,0.32), inset 0 8px 30px rgba(255,255,255,0.12);
}

.sample-wheel-3d-inner {
    position: absolute;
    inset: 34px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15,23,42,0.98), rgba(2,6,23,1));
    border: 12px solid rgba(255,255,255,0.08);
}

.sample-wheel-number {
    position: relative;
    z-index: 3;
    font-size: clamp(3.2rem, 7vw, 5rem);
    font-weight: 800;
    letter-spacing: -2px;
}

.sample-pointer {
    position: absolute;
    top: 26px;
    z-index: 4;
    font-size: 2rem;
}

.sample-stage-parallax .back {
    background: radial-gradient(circle, rgba(96,165,250,0.45), rgba(96,165,250,0.02) 70%);
    transform: scale(1.18) translateY(-8px);
    filter: blur(12px);
}

.sample-stage-parallax .middle {
    background: conic-gradient(from 0deg, rgba(96,165,250,.6), rgba(34,197,94,.6), rgba(245,158,11,.6), rgba(96,165,250,.6));
    border: 18px solid rgba(255,255,255,0.12);
    box-shadow: 0 0 60px rgba(96,165,250,0.2);
    animation: slowSpin 12s linear infinite;
}

.sample-stage-parallax .front {
    inset: auto;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(2,6,23,0.98), rgba(15,23,42,1));
    border: 10px solid rgba(255,255,255,0.08);
    transform: translateZ(10px);
}

.sample-wheel-number.neon {
    text-shadow: 0 0 14px rgba(96,165,250,0.65), 0 0 32px rgba(96,165,250,0.32);
}

@keyframes slowSpin {
    0% { transform: rotate(0deg) scale(1); }
    100% { transform: rotate(360deg) scale(1); }
}

@media (max-width: 1120px) {
    .audit-meta-group,
    .audit-detail-grid,
    .sample-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .page-wide {
        max-width: 100%;
    }

    .hero-actions,
    .compact-actions {
        width: 100%;
        justify-content: stretch;
        flex-direction: column;
    }

    .text-link-button {
        width: 100%;
    }

    .table-grid-recent-wide,
    .table-grid-live-wide {
        min-width: 100%;
    }

    .audit-card {
        padding: 14px;
    }

    .sample-stage {
        min-height: 340px;
    }

    .sample-wheel-3d,
    .parallax-layer {
        width: 250px;
        height: 250px;
    }

    .sample-stage-parallax .front {
        width: 190px;
        height: 190px;
    }
}

/* ===== UI update 4 overrides ===== */
.parallax-wheel-shell {
    --tilt-x: 0deg;
    --tilt-y: 0deg;
    --parallax-x: 0px;
    --parallax-y: 0px;
    --wheel-far-glow: rgba(96,165,250,0.22);
    --wheel-far-glow-2: rgba(168,85,247,0.12);
    --wheel-mid-1: rgba(96,165,250,.25);
    --wheel-mid-2: rgba(34,197,94,.22);
    --wheel-mid-3: rgba(245,158,11,.22);
    --wheel-mid-4: rgba(168,85,247,.24);
    --wheel-core-1: rgba(96,165,250,.92);
    --wheel-core-2: rgba(34,197,94,.9);
    --wheel-core-3: rgba(245,158,11,.9);
    --wheel-core-4: rgba(168,85,247,.92);
    --wheel-core-5: rgba(239,68,68,.84);
    --wheel-core-border: rgba(96,165,250,0.18);
    --wheel-number-glow-1: rgba(96,165,250,0.52);
    --wheel-number-glow-2: rgba(96,165,250,0.20);
    --wheel-shell-aura-1: rgba(96,165,250,0.26);
    --wheel-shell-aura-2: rgba(168,85,247,0.14);
    perspective: 1100px;
    isolation: isolate;
    transition: filter .45s ease, transform .25s ease;
}

.parallax-wheel-shell::before {
    content: '';
    position: absolute;
    inset: 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.parallax-wheel-shell::after {
    content: '';
    position: absolute;
    inset: 34px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--wheel-shell-aura-1) 0%, var(--wheel-shell-aura-2) 35%, rgba(0,0,0,0) 72%);
    filter: blur(18px);
    transform: translate(calc(var(--parallax-x) * 0.18), calc(var(--parallax-y) * 0.18));
    opacity: .95;
    transition: opacity .35s ease, transform .25s ease, filter .35s ease;
    z-index: 0;
}

.parallax-wheel-shell.outcome-flash::after {
    opacity: 1;
    filter: blur(22px) saturate(1.12);
}

.parallax-wheel-shell.rank-first::after {
    inset: 18px;
    filter: blur(26px) saturate(1.2);
}

.wheel-parallax-bg {
    position: absolute;
    border-radius: 50%;
    transition: transform .22s ease-out;
}

.wheel-parallax-far {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, var(--wheel-far-glow), rgba(255,255,255,0.04) 34%, var(--wheel-far-glow-2) 58%, rgba(0,0,0,0) 74%);
    filter: blur(18px);
    transform: translate(calc(var(--parallax-x) * -0.25), calc(var(--parallax-y) * -0.25));
}

.wheel-parallax-mid {
    width: 360px;
    height: 360px;
    border: 14px solid rgba(255,255,255,0.06);
    background: conic-gradient(from 0deg, var(--wheel-mid-1), var(--wheel-mid-2), var(--wheel-mid-3), var(--wheel-mid-4), var(--wheel-mid-1));
    box-shadow: 0 24px 40px rgba(0,0,0,0.28);
    transform: translate(calc(var(--parallax-x) * 0.35), calc(var(--parallax-y) * 0.35)) rotateX(var(--tilt-y)) rotateY(var(--tilt-x));
}

.parallax-ring {
    border: none;
    background: none;
    box-shadow: none;
    transform-style: preserve-3d;
    transition: transform .22s ease-out;
    transform: rotateX(var(--tilt-y)) rotateY(var(--tilt-x));
}

.wheel-ring-core {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 18px solid var(--wheel-core-border);
    background: conic-gradient(
        from 0deg,
        var(--wheel-core-1) 0 42deg,
        var(--wheel-core-2) 42deg 88deg,
        var(--wheel-core-3) 88deg 135deg,
        var(--wheel-core-4) 135deg 180deg,
        var(--wheel-core-5) 180deg 225deg,
        var(--wheel-core-1) 225deg 270deg,
        var(--wheel-core-2) 270deg 315deg,
        var(--wheel-core-3) 315deg 360deg
    );
    box-shadow: 0 28px 50px rgba(0,0,0,0.34), inset 0 6px 24px rgba(255,255,255,0.12);
}

.wheel-ring-core::after {
    content: '';
    position: absolute;
    inset: 28px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15,23,42,.97) 0%, rgba(2,6,23,.99) 100%);
    border: 10px solid rgba(255,255,255,0.08);
}


.parallax-wheel-shell.rank-first {
    filter: drop-shadow(0 0 22px rgba(255,214,106,0.28)) drop-shadow(0 0 48px rgba(255,214,106,0.18));
}

.parallax-wheel-shell.rank-second {
    filter: drop-shadow(0 0 18px rgba(168,85,247,0.24)) drop-shadow(0 0 42px rgba(96,165,250,0.16));
}

.parallax-wheel-shell.rank-third {
    filter: drop-shadow(0 0 18px rgba(34,197,94,0.24)) drop-shadow(0 0 40px rgba(96,165,250,0.12));
}

.parallax-wheel-shell.rank-lose {
    filter: drop-shadow(0 0 12px rgba(96,165,250,0.12)) drop-shadow(0 0 24px rgba(59,130,246,0.08));
}

.wheel-ring-gloss {
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.01) 55%);
    mix-blend-mode: screen;
    filter: blur(2px);
}

.parallax-wheel-shell .wheel-number {
    text-shadow: 0 0 16px var(--wheel-number-glow-1), 0 0 34px var(--wheel-number-glow-2);
    position: relative;
    isolation: isolate;
}

.parallax-wheel-shell .wheel-number::after {
    content: attr(data-display);
    position: absolute;
    inset: 0;
    color: transparent;
    pointer-events: none;
    opacity: 0;
}

.parallax-wheel-shell.rank-first .wheel-number,
.parallax-wheel-shell .wheel-number.number-sparkle-gold {
    color: #fff6cf;
    text-shadow:
        0 0 10px rgba(255, 234, 163, 0.98),
        0 0 22px rgba(255, 214, 106, 0.9),
        0 0 46px rgba(255, 182, 52, 0.64),
        0 0 82px rgba(255, 214, 106, 0.34);
    animation: goldNumberSparkle 2.35s ease-in-out infinite;
}

.parallax-wheel-shell.rank-first .wheel-number::after,
.parallax-wheel-shell .wheel-number.number-sparkle-gold::after {
    opacity: 1;
    background: linear-gradient(
        110deg,
        rgba(255,255,255,0) 0%,
        rgba(255,247,203,0.15) 24%,
        rgba(255,255,255,0.96) 42%,
        rgba(255,220,120,0.92) 52%,
        rgba(255,255,255,0.2) 64%,
        rgba(255,255,255,0) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    filter: blur(0.4px);
    animation: goldNumberShimmer 1.35s ease-in-out infinite;
}

@keyframes goldNumberSparkle {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1) saturate(1);
    }
    20% {
        transform: scale(1.03);
        filter: brightness(1.08) saturate(1.08);
    }
    48% {
        transform: scale(1.01);
        filter: brightness(1.22) saturate(1.22);
    }
    62% {
        transform: scale(1.05);
        filter: brightness(1.12) saturate(1.18);
    }
    82% {
        transform: scale(1.015);
        filter: brightness(1.04) saturate(1.08);
    }
}

@keyframes goldNumberShimmer {
    0% {
        transform: translateX(-18%);
        opacity: 0;
    }
    16% {
        opacity: 0.22;
    }
    38% {
        opacity: 0.96;
    }
    62% {
        opacity: 0.42;
    }
    100% {
        transform: translateX(18%);
        opacity: 0;
    }
}

.parallax-wheel-shell .pointer {
    top: 32px;
    text-shadow: 0 10px 16px rgba(0,0,0,.35);
}

.parallax-ring.spin-animate {
    animation: parallaxSpin 2.1s cubic-bezier(.18, .84, .29, 1.02);
}

@keyframes parallaxSpin {
    0% { transform: rotateX(var(--tilt-y)) rotateY(var(--tilt-x)) rotate(0deg); }
    100% { transform: rotateX(var(--tilt-y)) rotateY(var(--tilt-x)) rotate(1620deg); }
}

.table-grid-recent-plus {
    grid-template-columns: 90px 90px 112px minmax(130px, .7fr) minmax(180px, 1fr) 124px 170px;
}

.result-content-cell {
    min-width: 0;
}

.result-content-cell strong {
    display: block;
    margin-bottom: 6px;
}

.memo-cell {
    white-space: normal;
    line-height: 1.55;
}

.result-inline-grid-7 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.live-prize-headline {
    display: grid;
    gap: 10px;
}

.live-prize-rank {
    display: inline-block;
    font-weight: 800;
    font-size: clamp(1.95rem, 3vw, 2.4rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.live-prize-name {
    display: inline-block;
    margin: 0;
    font-size: clamp(2.45rem, 4.6vw, 3.2rem);
    font-weight: 900;
    line-height: 0.96;
    letter-spacing: -0.06em;
    color: #f7fbff;
    background: linear-gradient(180deg, #ffffff 0%, #f4fbff 52%, #d8ffe8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 18px rgba(173, 227, 200, 0.12);
}

.live-prize-foot {
    display: grid;
    gap: 10px;
}

.live-prize-meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    color: #bec8db;
    font-size: 1rem;
    font-weight: 700;
}

.live-prize-meta-text {
    line-height: 1.4;
}

.live-prize-probability {
    color: #7e93b2;
    font-style: normal;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.winner-timeline-block {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.winner-timeline-list {
    display: grid;
    gap: 12px;
}

.winner-timeline-item {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.06);
}

.winner-timeline-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(34,197,94,.16);
    color: #dcfce7;
    font-weight: 800;
    min-height: 56px;
}

.winner-timeline-content {
    display: grid;
    gap: 6px;
}

.audit-card-header-grid {
    display: grid;
    gap: 14px;
}

.audit-main-labels {
    display: grid;
    gap: 10px;
}

.audit-main-summary {
    font-size: 1.06rem;
}

.audit-card {
    position: relative;
    overflow: hidden;
}

.audit-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: rgba(255,255,255,.14);
}

.audit-tone-success::before { background: rgba(34,197,94,.85); }
.audit-tone-danger::before { background: rgba(239,68,68,.85); }
.audit-tone-warning::before { background: rgba(245,158,11,.85); }
.audit-tone-info::before { background: rgba(96,165,250,.85); }
.audit-tone-violet::before { background: rgba(168,85,247,.85); }
.audit-tone-neutral::before { background: rgba(148,163,184,.85); }

.audit-pill-success { background: rgba(34,197,94,.16); color: #bbf7d0; }
.audit-pill-danger { background: rgba(239,68,68,.16); color: #fecaca; }
.audit-pill-warning { background: rgba(245,158,11,.16); color: #fde68a; }
.audit-pill-info { background: rgba(96,165,250,.16); color: #bfdbfe; }
.audit-pill-violet { background: rgba(168,85,247,.16); color: #e9d5ff; }
.audit-pill-neutral { background: rgba(148,163,184,.16); color: #e2e8f0; }

.audit-meta-group {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.audit-detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.audit-detail-item strong {
    display: block;
    min-height: 2.8em;
}

.timeline-head {
    margin-bottom: 12px;
}

@media (max-width: 1120px) {
    .table-grid-recent-plus {
        grid-template-columns: 90px 90px 112px minmax(160px, .85fr) minmax(180px, 1fr) 124px 170px;
    }
    .audit-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .parallax-wheel-shell {
        min-height: 360px;
    }
    .wheel-parallax-far {
        width: 310px;
        height: 310px;
    }
    .wheel-parallax-mid {
        width: 270px;
        height: 270px;
    }
    .parallax-ring,
    .wheel-ring-core {
        width: 252px;
        height: 252px;
    }
    .winner-timeline-item {
        grid-template-columns: 1fr;
    }
    .result-inline-grid-7 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .audit-detail-grid,
    .audit-meta-group {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .table-grid-recent-plus .table-cell:nth-child(7n+1) {
        border-top-left-radius: 14px;
        border-top-right-radius: 14px;
    }
    .table-grid-recent-plus .table-cell:nth-child(7n) {
        border-bottom: 1px solid rgba(255,255,255,0.06);
        margin-bottom: 12px;
        border-bottom-left-radius: 14px;
        border-bottom-right-radius: 14px;
    }
}
@media (max-width: 760px) {
    .table-grid-recent-plus .table-cell {
        border-radius: 0;
        margin-bottom: 0;
    }
}

/* ===== UI update 5 overrides ===== */
.live-layout-wide {
    align-items: start;
}

.live-summary-card {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.live-prize-grid {
    flex: 0 1 auto;
    min-height: 0;
    max-height: min(38vh, 420px);
    overflow: auto;
    padding-right: 6px;
}

.live-prize-grid::-webkit-scrollbar {
    width: 10px;
}

.live-prize-grid::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,.25);
    border-radius: 999px;
}

.winner-timeline-block {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.winner-timeline-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 440px;
    overflow: auto;
    padding-right: 6px;
}

.winner-timeline-list::-webkit-scrollbar {
    width: 10px;
}

.winner-timeline-list::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,.25);
    border-radius: 999px;
}

.table-grid-recent-dynamic {
    grid-template-columns: 88px 86px 112px fit-content(18rem) fit-content(22rem) 118px 168px;
    min-width: 980px;
}

.result-content-cell,
.memo-cell {
    width: fit-content;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    line-height: 1.55;
}

.result-content-cell > div {
    color: var(--text);
}

.compact-empty {
    max-width: 7rem;
}

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

.winner-memo-line {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
}

.winner-manage-grid {
    display: grid;
    gap: 14px;
}

.winner-manage-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.06);
}

.winner-manage-head {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 14px;
}

.winner-manage-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    border-radius: 16px;
    background: rgba(34,197,94,.16);
    color: #dcfce7;
    font-weight: 800;
}

.winner-manage-summary {
    display: grid;
    gap: 6px;
}

.winner-manage-editor {
    display: grid;
    gap: 8px;
}

.winner-manage-editor-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 136px;
    gap: 12px;
    align-items: center;
}

.winner-manage-editor input {
    min-width: 0;
}

@media (max-width: 1120px) {
    .live-summary-card {
        position: static;
        max-height: none;
    }

    .live-prize-grid {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .winner-timeline-list {
        max-height: 360px;
    }

    .table-grid-recent-dynamic {
        grid-template-columns: 88px 86px 112px fit-content(16rem) fit-content(18rem) 118px 168px;
    }
}

@media (max-width: 760px) {
    .live-summary-card {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .live-prize-grid {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .winner-timeline-list {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .winner-manage-head,
    .winner-manage-editor-row {
        grid-template-columns: 1fr;
    }

    .table-grid-recent-dynamic {
        min-width: 100%;
    }
}

/* ===== UI update 6 overrides ===== */
.live-layout-wide {
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
    gap: 16px;
    align-items: start;
}

.live-main-stack {
    min-width: 0;
    display: grid;
    gap: 14px;
    align-content: start;
}

.live-wheel-card,
.live-history-card {
    margin: 0;
}

.live-wheel-card .result-box {
    margin-bottom: 0;
}

.live-history-card {
    margin-top: 0;
}

.table-grid-recent-dynamic {
    grid-template-columns: 88px 86px 112px minmax(7rem, max-content) minmax(7rem, max-content) 118px 168px;
    min-width: 960px;
    align-items: stretch;
}

.result-content-cell,
.memo-cell {
    min-width: 7rem;
    width: auto;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    line-height: 1.55;
}

.memo-cell {
    display: flex;
    align-items: flex-start;
}

.result-content-cell.compact-empty,
.memo-cell.compact-empty,
.winner-memo-line.compact-empty {
    min-width: 7rem;
    max-width: 7rem;
}

.winner-timeline-content strong {
    line-height: 1.4;
}

@media (max-width: 1120px) {
    .live-layout-wide {
        grid-template-columns: 1fr;
    }

    .live-main-stack {
        gap: 12px;
    }

    .table-grid-recent-dynamic {
        grid-template-columns: 88px 86px 112px minmax(7rem, max-content) minmax(7rem, max-content) 118px 168px;
    }
}

@media (max-width: 760px) {
    .live-main-stack {
        gap: 12px;
    }

    .table-grid-recent-dynamic {
        min-width: 100%;
    }

    .result-content-cell,
    .memo-cell,
    .result-content-cell.compact-empty,
    .memo-cell.compact-empty {
        min-width: 0;
        max-width: 100%;
    }
}


/* ===== UI update 7 overrides ===== */
.live-layout-wide {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 20px;
}

.live-main-stack,
.live-wheel-card,
.live-history-card,
.live-summary-card,
.live-history-wide,
.wide-shell,
#recentList,
.table-shell {
    min-width: 0;
}

.live-wheel-card {
    overflow: hidden;
}

.live-wheel-card .wheel-shell {
    min-height: clamp(360px, 40vw, 520px);
}

.live-history-card {
    margin-top: 0;
}

.live-summary-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.result-box {
    gap: 10px;
}

.winner-timeline-list {
    max-height: min(48vh, 560px);
}

@media (max-width: 1320px) {
    .page-wide {
        max-width: 100%;
    }

    .live-layout-wide {
        grid-template-columns: 1fr;
    }

    .live-summary-card {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .winner-timeline-list {
        max-height: 360px;
    }
}

@media (max-width: 900px) {
    .live-layout-wide {
        gap: 14px;
    }

    .wheel-shell {
        min-height: 340px;
    }

    .winner-timeline-list {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }
}

@media (max-width: 760px) {
    .page,
    .page-wide {
        padding: 14px;
    }

    .live-wheel-card,
    .live-history-card,
    .live-summary-card {
        padding: 16px;
    }

    .wheel-shell {
        min-height: 300px;
    }
}


/* ===== live space final patch ===== */
.live-page--space .page,
.live-page--space .hero,
.live-page--space .hero-actions,
.live-page--space .stats,
.live-page--space .stat-card {
    position: relative;
    z-index: 1;
}

.live-page--space .page {
    isolation: isolate;
}

.live-page--space .hero,
.live-page--space .stat-card,
.live-page--space .card,
.live-page--space .prize-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.live-page--space .hero .stat-card {
    background: rgba(11, 16, 31, 0.64);
}

.live-page--space .live-wheel-card .wheel-shell {
    background: radial-gradient(circle, rgba(5,10,24,0.96) 0%, rgba(2,6,23,0.98) 74%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), 0 24px 60px rgba(0,0,0,0.38);
}

.live-page--space .live-wheel-card,
.live-page--space .live-history-card,
.live-page--space .live-summary-card {
    overflow: hidden;
}

.live-page--space .wheel-ring-core {
    box-shadow: 0 28px 50px rgba(0,0,0,0.34), inset 0 6px 24px rgba(255,255,255,0.12), 0 0 38px rgba(96,165,250,0.16);
}

.live-page--space .result-box strong,
.live-page--space .winner-timeline-content strong {
    text-shadow: 0 0 14px rgba(130, 191, 255, 0.16);
}

@media (max-width: 760px) {
    .live-page--space .hero,
    .live-page--space .stat-card,
    .live-page--space .card,
    .live-page--space .prize-card {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .live-prize-card {
        gap: 14px;
        padding: 18px 18px 16px;
    }

    .live-prize-rank {
        font-size: 1.8rem;
    }

    .live-prize-name {
        font-size: clamp(2rem, 9vw, 2.6rem);
    }

    .live-prize-meta {
        gap: 6px;
        font-size: 0.96rem;
    }
}


/* ===== Transparency Variant: LIGHT ===== */
.live-page--space .live-wheel-card,
.live-page--space .live-summary-card,
.live-page--space .live-history-card {
  background: rgba(8, 12, 24, 0.22) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.live-page--space .wheel-shell {
  background: radial-gradient(
    circle,
    rgba(20, 28, 48, 0.28) 0%,
    rgba(4, 8, 20, 0.14) 68%,
    rgba(2, 6, 23, 0.05) 100%
  ) !important;
  border: 1px solid rgba(255,255,255,0.05) !important;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.live-page--space .wheel-ring::after {
  background: radial-gradient(
    circle,
    rgba(15, 23, 42, 0.22) 0%,
    rgba(2, 6, 23, 0.12) 72%,
    rgba(2, 6, 23, 0.06) 100%
  ) !important;
}

.live-page--space .wheel-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.02), transparent 70%);
  pointer-events: none;
}

.live-page--space .result-row {
  background: rgba(255,255,255,0.018) !important;
  border: 1px solid rgba(255,255,255,0.035) !important;
}

.live-page--space .roulette-wrap,
.live-page--space .wheel-wrap,
.live-page--space .roulette-panel {
  filter: drop-shadow(0 0 26px rgba(92, 144, 255, 0.16))
          drop-shadow(0 0 52px rgba(180, 88, 255, 0.11));
}
