:root{
  --bg: #0b0f19;
  --panel: rgba(255,255,255,0.06);
  --panel2: rgba(255,255,255,0.08);
  --stroke: rgba(255,255,255,0.12);
  --text: rgba(255,255,255,0.90);
  --muted: rgba(255,255,255,0.62);
  --muted2: rgba(255,255,255,0.45);
  --good: #2dd4bf;
  --warn: #fbbf24;
  --bad: #fb7185;
  --shadow: 0 20px 60px rgba(0,0,0,0.35);
  --r: 16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans KR", Arial, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--sans);ㅁ:root{
  --bg: #0b0f19;
  --panel: rgba(255,255,255,0.06);
  --stroke: rgba(255,255,255,0.12);
  --text: rgba(255,255,255,0.90);
  --muted: rgba(255,255,255,0.62);
  --muted2: rgba(255,255,255,0.45);
  --shadow: 0 20px 60px rgba(0,0,0,0.35);
  --r: 16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans KR", Arial, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

.mono{ font-family: var(--mono); }
.small{ font-size:12px; }
.sep{ opacity:.45; margin:0 8px; }

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 20px;
  position: sticky;
  top:0;
  z-index:5;
  background: var(--bg);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand{ display:flex; gap:12px; align-items:center; }
.logo{
  width:44px; height:44px;
  border-radius: 14px;
  display:grid; place-items:center;
  font-weight:900;
  letter-spacing:.6px;
  background: linear-gradient(135deg, rgba(45,212,191,.22), rgba(59,130,246,.18));
  border: 1px solid rgba(255,255,255,0.10);
}
.title{ font-weight:800; font-size:16px; }
.subtitle{ font-size:12px; color: var(--muted); margin-top:2px; }

.topbar-actions{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; justify-content:flex-end; }
.pill{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
}
.pill-label{ font-size:12px; color: var(--muted); }

.segmented{
  display:flex;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  overflow:hidden;
}
.seg-btn{
  border:0;
  padding:7px 10px;
  background: transparent;
  color: var(--muted);
  cursor:pointer;
  font-size:12px;
}
.seg-btn.is-active{
  background: rgba(255,255,255,0.10);
  color: var(--text);
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  padding:6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  white-space:nowrap;
}
.badge-ok{
  border-color: rgba(45,212,191,0.45);
  background: rgba(45,212,191,0.12);
}
.badge-warn{
  border-color: rgba(251,191,36,0.50);
  background: rgba(251,191,36,0.12);
}
.badge-bad{
  border-color: rgba(251,113,133,0.55);
  background: rgba(251,113,133,0.12);
}
.badge-ghost{
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}

.btn{
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 12px;
  padding:10px 12px;
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,0.09); }
.btn:active{ transform: translateY(0px); }
.btn[disabled]{ opacity:.55; cursor:not-allowed; transform:none; }

.btn-primary{
  border-color: rgba(45,212,191,0.35);
  background: rgba(45,212,191,0.14);
}
.btn-primary:hover{ background: rgba(45,212,191,0.20); }

.btn-ghost{
  background: transparent;
  border-color: rgba(255,255,255,0.12);
  color: var(--muted);
}

/* =========================
   LAYOUT (온체인 긴 텍스트로 우측패널 확장 방지)
========================= */
.page{
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 16px 22px;
  display:grid;
  grid-template-areas:
    "machine side"
    "log log";
  grid-template-columns: minmax(0, 1fr) 420px; /* 우측 고정폭 */
  gap: 16px;
}
.area-machine{ grid-area: machine; min-width:0; }
.area-side{ grid-area: side; min-width:0; overflow:hidden; }
.area-log{ grid-area: log; min-width:0; }

@media (max-width: 980px){
  .page{
    grid-template-areas:
      "machine"
      "side"
      "log";
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ===== CARD ===== */
.card{
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.card-hd{
  padding: 14px 14px 10px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
}
.card-title{ font-weight:800; }
.card-actions{ display:flex; align-items:center; gap:8px; }

.card-meta{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:flex-start;
  min-width:0;
}
.kv{ display:flex; flex-direction:column; gap:4px; min-width:0; }
.kv .k{ font-size:11px; color: var(--muted2); }
.kv .v{
  font-size:12px;
  color: var(--muted);
  max-width: 520px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  min-width:0;
}

/* ===== MACHINE ===== */
.machine{ padding: 14px; }

.machine-top{
  display:flex;
  justify-content:space-between;
  align-items:stretch;
  gap: 12px;
  min-width:0;
}

.marquee{
  flex: 1;
  display:flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  align-items:center;
  min-width:0;
}
.dot{
  width:10px; height:10px; border-radius:999px;
  background: rgba(255,255,255,0.20);
  animation: blink 1.6s infinite ease-in-out;
}
.dot:nth-child(2){ animation-delay: .1s; }
.dot:nth-child(3){ animation-delay: .2s; }
.dot:nth-child(4){ animation-delay: .3s; }
.dot:nth-child(5){ animation-delay: .4s; }
.dot:nth-child(6){ animation-delay: .5s; }
.dot:nth-child(7){ animation-delay: .6s; }
.dot:nth-child(8){ animation-delay: .7s; }
@keyframes blink{
  0%,100%{ opacity:.35; transform: translateY(0); }
  50%{ opacity: 1; transform: translateY(-2px); }
}

.screen{
  width: 240px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(45,212,191,0.10), rgba(59,130,246,0.07));
  border: 1px solid rgba(255,255,255,0.12);
  flex: 0 0 auto;
}
.screen-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:12px;
  padding: 4px 0;
}
.screen-label{ color: var(--muted2); }
.screen-value{ color: var(--text); font-weight:700; }

.glass{
  margin-top: 12px;
  border-radius: 18px;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.10);
}

.machine-inner{
  position:relative;
  border-radius: 16px;
  overflow:hidden;
  background:
    radial-gradient(900px 520px at 50% 10%, rgba(255,255,255,0.10), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.10);
  height: 720px;
}

@media (max-width: 920px){
  .machine-inner{ height: 780px; }
  .screen{ width: 210px; }
}
@media (max-width: 560px){
  .machine-inner{ height: 900px; }
  .screen{ width: 200px; }
}

.claw-rail{
  position:absolute; left:0; right:0; top: 14px;
  height: 8px;
  background: rgba(255,255,255,0.10);
  border-top: 1px solid rgba(255,255,255,0.14);
  border-bottom: 1px solid rgba(0,0,0,0.25);
}

/* plush grid */
.plush-grid{
  position:absolute;
  left: 14px; right: 14px;
  top: 100px;
  bottom: 210px;
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.10);
  min-width:0;
}
@media (max-width: 980px){
  .plush-grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 720px){
  .plush-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding: 10px; }
}
@media (max-width: 420px){
  .plush-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; }
}

.plush{
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  user-select:none;
  min-height: 48px;
  min-width: 0;
}
.plush .thumb{
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  overflow:hidden;
  display:grid;
  place-items:center;
  flex: 0 0 auto;
}
.plush img{ width: 100%; height: 100%; object-fit: cover; display:block; }
.plush .meta{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.plush .name{ font-size:12px; font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
.plush .mult{ font-size:11px; color: var(--muted); }

.plush.is-target{
  border-color: rgba(45,212,191,0.55);
  box-shadow: 0 0 0 1px rgba(45,212,191,0.15), 0 0 30px rgba(45,212,191,0.10);
  background: rgba(45,212,191,0.10);
}

.chute{
  position:absolute;
  right: 14px;
  bottom: 14px;
  width: 260px;
  border-radius: 16px;
  padding: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  z-index: 2;
}
@media (max-width: 560px){
  .chute{
    left: 14px;
    right: 14px;
    width: auto;
  }
}
.chute-hd{
  font-size:11px;
  color: var(--muted2);
  letter-spacing:.8px;
  margin-bottom: 8px;
}
.chute-box{
  display:flex;
  gap: 12px;
  align-items:center;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.10);
}
.chute-box img{
  width: 64px; height: 64px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
}
.prize-meta{ display:flex; flex-direction:column; gap: 8px; min-width:0; }
.prize-name{ font-size:12px; font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
.prize-sub{ display:flex; gap: 8px; flex-wrap:wrap; }

.floor{
  position:absolute;
  left:0; right:0; bottom:0;
  height: 110px;
  background:
    radial-gradient(700px 120px at 50% 0%, rgba(255,255,255,0.10), transparent 60%),
    linear-gradient(180deg, rgba(0,0,0,0.20), rgba(0,0,0,0.35));
  border-top: 1px solid rgba(255,255,255,0.08);
}

.glare{
  position:absolute;
  left:-20%;
  top:-30%;
  width: 60%;
  height: 180%;
  transform: rotate(14deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  pointer-events:none;
  opacity: .45;
}

/* claw */
.claw-group{
  position:absolute;
  top: 22px;
  left: 14px;
  width: 120px;
  transform: translateX(180px);
  will-change: transform;
  pointer-events:none;
  z-index: 4;
}
.cable{
  margin: 0 auto;
  width: 6px;
  height: 46px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.30), rgba(255,255,255,0.10));
  border: 1px solid rgba(255,255,255,0.10);
}
.claw-head{
  width: 120px;
  height: 86px;
  position:relative;
  display:grid;
  place-items:center;
}
.cap{
  width: 74px;
  height: 28px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.14);
  position:absolute;
  top: 0;
}
.grabber{
  width: 100px;
  height: 76px;
  position:absolute;
  top: 10px;
}
.arm{
  position:absolute;
  width: 14px;
  height: 56px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  top: 8px;
  transform-origin: top center;
  box-shadow: 0 10px 20px rgba(0,0,0,0.22);
  transition: transform .14s ease;
}
.arm.left{ left: 28px; transform: rotate(-18deg); }
.arm.right{ right: 28px; transform: rotate(18deg); }
.grabber.is-closed .arm.left{ transform: rotate(-4deg); }
.grabber.is-closed .arm.right{ transform: rotate(4deg); }

.carried{
  position:absolute;
  left: 50%;
  top: 96px;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  opacity: 0;
  pointer-events:none;
  display:grid;
  place-items:center;
  z-index: 5;
}
.carried img{
  width: 60px; height: 60px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
}
.carry-shadow{
  position:absolute;
  bottom: -14px;
  width: 52px;
  height: 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  filter: blur(2px);
  opacity: .55;
  transform: translateY(8px);
}

.drop-sprite{
  position:absolute;
  top:0;
  left:0;
  width: 60px;
  height: 60px;
  opacity: 0;
  pointer-events:none;
  z-index: 6;
}
.drop-sprite img{
  width: 60px;
  height: 60px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
}

/* notice */
.notice{
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.10);
}
.notice-title{ font-weight:900; font-size:12px; color: var(--muted); margin-bottom: 8px; }
.notice-body{ color: var(--muted); line-height:1.35; }

/* side */
.side-wrap{
  padding: 14px;
  display:flex;
  flex-direction:column;
  gap: 12px;
  min-width:0;
  overflow:hidden;
}
.bet-panel, .wallet-panel{
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.10);
  min-width:0;
  overflow:hidden;
}

.bet-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  min-width:0;
}
.bet-title{ font-weight:900; }
.bet-buttons{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 10px;
}
.bet-opt{
  flex: 1;
  min-width: 80px;
  border-radius: 14px;
  font-weight:900;
  background: rgba(59,130,246,0.10);
  border-color: rgba(59,130,246,0.22);
}
.bet-opt.is-selected{
  border-color: rgba(45,212,191,0.55);
  background: rgba(45,212,191,0.16);
  box-shadow: 0 0 0 1px rgba(45,212,191,0.14), 0 0 24px rgba(45,212,191,0.10);
}
.btn-start{
  width: 100%;
  margin-top: 12px;
  border-radius: 14px;
  padding: 12px 12px;
  font-weight: 900;
}
.bet-hint{
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

/* wallet: 오른쪽 값이 길어도 폭 확장 금지 + 말줄임 */
.wallet-row{
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  min-width:0;
}
.wallet-k{ font-size:12px; color: var(--muted2); min-width:0; }
.wallet-v{
  font-size:12px;
  color: var(--muted);
  text-align:right;
  min-width:0;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* log */
.log{
  padding: 12px 14px 14px;
  max-height: 420px;
  overflow:auto;
}
.log-item{
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  margin-bottom: 10px;
}
.log-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  min-width:0;
}
.log-title{
  font-weight:900;
  font-size:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 64%;
  min-width:0;
}
.log-sub{ display:flex; gap: 8px; flex-wrap:wrap; justify-content:flex-end; }
.log-body{
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

/* footer */
.footer{
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 16px 22px;
  color: var(--muted2);
  font-size: 12px;
}

/* toast */
.toast{
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(420px, calc(100vw - 32px));
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,0.56);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: var(--shadow);
  color: var(--text);
  z-index: 999;
}

  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

.mono{ font-family: var(--mono); }
.small{ font-size:12px; }
.sep{ opacity:.45; margin:0 8px; }

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 20px;
  position: sticky;
  top:0;
  z-index:5;
  background: var(--bg);
  backdrop-filter: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand{ display:flex; gap:12px; align-items:center; }
.logo{
  width:44px; height:44px;
  border-radius: 14px;
  display:grid; place-items:center;
  font-weight:900;
  letter-spacing:.6px;
  background: linear-gradient(135deg, rgba(45,212,191,.22), rgba(59,130,246,.18));
  border: 1px solid rgba(255,255,255,0.10);
}
.title{ font-weight:800; font-size:16px; }
.subtitle{ font-size:12px; color: var(--muted); margin-top:2px; }

.topbar-actions{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; justify-content:flex-end; }
.pill{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
}
.pill-label{ font-size:12px; color: var(--muted); }

.segmented{
  display:flex;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  overflow:hidden;
}
.seg-btn{
  border:0;
  padding:7px 10px;
  background: transparent;
  color: var(--muted);
  cursor:pointer;
  font-size:12px;
}
.seg-btn.is-active{
  background: rgba(255,255,255,0.10);
  color: var(--text);
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  padding:6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  white-space:nowrap;
}
.badge-ok{
  border-color: rgba(45,212,191,0.45);
  background: rgba(45,212,191,0.12);
}
.badge-warn{
  border-color: rgba(251,191,36,0.50);
  background: rgba(251,191,36,0.12);
}
.badge-bad{
  border-color: rgba(251,113,133,0.55);
  background: rgba(251,113,133,0.12);
}
.badge-ghost{
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}

.btn{
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 12px;
  padding:10px 12px;
  cursor:pointer;
  box-shadow: none;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,0.09); }
.btn:active{ transform: translateY(0px); }
.btn[disabled]{ opacity:.55; cursor:not-allowed; transform:none; }

.btn-primary{
  border-color: rgba(45,212,191,0.35);
  background: rgba(45,212,191,0.14);
}
.btn-primary:hover{ background: rgba(45,212,191,0.20); }

.btn-ghost{
  background: transparent;
  border-color: rgba(255,255,255,0.12);
  color: var(--muted);
}

/* ===== PAGE LAYOUT (FIXED GRID SHRINK BUG) ===== */
.page{
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 16px 22px;
  display:grid;
  grid-template-areas:
    "machine side"
    "log log";
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.8fr);
  gap: 16px;
}
.area-machine{ grid-area: machine; min-width: 0; }
.area-side{ grid-area: side; min-width: 0; }
.area-log{ grid-area: log; min-width: 0; }

@media (max-width: 980px){
  .page{
    grid-template-areas:
      "machine"
      "side"
      "log";
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ===== CARD ===== */
.card{
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.card-hd{
  padding: 14px 14px 10px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
}
.card-title{ font-weight:800; }
.card-actions{ display:flex; align-items:center; gap:8px; }

.card-meta{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:flex-start;
  min-width: 0;
}
.kv{ display:flex; flex-direction:column; gap:4px; min-width:0; }
.kv .k{ font-size:11px; color: var(--muted2); }
.kv .v{
  font-size:12px;
  color: var(--muted);
  max-width: 520px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  min-width:0;
}

/* ===== MACHINE ===== */
.machine{ padding: 14px; }

.machine-top{
  display:flex;
  justify-content:space-between;
  align-items:stretch;
  gap: 12px;
  min-width:0;
}

.marquee{
  flex: 1;
  display:flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  align-items:center;
  min-width:0;
}
.dot{
  width:10px; height:10px; border-radius:999px;
  background: rgba(255,255,255,0.20);
  box-shadow: 0 0 20px rgba(45,212,191,0.10);
  animation: blink 1.6s infinite ease-in-out;
}
.dot:nth-child(2){ animation-delay: .1s; }
.dot:nth-child(3){ animation-delay: .2s; }
.dot:nth-child(4){ animation-delay: .3s; }
.dot:nth-child(5){ animation-delay: .4s; }
.dot:nth-child(6){ animation-delay: .5s; }
.dot:nth-child(7){ animation-delay: .6s; }
.dot:nth-child(8){ animation-delay: .7s; }

@keyframes blink{
  0%,100%{ opacity:.35; transform: translateY(0); }
  50%{ opacity: 1; transform: translateY(-2px); }
}

.screen{
  width: 240px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(45,212,191,0.10), rgba(59,130,246,0.07));
  border: 1px solid rgba(255,255,255,0.12);
  flex: 0 0 auto;
}
.screen-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:12px;
  padding: 4px 0;
}
.screen-label{ color: var(--muted2); }
.screen-value{ color: var(--text); font-weight:700; }

.glass{
  margin-top: 12px;
  border-radius: 18px;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.10);
}

.machine-inner{
  position:relative;
  border-radius: 16px;
  overflow:hidden;
  background:
    radial-gradient(900px 520px at 50% 10%, rgba(255,255,255,0.10), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.10);
  height: 640px;
}

@media (max-width: 920px){
  .machine-inner{ height: 720px; }
  .screen{ width: 210px; }
}
@media (max-width: 560px){
  .machine-inner{ height: 860px; }
  .screen{ width: 200px; }
}

.claw-rail{
  position:absolute; left:0; right:0; top: 14px;
  height: 8px;
  background: rgba(255,255,255,0.10);
  border-top: 1px solid rgba(255,255,255,0.14);
  border-bottom: 1px solid rgba(0,0,0,0.25);
}

.plush-grid{
  position:absolute;
  left: 14px; right: 14px;
  top: 100px;
  bottom: 190px;
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.10);
  min-width:0;
}

@media (max-width: 920px){
  .plush-grid{
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    padding: 10px;
    bottom: 210px;
  }
}
@media (max-width: 560px){
  .plush-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    bottom: 230px;
  }
}

.plush{
  position:relative;
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  cursor: default;
  user-select:none;
  min-height: 48px;
  min-width: 0;
}
.plush .thumb{
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  overflow:hidden;
  display:grid;
  place-items:center;
  flex: 0 0 auto;
}
.plush img{ width: 100%; height: 100%; object-fit: cover; display:block; }
.plush .meta{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.plush .name{ font-size:12px; font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
.plush .mult{ font-size:11px; color: var(--muted); }

@media (max-width: 560px){
  .plush{ padding: 7px; min-height: 46px; }
  .plush .thumb{ width: 38px; height: 38px; }
  .plush .name{ font-size:11px; }
  .plush .mult{ font-size:10px; }
}

.plush.is-target{
  border-color: rgba(45,212,191,0.55);
  box-shadow: 0 0 0 1px rgba(45,212,191,0.15), 0 0 30px rgba(45,212,191,0.10);
  background: rgba(45,212,191,0.10);
}
.plush.is-shake{ animation: shake .35s ease-in-out 2; }
@keyframes shake{
  0%,100%{ transform: translateX(0); }
  25%{ transform: translateX(-2px); }
  75%{ transform: translateX(2px); }
}

.chute{
  position:absolute;
  right: 14px;
  bottom: 14px;
  width: 260px;
  border-radius: 16px;
  padding: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  z-index: 2;
}
@media (max-width: 560px){
  .chute{
    left: 14px;
    right: 14px;
    width: auto;
  }
}

.chute-hd{
  font-size:11px;
  color: var(--muted2);
  letter-spacing:.8px;
  margin-bottom: 8px;
}
.chute-box{
  display:flex;
  gap: 12px;
  align-items:center;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.10);
}
.chute-box img{
  width: 64px; height: 64px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
}
.prize-meta{ display:flex; flex-direction:column; gap: 8px; min-width:0; }
.prize-name{ font-size:12px; font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
.prize-sub{ display:flex; gap: 8px; flex-wrap:wrap; }

.floor{
  position:absolute;
  left:0; right:0; bottom:0;
  height: 110px;
  background:
    radial-gradient(700px 120px at 50% 0%, rgba(255,255,255,0.10), transparent 60%),
    linear-gradient(180deg, rgba(0,0,0,0.20), rgba(0,0,0,0.35));
  border-top: 1px solid rgba(255,255,255,0.08);
}

.glare{
  position:absolute;
  left:-20%;
  top:-30%;
  width: 60%;
  height: 180%;
  transform: rotate(14deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  pointer-events:none;
  opacity: .45;
}

.claw-group{
  position:absolute;
  top: 22px;
  left: 14px;
  width: 120px;
  transform: translateX(180px);
  will-change: transform;
  pointer-events:none;
  z-index: 4;
}

.cable{
  margin: 0 auto;
  width: 6px;
  height: 46px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.30), rgba(255,255,255,0.10));
  border: 1px solid rgba(255,255,255,0.10);
}

.claw-head{
  width: 120px;
  height: 86px;
  position:relative;
  display:grid;
  place-items:center;
}

.cap{
  width: 74px;
  height: 28px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.14);
  position:absolute;
  top: 0;
}

.grabber{
  width: 100px;
  height: 76px;
  position:absolute;
  top: 10px;
}
.arm{
  position:absolute;
  width: 14px;
  height: 56px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  top: 8px;
  transform-origin: top center;
  box-shadow: 0 10px 20px rgba(0,0,0,0.22);
  transition: transform .14s ease;
}
.arm.left{ left: 28px; transform: rotate(-18deg); }
.arm.right{ right: 28px; transform: rotate(18deg); }
.grabber.is-closed .arm.left{ transform: rotate(-4deg); }
.grabber.is-closed .arm.right{ transform: rotate(4deg); }

.carried{
  position:absolute;
  left: 50%;
  top: 96px;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  opacity: 0;
  pointer-events:none;
  display:grid;
  place-items:center;
  z-index: 5;
}
.carried img{
  width: 60px; height: 60px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
}
.carried.is-sway img{
  animation: sway 0.9s ease-in-out infinite;
}
@keyframes sway{
  0%,100%{ transform: rotate(-2deg) translateY(0); }
  50%{ transform: rotate(2deg) translateY(-2px); }
}
.carry-shadow{
  position:absolute;
  bottom: -14px;
  width: 52px;
  height: 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  filter: blur(2px);
  opacity: .55;
  transform: translateY(8px);
}

.drop-sprite{
  position:absolute;
  top:0;
  left:0;
  width: 60px;
  height: 60px;
  opacity: 0;
  pointer-events:none;
  z-index: 6;
}
.drop-sprite img{
  width: 60px;
  height: 60px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
}

.notice{
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.10);
}
.notice-title{ font-weight:900; font-size:12px; color: var(--muted); margin-bottom: 8px; }
.notice-body{ color: var(--muted); line-height:1.35; }

.side-wrap{
  padding: 14px;
  display:flex;
  flex-direction:column;
  gap: 12px;
  min-width:0;
}

.bet-panel, .wallet-panel{
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.10);
  min-width:0;
}

.bet-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  min-width:0;
}
.bet-title{ font-weight:900; }
.bet-buttons{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 10px;
}
.bet-opt{
  flex: 1;
  min-width: 80px;
  border-radius: 14px;
  font-weight:900;
  background: rgba(59,130,246,0.10);
  border-color: rgba(59,130,246,0.22);
}
.bet-opt:hover{ background: rgba(59,130,246,0.16); }
.bet-opt.is-selected{
  border-color: rgba(45,212,191,0.55);
  background: rgba(45,212,191,0.16);
  box-shadow: 0 0 0 1px rgba(45,212,191,0.14), 0 0 24px rgba(45,212,191,0.10);
}
.btn-start{
  width: 100%;
  margin-top: 12px;
  border-radius: 14px;
  padding: 12px 12px;
  font-weight: 900;
}
.bet-hint{
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.wallet-row{ display:flex; justify-content:space-between; gap: 12px; padding: 6px 0; min-width:0; }
.wallet-k{ font-size:12px; color: var(--muted2); }
.wallet-v{
  font-size:12px;
  color: var(--muted);
  text-align:right;
  max-width: 70%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  min-width:0;
}

.log{
  padding: 12px 14px 14px;
  max-height: 420px;
  overflow:auto;
}

.log-item{
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  margin-bottom: 10px;
}
.log-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  min-width:0;
}
.log-title{
  font-weight:900;
  font-size:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 64%;
  min-width:0;
}
.log-sub{ display:flex; gap: 8px; flex-wrap:wrap; justify-content:flex-end; }

.log-body{
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.footer{
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 16px 22px;
  color: var(--muted2);
  font-size: 12px;
}

.toast{
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(420px, calc(100vw - 32px));
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,0.56);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: var(--shadow);
  color: var(--text);
  z-index: 999;
}

.sparkle{
  position:absolute;
  width: 10px; height: 10px;
  border-radius: 999px;
  background: rgba(45,212,191,0.85);
  box-shadow: 0 0 18px rgba(45,212,191,0.55);
  opacity: 0;
  pointer-events:none;
}


/* =========================
   PRIZE REVEAL POP (CHUTE)
========================= */
.prize-reveal{
  position:absolute;
  top:0;
  left:0;
  width: min(360px, calc(100% - 28px));
  opacity: 0;
  pointer-events:none;
  z-index: 8;
  will-change: transform, opacity;
  transform: translate(0px,0px) scale(1);
  filter: drop-shadow(0 18px 44px rgba(0,0,0,0.40));
}

.prize-reveal-card{
  display:flex;
  align-items:center;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(10px);
}

.prize-reveal-thumb{
  position:relative;
  width: 112px;
  height: 112px;
  flex: 0 0 auto;
  z-index: 0; /* halo 레이어를 안정적으로 표시 */
}

.prize-reveal-thumb img{
  width: 112px;
  height: 112px;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  display:block;
  position: relative;
  z-index: 1;
}

.prize-reveal-halo{
  position:absolute;
  inset: -18px;
  border-radius: 40px;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.12), transparent 62%);
  filter: blur(10px);
  opacity: 0.75;
  z-index: 0;
  pointer-events: none;
}

.prize-reveal-meta{ display:flex; flex-direction:column; gap: 10px; min-width:0; }
.prize-reveal-name{
  font-size: 13px;
  font-weight: 900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  color: var(--text);
}
.prize-reveal-sub{ display:flex; gap: 8px; flex-wrap:wrap; }

.prize-reveal.tone-ok .prize-reveal-card{
  border-color: rgba(45,212,191,0.45);
  box-shadow: 0 0 0 1px rgba(45,212,191,0.12), 0 0 44px rgba(45,212,191,0.14);
}
.prize-reveal.tone-ok .prize-reveal-halo{
  background: radial-gradient(circle at 50% 50%, rgba(45,212,191,0.30), transparent 62%);
}

.prize-reveal.tone-bad .prize-reveal-card{
  border-color: rgba(251,113,133,0.55);
  box-shadow: 0 0 0 1px rgba(251,113,133,0.12), 0 0 44px rgba(251,113,133,0.14);
}
.prize-reveal.tone-bad .prize-reveal-halo{
  background: radial-gradient(circle at 50% 50%, rgba(251,113,133,0.28), transparent 62%);
}

.prize-reveal.tone-ghost .prize-reveal-card{
  border-color: rgba(255,255,255,0.14);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 0 38px rgba(255,255,255,0.08);
}

.chute.is-pop .chute-box{
  animation: chutePulse .62s ease-out 1;
}
.chute.is-pop .chute-box img{
  animation: chuteThumbPop .62s ease-out 1;
}

@keyframes chutePulse{
  0%{ transform: translateY(0) scale(1); }
  35%{ transform: translateY(-2px) scale(1.03); }
  70%{ transform: translateY(1px) scale(0.995); }
  100%{ transform: translateY(0) scale(1); }
}

@keyframes chuteThumbPop{
  0%{ transform: scale(1); }
  40%{ transform: scale(1.16); }
  75%{ transform: scale(0.98); }
  100%{ transform: scale(1); }
}

.chute.is-pop.tone-ok .chute-box{
  border-color: rgba(45,212,191,0.55);
  box-shadow: 0 0 0 1px rgba(45,212,191,0.15), 0 0 30px rgba(45,212,191,0.16);
}
.chute.is-pop.tone-bad .chute-box{
  border-color: rgba(251,113,133,0.62);
  box-shadow: 0 0 0 1px rgba(251,113,133,0.14), 0 0 30px rgba(251,113,133,0.14);
}
.chute.is-pop.tone-ghost .chute-box{
  border-color: rgba(255,255,255,0.14);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 0 26px rgba(255,255,255,0.08);
}

@media (prefers-reduced-motion: reduce){
  .chute.is-pop .chute-box,
  .chute.is-pop .chute-box img{
    animation: none !important;
  }
}

