:root {
  --bg: #07090d;
  --panel: #0f141c;
  --panel2: #0b0f16;
  --border: #1c2431;
  --text: #e7ebf2;
  --muted: #93a0b4;
  --muted2: #5b6472;
  --muted3: #4d5563;
  --accent: #6c8cff;
  --accent-soft: #8aa0ff;
  --purple: #b57be6;
  --up: #26a69a;
  --up-bright: #3fe0c8;
  --down: #ef5350;
  --down-bright: #ff8a87;
  --amber: #e8b23c;
  --amber-bright: #f0c96a;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.hidden { display: none !important; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sellPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(38,166,154,.55), 0 10px 30px rgba(0,0,0,.5); } 50% { box-shadow: 0 0 0 12px rgba(38,166,154,0), 0 10px 30px rgba(0,0,0,.5); } }
@keyframes lineBlink { 0%,100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes dashRun { to { stroke-dashoffset: -320; } }
@keyframes softGlow { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

#app {
  min-height: 100vh;
  background: radial-gradient(120% 80% at 50% -10%, #10151e 0%, #07090d 60%);
  display: flex;
  justify-content: center;
  padding: 0 0 40px;
}
.shell {
  width: 100%;
  max-width: 540px;
  min-height: 100vh;
  padding: 16px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 2px; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, var(--accent), var(--purple)); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: #0b0e13; }
.brand-text { line-height: 1; }
.brand-name { font-weight: 800; font-size: 14px; letter-spacing: .14em; }
.brand-sub { font-size: 9px; color: var(--muted2); letter-spacing: .28em; margin-top: 3px; }
.progress { display: flex; align-items: center; gap: 6px; }
.round-dots { display: flex; align-items: center; gap: 6px; }
.round-dots span { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--border); transition: background .3s; }
.round-dots span.done { background: #3a4454; }
.round-dots span.now { background: var(--accent); }
.round-label { font-size: 11px; color: var(--muted2); margin-left: 4px; }

.screen { display: none; }
.screen.active { display: block; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 20px 20px 10px; position: relative; overflow: hidden; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 15px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 9px; }

/* INTRO */
.intro-wrap { animation: fadeIn .5s ease; display: flex; flex-direction: column; gap: 20px; padding-top: 6px; }
.intro-tag { font-size: 10px; color: var(--accent); letter-spacing: .2em; font-weight: 700; }
.intro-title { text-align: center; padding: 0 6px; }
.intro-title h1 { font-size: 30px; line-height: 1.24; font-weight: 800; margin: 0; letter-spacing: -.02em; text-wrap: balance; }
.intro-title p { color: var(--muted); font-size: 14px; margin: 12px 0 0; line-height: 1.6; }
.intro-title .en { color: var(--muted3); font-size: 11px; margin: 8px 0 0; letter-spacing: .02em; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.step-title { font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.step-en { display: block; font-size: 9px; color: var(--muted3); font-weight: 500; margin-top: 3px; }
.market-pick { display: flex; gap: 8px; }
.market-btn { flex: 1; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: rgba(147,160,180,.08); color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; transition: all .15s; }
.market-btn.sel { border-color: rgba(108,140,255,.5); background: rgba(108,140,255,.16); color: var(--text); }
.market-btn .sub { display: block; font-size: 9.5px; color: var(--muted3); font-weight: 500; margin-top: 2px; }
.market-btn.sel .sub { color: var(--muted); }

.btn { display: block; width: 100%; padding: 17px; border: none; border-radius: 14px; font-size: 16px; font-weight: 800; cursor: pointer; letter-spacing: .01em; }
.btn:hover { filter: brightness(1.05); }
.btn:disabled { cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--up), #2bb7a8); color: #04120f; }
.btn-blue { background: linear-gradient(135deg, var(--accent), var(--accent-soft)); color: #08102b; }
.btn-purple { background: linear-gradient(135deg, var(--purple), #c79cf0); color: #170a24; }
.btn-amber { background: linear-gradient(135deg, var(--amber), var(--amber-bright)); color: #1a1204; }
.btn-ghost { background: #131922; color: var(--text); border: 1px solid #2a323f; }
.btn-flat { background: #2a323f; color: var(--muted2); }
.hint { text-align: center; color: #3c434f; font-size: 11px; margin-top: -6px; line-height: 1.6; }

/* CHART */
.chart-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; padding: 0 2px; }
.chart-title { font-size: 13px; font-weight: 700; color: #c7cfdb; }
.chart-meta { font-size: 11px; color: var(--muted2); }
.chart-card { background: var(--panel2); border: 1px solid var(--border); border-radius: 16px; padding: 10px 8px 8px; position: relative; }
#chart-svg { width: 100%; aspect-ratio: 640/240; display: block; touch-action: none; user-select: none; }
.live-pnl { position: absolute; top: 14px; left: 14px; background: rgba(7,9,13,.72); border: 1px solid #232a36; border-radius: 10px; padding: 6px 11px; }
.live-pnl .lbl { font-size: 10px; color: var(--muted); }
.live-pnl .val { font-size: 20px; font-weight: 800; margin-left: 7px; }

.panel { text-align: center; margin-top: 14px; }
.panel-inner { animation: fadeIn .35s ease; display: flex; flex-direction: column; gap: 14px; }
.panel-title { font-size: 19px; font-weight: 800; }
.panel-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.panel-sub .en { color: var(--muted3); }

/* CONVICTION */
.conv-row { display: flex; align-items: flex-end; gap: 6px; margin-top: 2px; }
.conv-btn { position: relative; flex: 1; border: 1px solid #2a323f; border-radius: 12px; background: rgba(147,160,180,.14); color: #aeb8c6; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.conv-btn .lv0 { font-size: 12px; font-weight: 700; }
.conv-btn .lv-sub { font-size: 7.5px; opacity: .75; }
.conv-btn.sel::after { content: ""; position: absolute; inset: -3px; border: 2.5px solid #fff; border-radius: 14px; }
.conv-btn[data-lv="0"] { height: 44px; }
.conv-btn[data-lv="1"] { height: 50px; border-color: rgba(38,166,154,.28); background: rgba(38,166,154,.2); color: #a7e6dd; }
.conv-btn[data-lv="2"] { height: 56px; border-color: rgba(38,166,154,.42); background: rgba(38,166,154,.42); color: #e0faf4; }
.conv-btn[data-lv="3"] { height: 62px; border-color: rgba(38,166,154,.6); background: rgba(38,166,154,.68); color: #062018; font-weight: 800; }
.conv-btn[data-lv="4"] { height: 68px; border-color: rgba(38,166,154,.75); background: rgba(38,166,154,.95); color: #04120f; font-weight: 800; }

/* DRAW */
.draw-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.draw-stat { background: var(--panel); border: 1px solid var(--border); border-radius: 13px; padding: 12px 8px; text-align: center; }
.draw-stat .lbl { font-size: 10px; color: var(--muted); }
.draw-stat .val { font-size: 19px; font-weight: 800; margin-top: 3px; }
.draw-stat.tp { border-color: rgba(38,166,154,.35); }
.draw-stat.tp .lbl { color: var(--up); }
.draw-stat.tp .val { color: var(--up-bright); }
.draw-stat.sl { border-color: rgba(239,83,80,.35); }
.draw-stat.sl .lbl { color: var(--down); }
.draw-stat.sl .val { color: var(--down-bright); }
.rr-box { display: flex; align-items: center; justify-content: center; gap: 10px; background: linear-gradient(135deg, rgba(232,178,60,.12), rgba(232,178,60,.04)); border: 1px solid rgba(232,178,60,.3); border-radius: 13px; padding: 13px; }
.rr-box .rr-lbl { font-size: 12px; color: var(--amber); font-weight: 700; }
.rr-box .rr-val { font-size: 26px; font-weight: 800; color: var(--amber-bright); }
.rr-box .rr-verdict { font-size: 11px; color: var(--muted); }
.adj-row { display: flex; gap: 8px; }
.adj-box { flex: 1; display: flex; align-items: center; justify-content: space-between; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 6px 8px; }
.adj-box .adj-lbl { font-size: 11px; font-weight: 700; }
.adj-box.sl .adj-lbl { color: var(--down-bright); }
.adj-box.tp .adj-lbl { color: var(--up-bright); }
.adj-btns { display: flex; gap: 6px; }
.adj-btns button { width: 30px; height: 30px; border: 1px solid #2a323f; border-radius: 8px; background: #171c25; color: var(--text); font-size: 16px; cursor: pointer; }

/* SELL */
.sell-note { animation: fadeIn .35s ease; text-align: center; color: var(--muted); font-size: 12.5px; padding: 4px 0 2px; }
.sell-sticky { position: sticky; bottom: 16px; margin-top: 4px; z-index: 20; }
.sell-btn { animation: sellPulse 1.9s ease-in-out infinite; }

/* RESULT */
.result-headline { text-align: center; }
.result-pnl { font-size: 52px; font-weight: 800; line-height: 1; margin-top: 6px; }
.result-quip { font-size: 13.5px; color: #c7cfdb; margin-top: 10px; font-weight: 600; }
.gauge-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 18px 18px 20px; }
.gauge-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.gauge-track { position: relative; height: 16px; margin: 22px 6px 6px; }
.gauge-bg { position: absolute; inset: 0; border-radius: 8px; background: linear-gradient(90deg, rgba(239,83,80,.35), #1c2431 46%, #1c2431 54%, rgba(38,166,154,.35)); }
.gauge-entry-mark { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--muted2); }
.gauge-plan { position: absolute; top: -24px; transform: translateX(-50%); text-align: center; }
.gauge-plan .lbl { font-size: 9px; color: var(--up-bright); font-weight: 700; white-space: nowrap; }
.gauge-plan .bar { width: 2px; height: 26px; background: var(--up); margin: 2px auto 0; }
.gauge-actual { position: absolute; top: 14px; transform: translateX(-50%); text-align: center; }
.gauge-actual .bar { width: 2px; height: 20px; margin: 0 auto; }
.gauge-actual .dot { width: 13px; height: 13px; border-radius: 50%; margin: 1px auto 0; border: 2px solid var(--panel); }
.gauge-actual .lbl { font-size: 10px; font-weight: 800; margin-top: 2px; white-space: nowrap; }
.gauge-foot { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted3); margin-top: 54px; }
.reveal-card { background: rgba(108,140,255,.06); border: 1px solid rgba(108,140,255,.22); border-radius: 13px; padding: 12px 15px; text-align: left; }
.reveal-card .tag { font-size: 10px; color: var(--accent); font-weight: 800; letter-spacing: .04em; }
.reveal-card .fact { font-size: 13px; color: #d7deee; margin-top: 5px; line-height: 1.5; }
.reveal-card .badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 6px; margin-left: 6px; vertical-align: middle; }
.reveal-card .badge.delisted { background: rgba(239,83,80,.18); color: var(--down-bright); }
.reveal-card .badge.crash { background: rgba(232,178,60,.18); color: var(--amber-bright); }

/* REPORT */
.report-head { text-align: center; padding-top: 4px; }
.report-head h2 { font-size: 22px; font-weight: 800; margin: 0; }
.report-head .sub2 { font-size: 13px; color: var(--muted2); font-weight: 600; }
.report-head .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.report-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; }
.report-stat { background: linear-gradient(160deg, #131a24, #0d1219); border: 1px solid #232a36; border-radius: 15px; padding: 16px 8px; text-align: center; }
.report-stat .lbl { font-size: 10px; color: var(--muted); letter-spacing: .02em; }
.report-stat .val { font-size: 30px; font-weight: 800; margin-top: 6px; }
.report-stat .sub { font-size: 8.5px; color: var(--muted3); margin-top: 3px; }
.quad-card { background: var(--panel2); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.quad-card .qtitle { font-size: 12px; font-weight: 700; color: #c7cfdb; margin-bottom: 4px; }
.quad-card .qsub { font-size: 10.5px; color: var(--muted2); margin-bottom: 8px; }
.quad-box { position: relative; width: 100%; aspect-ratio: 1/1; max-width: 300px; margin: 0 auto; }
.quad-grid { position: absolute; inset: 0; border: 1px solid #232a36; border-radius: 12px; overflow: hidden; }
.quad-cell { position: absolute; width: 50%; height: 50%; padding: 9px; font-size: 10px; color: var(--muted2); line-height: 1.4; white-space: nowrap; }
.quad-cell.tl { left: 0; top: 0; display: flex; align-items: flex-start; justify-content: flex-start; }
.quad-cell.tr { right: 0; top: 0; display: flex; align-items: flex-start; justify-content: flex-end; text-align: right; }
.quad-cell.bl { left: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: flex-start; }
.quad-cell.br { right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: flex-end; text-align: right; }
.quad-vline { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: #232a36; }
.quad-hline { position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: #232a36; }
.quad-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: rgba(108,140,255,.35); transform: translate(-50%,-50%); }
.quad-me { position: absolute; transform: translate(-50%,-50%); z-index: 3; }
.quad-me .pt { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid var(--panel2); box-shadow: 0 0 0 4px rgba(108,140,255,.25); }
.quad-me .lbl { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 800; color: var(--accent-soft); white-space: nowrap; }

/* DIAGNOSIS */
.diag-head { text-align: center; padding-top: 2px; }
.diag-head .tag { font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.diag-emoji { font-size: 64px; line-height: 1; margin: 10px 0 6px; }
.diag-name { font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
.diag-en { font-size: 13px; color: #6b7686; margin-top: 3px; font-weight: 600; }
.diag-chips { display: inline-flex; gap: 5px; margin-top: 12px; }
.diag-chip { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; border: 1px solid; background: rgba(255,255,255,.04); }
.diag-oneliner { font-size: 14px; color: #c7cfdb; margin: 14px 8px 0; line-height: 1.6; font-weight: 600; text-wrap: balance; }
.radar-card { background: var(--panel2); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.radar-card .rtitle { font-size: 12px; font-weight: 700; color: #c7cfdb; margin-bottom: 6px; }
.radar-wrap { position: relative; width: 100%; max-width: 320px; margin: 0 auto; }
.radar-wrap svg { width: 100%; aspect-ratio: 1/1; display: block; }
.radar-label { position: absolute; transform: translate(-50%,-50%); text-align: center; pointer-events: none; }
.radar-label .ax { font-size: 10.5px; font-weight: 800; }
.radar-label .pole { font-size: 9px; color: var(--muted); margin-top: 1px; }
.trait-box { display: flex; flex-direction: column; gap: 10px; }
.trait { border-radius: 13px; padding: 13px 15px; }
.trait.strength { background: rgba(38,166,154,.08); border: 1px solid rgba(38,166,154,.25); }
.trait.caution { background: rgba(239,83,80,.08); border: 1px solid rgba(239,83,80,.25); }
.trait .tlbl { font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.trait.strength .tlbl { color: var(--up); }
.trait.caution .tlbl { color: var(--down); }
.trait .tval { font-size: 14px; margin-top: 5px; line-height: 1.5; }
.trait.strength .tval { color: #d7eee9; }
.trait.caution .tval { color: #f2dcdb; }

.share-wrap { margin-top: 4px; }
.share-hint { font-size: 11px; color: var(--muted2); text-align: center; margin-bottom: 10px; }
.share-card { width: 100%; max-width: 360px; margin: 0 auto; aspect-ratio: 1/1; background: radial-gradient(120% 90% at 30% 0%, #16202e, #0a0d13); border: 1px solid #2a3547; border-radius: 22px; padding: 20px; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.share-top { display: flex; justify-content: space-between; align-items: center; }
.share-top .logo { font-size: 10px; font-weight: 800; letter-spacing: .18em; color: var(--accent); }
.share-top .code { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .08em; }
.share-mid { display: flex; align-items: center; gap: 13px; margin-top: 11px; }
.share-mid .emoji { font-size: 40px; line-height: 1; }
.share-mid .name { font-size: 21px; font-weight: 800; line-height: 1.1; }
.share-mid .en { font-size: 11px; color: #6b7686; margin-top: 3px; font-weight: 600; }
.share-quote { font-size: 12px; color: #c7cfdb; margin-top: 9px; line-height: 1.4; font-weight: 600; }
.share-radar { display: flex; align-items: center; justify-content: center; margin: 2px 0; }
.share-radar svg { width: 96px; height: 96px; display: block; }
.share-foot { display: flex; justify-content: space-between; align-items: flex-end; border-top: 1px solid #243040; padding-top: 11px; margin-top: auto; }
.share-foot .lbl { font-size: 9.5px; color: var(--muted); }
.share-foot .val { font-size: 23px; font-weight: 800; line-height: 1; }
.share-foot .val2 { font-size: 15px; font-weight: 800; }

.disclaimer { margin-top: 24px; font-size: .78rem; color: var(--muted2); line-height: 1.5; text-align: center; }
