:root {
  --cell: 56px;
  --wood: #8a5a2b;
  --wood-d: #5a3714;
  --frame: #c99a55;
  --cream: #fff7e8;
  --ink: #3a2410;
  --red: #e3263f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #6fb6ea; font-family: 'Pretendard', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; color: var(--ink); -webkit-tap-highlight-color: transparent; user-select: none; }
button { font-family: inherit; cursor: pointer; border: 0; color: inherit; }
#bg { position: fixed; inset: 0; z-index: 0; }
#bg svg { width: 100%; height: 100%; display: block; }

#viewport { position: relative; z-index: 1; display: flex; justify-content: center; }
#app { width: 440px; height: 900px; transform-origin: top center; position: relative; padding: 14px 16px 0; flex-shrink: 0; }

/* ---------- 상단 ---------- */
#topbar { display: flex; align-items: center; gap: 10px; height: 64px; }
#logo { display: flex; flex-direction: column; line-height: .85; font-family: 'Arial Black', Impact, sans-serif; transform: rotate(-4deg); margin-right: auto; padding-left: 4px; }
#logo .l1 { font-size: 22px; color: #ffd84a; -webkit-text-stroke: 2px #6b3a10; text-shadow: 0 3px 0 #6b3a10; letter-spacing: 1px; }
#logo .l2 { font-size: 34px; color: #fff; -webkit-text-stroke: 2px #6b3a10; text-shadow: 0 4px 0 #6b3a10; padding-left: 14px; }
.pill { display: flex; align-items: center; gap: 8px; background: linear-gradient(#fffdf4, #ffeec2); border: 3px solid #e0a92b; border-radius: 30px; padding: 4px 6px 4px 6px; box-shadow: 0 3px 0 #b07a12; }
.pill .coin { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff2a6, #f5b80c 60%, #c47c00); border: 2px solid #7a4a00; }
.pt-col { display: flex; flex-direction: column; align-items: center; min-width: 96px; line-height: 1.1; }
.pt-col small { font-size: 10px; color: #8a6a3a; }
.pt-col b { font-size: 16px; }
.pill .plus { width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 900; font-size: 20px; line-height: 24px; text-align: center; border: 2px solid #fff; }
.sidebtn { width: 56px; height: 54px; border-radius: 10px; background: linear-gradient(#2f6fd6, #1b4ea8); border: 2px solid #0e2d66; box-shadow: 0 3px 0 #0e2d66, inset 0 2px 0 rgba(255,255,255,.3); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.sidebtn .ico { font-size: 22px; font-weight: 900; line-height: 1; }
.sidebtn small { font-size: 9px; font-weight: 700; white-space: nowrap; }
.sidebtn:active, .roundbtn:active, #btnPlay:active { transform: translateY(2px); }

/* ---------- 가운데 ---------- */
#middle { display: flex; gap: 12px; margin-top: 8px; }
#stage { position: relative; width: calc(var(--cell) * 5); height: calc(var(--cell) * 9 + 12px); flex-shrink: 0; margin-left: 20px; }
#slot { position: absolute; left: 0; top: 0; width: calc(var(--cell) * 5); height: calc(var(--cell) * 3); }
#slot::before { content: ''; position: absolute; inset: -7px; border-radius: 6px; background: linear-gradient(#e9c27a, #b98a3e); border: 3px solid #6b4a1a; box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.slot-cell { position: absolute; width: var(--cell); height: var(--cell); padding: 3px; }
.slot-cell::before { content: ''; position: absolute; inset: 3px; border-radius: 8px; background: radial-gradient(circle at 50% 40%, #fff7ea, #e7d0b0); box-shadow: inset 0 0 0 2px #c9a26a, inset 0 3px 6px rgba(120,80,30,.35); }
.slot-item { position: absolute; inset: 5px; }
.slot-item svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 1px rgba(0,0,0,.35)); }
.slot-item.blur { filter: blur(1.5px); opacity: .7; transform: translateY(6px); }
.slot-item.land { animation: land .18s ease-out; }
.slot-item.pop { animation: pop .3s ease-out; }
.slot-item.upgrade { animation: upg .5s ease-out; }
@keyframes land { from { transform: translateY(-14px); } to { transform: none; } }
@keyframes pop { from { transform: scale(0); } 60% { transform: scale(1.3); } to { transform: scale(1); } }
@keyframes upg { 0% { transform: scale(.5); filter: brightness(3); } 60% { transform: scale(1.3); } 100% { transform: scale(1); filter: none; } }
.badge { position: absolute; right: -2px; bottom: -3px; font: 900 12px/1 Arial, sans-serif; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; }

#board { position: absolute; left: 0; top: calc(var(--cell) * 3 + 12px); width: calc(var(--cell) * 5); height: calc(var(--cell) * 6); background: #3a2414; }
#board::before { content: ''; position: absolute; inset: -6px; border-radius: 6px; border: 5px solid #1c1008; background: #2a1a0e; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.hole { position: absolute; width: var(--cell); height: var(--cell); border: 1px solid rgba(0,0,0,.35); background: #3b2516; }
.block { position: absolute; width: var(--cell); height: var(--cell); padding: 2px; }
.block svg { width: 100%; height: 100%; display: block; }
.block .crack { position: absolute; inset: 2px; pointer-events: none; }

#fx { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.flypick { position: absolute; left: 0; top: 0; width: var(--cell); height: var(--cell); padding: 4px; z-index: 6; }
.flypick .pick-spin { width: 100%; height: 100%; }
.flypick svg { width: 100%; height: 100%; filter: drop-shadow(0 3px 2px rgba(0,0,0,.5)); }
.float { position: absolute; font: 900 16px/1 Arial, sans-serif; color: #fff; text-shadow: 0 0 3px #000, 0 2px 0 #000; white-space: nowrap; z-index: 8; }
.float.big { font-size: 22px; color: #ffe14a; }
.float.mult { color: #7ff7ff; }
.float.mystery { font-size: 20px; color: #ff9ab4; }
.float.spin { font-size: 13px; color: #ffe14a; }
.float.chestmult { font-size: 30px; color: #ffe14a; -webkit-text-stroke: 1px #6b3a10; }
.particle { position: absolute; width: 7px; height: 7px; border-radius: 2px; z-index: 7; }
.boom { position: absolute; width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle, #fff7b0 0%, #ffb02e 35%, rgba(255,80,0,.6) 60%, rgba(255,80,0,0) 72%); z-index: 7; }
.beam { position: absolute; bottom: -60px; width: 60px; height: 420px; transform: translateX(-50%); background: linear-gradient(to top, rgba(255,250,200,.95), rgba(255,250,200,0)); z-index: 4; filter: blur(2px); }
.banner { position: absolute; left: -40px; right: -40px; top: calc(var(--cell) * 5); height: 80px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.6); z-index: 9; }
.banner span { font: 900 54px/1 'Arial Black', Impact, sans-serif; color: #ff3b30; -webkit-text-stroke: 2px #ffd34d; letter-spacing: 3px; font-style: italic; }

/* ---------- 오른쪽 열 ---------- */
#rightcol { position: relative; width: 84px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
#gauge { position: absolute; top: calc(var(--cell) * 3 + 12px); left: 0; width: 84px; height: calc(var(--cell) * 6); }
#gaugeTrack { position: absolute; left: 4px; top: 0; bottom: 0; width: 14px; border-radius: 8px; background: #1e1a2a; border: 2px solid #0d0a14; overflow: hidden; }
#gaugeFill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(#c6a2ff, #7c3aed); box-shadow: 0 0 8px #b388ff; transition: height .1s linear; }
#gaugeLabels { position: absolute; left: 24px; top: 0; bottom: 0; right: 0; }
.glabel { position: absolute; left: 0; display: flex; flex-direction: column; align-items: center; width: 56px; line-height: 1; }
.glabel small { font: 700 9px/1 Arial, sans-serif; color: #fff; text-shadow: 0 0 2px #000; margin-top: 1px; }
.chip { display: inline-block; color: #fff; font-weight: 900; font-size: 13px; padding: 3px 8px; border-radius: 4px; border: 2px solid rgba(255,255,255,.85); text-shadow: 0 1px 0 rgba(0,0,0,.4); }
.glabel .chip { width: 48px; text-align: center; padding: 2px 0; }
.glabel.on .chip { box-shadow: 0 0 0 2px #ffe14a, 0 0 10px #ffe14a; transform: scale(1.08); }
.speedbtn { position: absolute; top: calc(var(--cell) * 9 + 26px); left: 4px; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(#2f6fd6, #1b4ea8); border: 2px solid #0e2d66; color: #fff; font-size: 18px; }
.speedbtn.on { background: linear-gradient(#ffd84a, #f59e0b); color: #6b3a10; box-shadow: 0 0 10px #ffd84a; }

/* ---------- 보물상자 ---------- */
#chests { display: flex; margin-left: 20px; width: calc(var(--cell) * 5); height: 58px; margin-top: 6px; position: relative; }
#chests::after { content: ''; position: absolute; left: -10px; right: -10px; bottom: -4px; height: 14px; background: linear-gradient(#a06a35, #6b4318); border-radius: 4px; z-index: -1; }
.chest { width: var(--cell); height: 54px; padding: 2px 4px; position: relative; }
.chest svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 1px rgba(0,0,0,.4)); }
.chest .mult { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); font: 900 15px/1 Arial, sans-serif; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; }

/* ---------- 하단 패널 ---------- */
#panel { margin-top: 12px; height: 110px; border-radius: 14px; background: linear-gradient(#a8743e, #7a4c1e); border: 4px solid #4a2c0e; box-shadow: inset 0 0 0 3px #c99a55, 0 4px 0 rgba(0,0,0,.3); padding: 12px; display: flex; align-items: center; }
#panelIdle, #panelPlay { display: flex; align-items: center; width: 100%; gap: 8px; }
#panelIdle[hidden], #panelPlay[hidden] { display: none; }
.roundbtn { width: 38px; height: 38px; border-radius: 50%; font-size: 26px; font-weight: 900; line-height: 1; color: #fff; border: 2px solid #0e2d66; background: linear-gradient(#2f6fd6, #1b4ea8); flex-shrink: 0; }
.roundbtn.minus { background: linear-gradient(#5a6170, #3a404c); border-color: #20242c; }
#betBox { flex: 1; height: 72px; border-radius: 10px; background: #111; border: 3px solid #c99a55; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#betBox small { font-size: 11px; color: #ddd; }
#betBox b { font-size: 26px; }
#btnPlay { width: 82px; height: 82px; border-radius: 50%; background: radial-gradient(circle at 40% 30%, #ff6b6b, #d4142e 70%); border: 4px solid #fff; box-shadow: 0 0 0 3px #8a0d1c, 0 4px 0 #5a0610; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
#btnPlay .tri { width: 0; height: 0; border-left: 26px solid #fff; border-top: 16px solid transparent; border-bottom: 16px solid transparent; margin-left: 6px; }
#btnPlay small { font-weight: 900; font-size: 13px; margin-top: 2px; }
#btnPlay.disabled { filter: grayscale(.8); }
#panelPlay .info { display: flex; flex-direction: column; gap: 6px; width: 150px; }
#panelPlay .info div { display: flex; justify-content: space-between; align-items: center; background: #111; color: #fff; border: 2px solid #c99a55; border-radius: 6px; padding: 5px 8px; }
#panelPlay .info small { font-size: 11px; color: #ccc; }
#panelPlay .info b { font-size: 14px; }
#spinsText.bump { animation: bump .3s; display: inline-block; }
@keyframes bump { 50% { transform: scale(1.6); color: #ffe14a; } }
.scorebox { flex: 1; height: 80px; background: #111; border: 3px solid #e3263f; border-radius: 10px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: inset 0 0 0 2px #fff3; }
.scorebox small { font-size: 12px; color: #ddd; }
.scorebox b { font: 900 34px/1.1 Arial, sans-serif; color: #ffd84a; }

#toast { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%) translateY(10px); background: rgba(0,0,0,.8); color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 13px; opacity: 0; transition: .25s; pointer-events: none; white-space: nowrap; z-index: 20; }
#toast.on { opacity: 1; transform: translateX(-50%); }

/* ---------- 팝업 ---------- */
#overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
#overlay[hidden] { display: none; }
.modal { width: 100%; max-width: 400px; max-height: 92vh; background: var(--cream); border-radius: 18px; padding: 18px 16px 14px; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: pop .25s ease-out; }
.modal.small { max-width: 340px; }
.modal.tall { height: 86vh; }
.modal h2 { margin: 0; text-align: center; font-size: 22px; }
.divider { height: 2px; margin: 8px 20px 12px; background: linear-gradient(90deg, transparent, #c99a55, transparent); position: relative; }
.divider span { position: absolute; left: 50%; top: -4px; width: 9px; height: 9px; background: #c99a55; transform: translateX(-50%) rotate(45deg); }
.mbody { flex: 1; overflow: auto; min-height: 0; }
.closebtn { margin-top: 12px; width: 100%; padding: 12px; border-radius: 26px; background: #fff; border: 3px solid #eadbc0; font-size: 16px; font-weight: 800; }
.muted { color: #8a6a3a; font-size: 13px; }
.center { text-align: center; }
.note { color: #9a5a10; font-size: 12px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; }
.tabs button { padding: 8px 12px; border-radius: 8px; background: #ece0cc; font-weight: 800; font-size: 13px; color: #7a6040; white-space: nowrap; }
.tabs button.on { background: #f5c518; color: var(--ink); }
#helpTabs, #prizeTabs { display: flex; flex-direction: column; height: 100%; }
.tabbody { flex: 1; overflow: auto; min-height: 0; font-size: 13.5px; line-height: 1.55; padding-right: 4px; }
.tabbody h4 { margin: 10px 0 4px; color: #8a4a00; }
.steps { padding-left: 20px; margin: 4px 0; }
.steps li { margin-bottom: 10px; }
.steps li b { display: block; color: #8a4a00; }
.steps2 p { margin: 0 0 8px; }
.steps2 b { display: inline-block; min-width: 128px; color: #8a4a00; }
.icrow { display: flex; gap: 6px; justify-content: space-between; margin: 6px 0 10px; }
.icrow.wrap { flex-wrap: wrap; justify-content: flex-start; }
.icrow.wrap .icbox { width: 70px; }
.icbox { display: flex; flex-direction: column; align-items: center; width: 64px; text-align: center; font-size: 11px; line-height: 1.2; }
.icbox .ic { width: 56px; height: 56px; background: #f1e3c6; border-radius: 10px; padding: 6px; }
.icbox .ic svg { width: 100%; height: 100%; }
.icbox small { color: #8a6a3a; }
.itemrow { display: flex; gap: 10px; align-items: center; border-top: 1px solid #eadbc0; padding: 6px 0; }
.itemrow p { margin: 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { background: #f1e3c6; font-size: 11px; padding: 4px; text-align: left; }
.tbl td { padding: 3px 4px; border-bottom: 1px solid #eadbc0; }
.mini { display: inline-block; width: 26px; height: 26px; vertical-align: middle; margin-right: 6px; }
.mini svg { width: 100%; height: 100%; }
.plist { border: 1px solid #eadbc0; border-radius: 12px; background: #fffdf8; }
.prow { border-bottom: 1px solid #eadbc0; }
.prow summary { display: flex; align-items: center; gap: 8px; padding: 10px; cursor: pointer; list-style: none; font-size: 12px; }
.prow summary::-webkit-details-marker { display: none; }
.prow summary::after { content: '⌄'; margin-left: 4px; font-size: 16px; color: #8a6a3a; }
.prow .chip { width: 48px; text-align: center; border: 0; border-radius: 12px; }
.prow .need { flex: 1; } .prow .need b { font-size: 15px; }
.prow .rate b { font-size: 15px; }
.pcards { display: flex; gap: 8px; padding: 0 10px 12px; }
.pcard { width: 100px; text-align: center; font-size: 11px; cursor: pointer; }
.pcard .card { width: 100px; }
.chargegrid, .betlist { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.chargegrid button, .betlist button { padding: 14px 8px; border-radius: 10px; background: #fff; border: 3px solid #eadbc0; font-weight: 900; font-size: 15px; }
.chargegrid button { background: linear-gradient(#fff6d0, #ffe18a); border-color: #e0a92b; }
.betlist button.on { background: #f5c518; }
.betlist button.disabled { opacity: .4; }
.slider { display: flex; align-items: center; gap: 12px; padding: 12px 4px; font-weight: 800; }
.slider span { width: 80px; }
.slider input { flex: 1; accent-color: #7a4a10; }
.rowbtn { width: 100%; padding: 12px; margin-top: 8px; border-radius: 10px; background: #f1e3c6; font-weight: 800; }
.bag { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bagitem { text-align: center; font-size: 11px; }
.bagitem .card { width: 100%; cursor: pointer; }
.bagitem button { margin-top: 4px; padding: 4px 10px; border-radius: 12px; background: var(--red); color: #fff; font-weight: 800; font-size: 11px; }
.zoom { position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #fff; font-size: 18px; }
.zoom .closebtn { width: 120px; color: var(--ink); }

/* ---------- 카드 ---------- */
.card { position: relative; aspect-ratio: 63 / 88; border-radius: 8px; padding: 5px; background: linear-gradient(145deg, #f5f5f5, #b8b8b8 50%, #f0f0f0); box-shadow: 0 2px 6px rgba(0,0,0,.35); overflow: hidden; font-size: 10px; }
.card.grade-S, .card.grade-A { background: linear-gradient(145deg, #fff3b0, #d9a520 45%, #fff3b0 60%, #b8860b); }
.card-in { height: 100%; border-radius: 5px; background: linear-gradient(170deg, var(--l), var(--m)); display: flex; flex-direction: column; padding: 4px; color: #fff; }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.card-grade { font-weight: 900; padding: 1px 5px; border-radius: 3px; font-size: 1em; border: 1px solid #fff; }
.card-stars { color: #ffe14a; text-shadow: 0 0 2px #000; font-size: .8em; letter-spacing: -1px; }
.card-art { flex: 1; margin: 4px 0; border-radius: 4px; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.7), rgba(255,255,255,0) 70%), var(--d); display: flex; align-items: center; justify-content: center; border: 2px solid rgba(255,255,255,.6); min-height: 0; }
.card-art svg { width: 92%; height: 92%; }
.card-name { font-weight: 900; font-size: 1.05em; text-align: center; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-foot { font-size: .65em; text-align: center; opacity: .85; }
.card-holo { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.55) 45%, rgba(255,120,220,.3) 52%, rgba(120,220,255,.3) 58%, transparent 70%); background-size: 250% 100%; animation: holo 3s linear infinite; mix-blend-mode: screen; pointer-events: none; }
@keyframes holo { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.card.big { width: 230px; font-size: 18px; padding: 8px; }

/* ---------- 종료 연출 ---------- */
.fin { position: relative; width: 100%; max-width: 420px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; }
.fin-gauge { display: flex; gap: 16px; align-items: stretch; height: 200px; animation: pop .4s ease-out; }
.fg-track { width: 26px; border-radius: 14px; background: #1e1a2a; border: 3px solid #0d0a14; position: relative; overflow: hidden; }
.fg-fill { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(#c6a2ff, #7c3aed); box-shadow: 0 0 12px #b388ff; }
.fg-labels { display: flex; flex-direction: column; justify-content: space-around; }
.chip.big { font-family: 'Black Han Sans', sans-serif; font-weight: 400; letter-spacing: 1px; font-size: 26px; padding: 6px 16px; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.chip.big small { font-size: 15px; }
.chip.big.on { box-shadow: 0 0 0 3px #ffe14a, 0 0 20px #ffe14a; }
.fin-score { font: 900 56px/1 Arial, sans-serif; color: #ffd84a; text-shadow: 0 3px 0 #6b3a10; margin-top: 18px; }
.fin-next { margin-top: 10px; font-size: 20px; font-weight: 800; }
.fin-next b { color: #7fd8ff; font-size: 26px; }
.fin-next.top { color: #ffe14a; font-size: 26px; }
.tapskip { position: absolute; bottom: 8%; font-size: 14px; opacity: .8; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.gbadge { position: relative; width: 240px; height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; animation: badge .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes badge { from { transform: scale(0) rotate(-20deg); } to { transform: none; } }
.gb-ring { position: absolute; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, var(--gc) 55%, #fff 57%, #ffd84a 62%, #b8860b 70%); box-shadow: 0 0 40px var(--gc); }
.gb-letter { position: relative; font: 400 76px/1 'Black Han Sans', 'Arial Black', sans-serif; letter-spacing: 2px; paint-order: stroke fill; color: #fff; -webkit-text-stroke: 3px #3a1a60; text-shadow: 0 5px 0 #3a1a60; }
.gb-ribbon { position: relative; margin-top: 4px; padding: 6px 26px; background: linear-gradient(#3fa2ff, #1b5fd1); border: 3px solid #fff; border-radius: 6px; font-weight: 900; font-size: 24px; }
.roulette { width: 100%; height: 170px; overflow: hidden; margin-top: 20px; background: rgba(0,0,0,.4); border-top: 2px solid #ffd84a55; border-bottom: 2px solid #ffd84a55; position: relative; }
.strip { display: flex; padding: 8px 0; will-change: transform; }
.rc { width: 104px; flex-shrink: 0; padding: 0 6px; transition: transform .3s; }
.rc .card { width: 92px; }
.rc.picked { transform: scale(1.18); }
.rc.picked .card { box-shadow: 0 0 0 3px #ffe14a, 0 0 22px #ffe14a; }
.result { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.result .card.big { width: 200px; font-size: 16px; }
.rname { font-size: 18px; }
.rrow { display: flex; justify-content: space-between; width: 100%; padding: 8px 4px; border-top: 1px solid #eadbc0; font-size: 14px; }
.rbtns { display: flex; gap: 8px; width: 100%; margin-top: 4px; }
.rbtns button { flex: 1; padding: 12px; border-radius: 24px; background: #fff; border: 3px solid #eadbc0; font-weight: 800; font-size: 15px; }
.rbtns button.red { background: var(--red); border-color: var(--red); color: #fff; }
.cmp { text-align: center; padding: 14px; background: #f1e3c6; border-radius: 10px; margin: 10px 0; font-size: 16px; }
.cmp b { color: #1fa155; }
.card-grade { white-space: nowrap; }
.card-stars { white-space: nowrap; overflow: hidden; max-width: 60%; }
.tabs::-webkit-scrollbar { display: none; } .tabs { scrollbar-width: none; }

.block .blockimg, .mini .blockimg { width: 100%; height: 100%; display: block; image-rendering: auto; -webkit-user-drag: none; }
.block { padding: 1px; }
#panelPlay .info { width: 170px; }
#panelPlay .info div { white-space: nowrap; gap: 6px; }
#panelPlay .info small { font-size: 10px; }
.scorebox b.long { font-size: 26px; }

/* ---------- 보물상자 연출 ---------- */
.chest img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 2px 1px rgba(0,0,0,.4)); }
.chest.glow img { filter: drop-shadow(0 0 6px #fff6a0) drop-shadow(0 0 12px #ffd84a); }
.chest.glow.tier2 img { filter: drop-shadow(0 0 8px #ffb04a) drop-shadow(0 0 18px #ff7a00); }
.chest.glow.tier3 img { filter: drop-shadow(0 0 10px #fff3a0) drop-shadow(0 0 24px #ffd700); }
.chest.glow.tier4 img { animation: hue 1s linear infinite; }
@keyframes hue { from { filter: hue-rotate(0deg) drop-shadow(0 0 12px #ff5e7e); } to { filter: hue-rotate(360deg) drop-shadow(0 0 12px #ff5e7e); } }
.chest { z-index: 6; }
.chest .mult.t1 { color: #ffe14a; } .chest .mult.t2 { color: #ffb04a; font-size: 17px; }
.chest .mult.t3 { color: #ffd700; font-size: 18px; } .chest .mult.t4 { font-size: 20px; color: #fff; -webkit-text-stroke: 1px #c0247a; }
.beam.t1 { width: 80px; background: linear-gradient(to top, rgba(255,230,120,.95), rgba(255,230,120,0)); }
.beam.t2 { width: 100px; background: linear-gradient(to top, rgba(255,160,60,.95), rgba(255,200,80,0)); }
.beam.t3 { width: 130px; background: linear-gradient(to top, rgba(255,215,0,1), rgba(255,240,150,0)); }
.beam.t4 { width: 160px; background: linear-gradient(to top, rgba(255,94,126,.9), rgba(255,216,74,.8) 25%, rgba(107,227,143,.7) 50%, rgba(90,176,255,.5) 75%, rgba(192,132,252,0)); }
.confetti { position: absolute; z-index: 9; border-radius: 2px; }
.confetti.coin { border-radius: 50%; box-shadow: inset -2px -2px 0 rgba(0,0,0,.25), inset 2px 2px 0 rgba(255,255,255,.5); }
.flash { position: absolute; inset: 0; z-index: 30; pointer-events: none; mix-blend-mode: screen; }
.rays { position: absolute; width: 520px; height: 520px; z-index: 3; pointer-events: none; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255,240,150,.55) 0 10deg, rgba(255,240,150,0) 10deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 70%); mask: radial-gradient(circle, #000 25%, transparent 70%); }
.rays.rainbow { background: repeating-conic-gradient(#ff5e7e99 0 8deg, #0000 8deg 15deg, #ffd84a99 15deg 23deg, #0000 23deg 30deg, #6be38f99 30deg 38deg, #0000 38deg 45deg, #5ab0ff99 45deg 53deg, #0000 53deg 60deg); }
.stamp { position: absolute; left: 50%; top: 42%; z-index: 12; text-align: center; pointer-events: none; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.stamp b { font: 900 84px/1 'Arial Black', Impact, sans-serif; color: #ffd700; -webkit-text-stroke: 4px #6b3a10; text-shadow: 0 6px 0 #6b3a10, 0 0 30px #ffd700; }
.stamp small { font-size: 34px; font-weight: 900; color: #fff; -webkit-text-stroke: 2px #6b1a60; margin-top: 6px; }
.stamp.rainbow b { background: linear-gradient(90deg,#ff5e7e,#ffd84a,#6be38f,#5ab0ff,#c084fc); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 3px #fff; text-shadow: none; filter: drop-shadow(0 5px 0 #3a1a60) drop-shadow(0 0 20px #fff); }
#app.dim #stage::after { content: ''; position: absolute; inset: -20px; background: rgba(0,0,0,.45); z-index: 2; pointer-events: none; }
.float.chestmult.t3 { font-size: 34px; color: #ffd700; } .float.chestmult.t4 { font-size: 36px; color: #fff; -webkit-text-stroke: 1.5px #c0247a; }

/* ---------- 생성 이미지 적용 ---------- */
#bg { background: #7cc0ea url('../assets/ui/bg.jpg') center bottom / cover no-repeat; }
#bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 45%, rgba(0,0,0,.25)); }
#logo { transform: none; padding: 0; margin-right: auto; width: 150px; height: 64px; display: flex; align-items: center; }
#logo img { width: 150px; height: auto; margin-top: 6px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.35)); }
.slot-item img, .flypick img, .flypick .pick-spin img, .icbox .ic img { width: 100%; height: 100%; object-fit: contain; display: block; -webkit-user-drag: none; }
.slot-item img, .flypick img { filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.chest { padding: 0 1px; }
#topbar { position: relative; z-index: 10; }
#logo { width: auto; height: 64px; }
#logo img { width: auto; height: 78px; margin-top: 4px; }

/* =========================================================
   UI 이미지 적용 + 칸 간격 정리
   - 칸 크기 56px, 칸 사이 간격 4px (슬롯·블록판 동일)
   - 슬롯 틀과 블록판 틀 두께 10px, 두 틀 사이 4px
   ========================================================= */
:root { --gap: 24px; --fpad: 10px; --cellgap: 2px; }
#stage { height: calc(var(--cell) * 9 + var(--gap)); }
#board, #gauge { top: calc(var(--cell) * 3 + var(--gap)); }
#middle { margin-top: 18px; }
#stage, #chests { margin-left: 24px; }

/* 슬롯 틀 (금색) */
#slot::before { inset: calc(var(--fpad) * -1); border: 10px solid transparent; border-radius: 0; background: none; box-shadow: 0 4px 0 rgba(0,0,0,.25);
  border-image: url('../assets/ui/frame_gold.png') 9% fill / 10px stretch; }
.slot-cell { padding: var(--cellgap); }
.slot-cell::before { inset: var(--cellgap); border-radius: 0; box-shadow: none; background: url('../assets/ui/cell_slot.png') center / 100% 100% no-repeat; }
.slot-item { inset: 6px; }

/* 블록판 틀 (나무) */
#board { background: #2a1a0e; }
#board::before { inset: calc(var(--fpad) * -1); border: 10px solid transparent; border-radius: 0; background: none; box-shadow: 0 4px 0 rgba(0,0,0,.3);
  border-image: url('../assets/ui/frame_wood.png') 21% fill / 10px stretch; }
.hole { border: 0; background: url('../assets/ui/cell_hole.png') center / calc(100% - 4px) calc(100% - 4px) no-repeat; }
.block { padding: var(--cellgap); }

/* 보물상자 줄: 블록판 열과 정확히 맞춤 */
#chests { margin-top: 16px; height: 56px; }
.chest { width: var(--cell); height: 56px; padding: 2px 3px; }
#chests::after { left: -12px; right: -12px; bottom: -6px; height: 16px; background: linear-gradient(#b07a40, #6b4318); border: 2px solid #3b2410; border-radius: 6px; }

/* 오른쪽 버튼 */
#rightcol { width: 84px; gap: 16px; }
.sidebtn { width: 60px; height: 60px; border: 0; border-radius: 0; box-shadow: none; position: relative; background: center / contain no-repeat; filter: drop-shadow(0 3px 2px rgba(0,0,0,.35)); }
.sidebtn .ico { display: none; }
.sidebtn small { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); font-size: 10px; font-weight: 900; color: #fff; -webkit-text-stroke: 3px #0e2d66; paint-order: stroke fill; }
#btnMenu { background-image: url('../assets/ui/btn_menu.png'); }
#btnHelp { background-image: url('../assets/ui/btn_help.png'); }
#btnPrizes { background-image: url('../assets/ui/btn_cards.png'); }
#btnBag { background-image: url('../assets/ui/btn_bag.png'); }
#gaugeTrack { border: 3px solid #c99a55; box-shadow: 0 0 0 2px #3b2410; width: 16px; }
.speedbtn { top: calc(var(--cell) * 9 + var(--gap) + 18px); width: 46px; height: 46px; border: 0; border-radius: 50%; color: transparent; font-size: 0; background: url('../assets/ui/btn_speed.png') center / contain no-repeat; filter: drop-shadow(0 3px 2px rgba(0,0,0,.35)); }
.speedbtn.on { background: url('../assets/ui/btn_speed.png') center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 0 6px #ffe14a) drop-shadow(0 0 12px #ffb000) brightness(1.15); }

/* 상단 포인트 */
.pill .coin { background: url('../assets/ui/coin.png') center / contain no-repeat; border: 0; width: 34px; height: 34px; }
.pill .plus { width: 30px; height: 30px; border: 0; color: transparent; font-size: 0; background: url('../assets/ui/btn_charge.png') center / contain no-repeat; }

/* 하단 패널 (나무 틀) */
#panel { margin-top: 18px; height: 116px; background: none; border: 22px solid transparent; border-radius: 0; box-shadow: none; padding: 0;
  border-image: url('../assets/ui/frame_wood.png') 21% fill / 22px stretch; filter: drop-shadow(0 4px 3px rgba(0,0,0,.35)); }
.roundbtn { width: 44px; height: 44px; border: 0; color: transparent; font-size: 0; background: center / contain no-repeat; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.roundbtn.minus { background: url('../assets/ui/btn_minus.png') center / contain no-repeat; border: 0; }
.roundbtn.plus { background-image: url('../assets/ui/btn_plus.png'); }
#betBox { height: 62px; border: 3px solid #c99a55; }
#betBox b { font-size: 24px; }
#btnPlay { position: relative; width: 92px; height: 92px; margin: -14px -6px -14px 0; border: 0; box-shadow: none; background: url('../assets/ui/btn_play.png') center / contain no-repeat; filter: drop-shadow(0 4px 3px rgba(0,0,0,.4)); }
#btnPlay .tri { display: none; }
#btnPlay small { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); font-size: 12px; -webkit-text-stroke: 3px #6b0610; paint-order: stroke fill; }
#panelPlay .info div { padding: 4px 8px; }
.scorebox { height: 70px; }
/* 오른쪽 버튼 3개가 슬롯 높이 안에 들어가도록 */
#rightcol { gap: 12px; }
#rightcol .sidebtn { width: 52px; height: 52px; }
#topbar .sidebtn { width: 58px; height: 58px; }
.glabel { left: 2px; }

/* ---------- 상단 바 정렬 (사용자 피드백 #23) ----------
   - 왼쪽 끝을 슬롯 틀과 맞추고, 메뉴 버튼은 오른쪽 버튼 열 가운데에 맞춤
   - 로고가 슬롯 틀 위로 삐져나오지 않게 높이 제한 */
#topbar { margin-left: 14px; width: calc(var(--cell) * 5 + 10px + 12px + 84px); height: 74px; gap: 10px; }
#logo { height: 74px; width: auto; margin-right: 0; flex-shrink: 0; }
#logo img { height: 70px; margin-top: 0; }
#pointsPill { flex: 1; justify-content: space-between; min-width: 0; }
#topbar #btnMenu { flex-shrink: 0; margin-right: 13px; }
#middle { margin-top: 16px; }
.pcards { flex-wrap: wrap; }
.pcard { width: calc(33.3% - 6px); }
.pcard .card { width: 100%; }
.pcard small b { color: #c2410c; }

/* ---------- 슬롯 릴 ---------- */
#slot { overflow: visible; }
.reel { position: absolute; top: 0; width: var(--cell); height: calc(var(--cell) * 3); overflow: hidden; z-index: 2; }
.reel-strip { position: absolute; left: 0; top: 0; width: 100%; will-change: transform; }
.reel-cell { width: var(--cell); height: var(--cell); padding: 6px; }
.reel-cell img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.reel::before, .reel::after { content: ''; position: absolute; left: 0; right: 0; height: 14px; z-index: 1; pointer-events: none; }
.reel::before { top: 0; background: linear-gradient(rgba(120,80,30,.35), transparent); }
.reel::after { bottom: 0; background: linear-gradient(transparent, rgba(120,80,30,.35)); }
/* ---------- 타격 파편 ---------- */
.chip-debris { position: absolute; z-index: 8; border-radius: 1px; box-shadow: inset -1px -1px 0 rgba(0,0,0,.35); }
.spark { position: absolute; z-index: 8; width: 34px; height: 34px; pointer-events: none;
  background: radial-gradient(circle, #fff 0 18%, rgba(255,250,200,.9) 30%, rgba(255,240,150,0) 62%);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }
.dust { position: absolute; z-index: 8; width: 40px; height: 22px; border-radius: 50%; pointer-events: none; background: radial-gradient(ellipse, rgba(220,200,170,.85), rgba(220,200,170,0) 70%); }
#fx { z-index: 15; } #stage { overflow: visible; } .flypick { z-index: 16; }

/* ---------- 시작 화면 ---------- */
#title { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; cursor: pointer;
  background: rgba(20, 10, 0, .35) url('../assets/ui/bg.jpg') center / cover no-repeat; background-blend-mode: multiply; transition: opacity .5s, transform .5s; }
#title.out { opacity: 0; transform: scale(1.08); pointer-events: none; }
.title-glow { position: absolute; width: 640px; height: 640px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(rgba(255,240,170,.28) 0 9deg, rgba(255,240,170,0) 9deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%); animation: spinGlow 18s linear infinite; }
@keyframes spinGlow { to { transform: rotate(360deg); } }
.title-logo { position: relative; width: min(78vw, 360px); filter: drop-shadow(0 8px 6px rgba(0,0,0,.45)); animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-1deg); } }
.title-sub { position: relative; padding: 4px 18px; border-radius: 20px; background: linear-gradient(#5ccb35, #2f8a1a); border: 3px solid #fff; color: #fff; font-weight: 900; letter-spacing: 2px; box-shadow: 0 3px 0 #1b5a0e; }
#btnStart { position: relative; margin-top: 26px; width: min(80vw, 330px); height: 92px; border-radius: 50px; border: 5px solid #fff;
  background: linear-gradient(#ff6b6b, #d4142e 60%, #a80d22); box-shadow: 0 0 0 5px #8a0d1c, 0 9px 0 #5a0610, 0 14px 24px rgba(0,0,0,.45), inset 0 4px 0 rgba(255,255,255,.45);
  animation: pulse 1.3s ease-in-out infinite; overflow: hidden; }
#btnStart span { font: 900 38px/1 'Arial Black', Impact, sans-serif; color: #fff; letter-spacing: 2px; -webkit-text-stroke: 2px #6b0610; paint-order: stroke fill; text-shadow: 0 4px 0 #6b0610; }
#btnStart::after { content: ''; position: absolute; top: 0; bottom: 0; width: 60px; left: -80px; background: linear-gradient(100deg, transparent, rgba(255,255,255,.7), transparent); animation: shine 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
@keyframes shine { 0%, 40% { left: -80px; } 100% { left: 110%; } }
#btnStart:active { transform: translateY(5px) scale(.98); box-shadow: 0 0 0 5px #8a0d1c, 0 3px 0 #5a0610; }
.title-hint { position: relative; margin-top: 10px; color: #fff; font-weight: 800; font-size: 15px; text-shadow: 0 2px 3px #000; animation: blink 1.4s infinite; }
.title-sparkles { position: absolute; inset: 0; pointer-events: none; }
.title-sparkles i { position: absolute; width: 14px; height: 14px; background: #fff8c0;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); animation: twinkle 3s ease-in-out infinite; opacity: 0; }
@keyframes twinkle { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }

/* ---------- 모드 선택 (타이틀) ---------- */
#title[hidden] { display: none; }
.mode-select { position: relative; display: flex; gap: 14px; margin-top: 4px; }
.mode-btn { width: min(40vw, 158px); padding: 10px 8px 9px; border-radius: 16px; background: rgba(255,250,235,.92); border: 4px solid #e6d3a8;
  display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: 0 5px 0 rgba(0,0,0,.25); transition: transform .15s; opacity: .8; }
.mode-btn b { font: 900 26px/1 'Arial Black', Impact, sans-serif; letter-spacing: 1px; }
.mode-btn[data-mode=mild] b { color: #2f8a1a; } .mode-btn[data-mode=hard] b { color: #c81e3a; }
.mode-btn small { font-size: 11px; line-height: 1.35; color: #6b4a1a; font-weight: 700; }
.mode-btn .meter { display: flex; gap: 3px; padding: 3px 5px; background: #2a1a0e; border-radius: 6px; }
.mode-btn .meter i { width: 14px; height: 10px; border-radius: 2px; background: #555; }
.mode-btn[data-mode=mild] .meter i.lit { background: #6bdc3a; }
.mode-btn[data-mode=hard] .meter i.lit { background: linear-gradient(90deg, #ffb02e, #ff3b30); }
.mode-btn.on { opacity: 1; transform: translateY(-4px) scale(1.05); }
.mode-btn.on[data-mode=mild] { border-color: #5ccb35; box-shadow: 0 0 0 3px #fff, 0 0 18px #6bdc3a, 0 6px 0 rgba(0,0,0,.25); }
.mode-btn.on[data-mode=hard] { border-color: #ff3b30; box-shadow: 0 0 0 3px #fff, 0 0 18px #ff5e3a, 0 6px 0 rgba(0,0,0,.25); }
#btnStart { margin-top: 14px; }
/* 게임 화면 모드 배지 */
#logo { position: relative; }
#modeBadge { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); padding: 1px 8px; border-radius: 10px; font: 900 11px/1.3 Arial, sans-serif; color: #fff; border: 2px solid #fff; letter-spacing: 1px; box-shadow: 0 2px 0 rgba(0,0,0,.3); }
#modeBadge.mild { background: #2f8a1a; } #modeBadge.hard { background: #c81e3a; }
.modetag { padding: 1px 8px; border-radius: 8px; color: #fff; font-size: 11px; margin-right: 4px; }
.modetag.mild { background: #2f8a1a; } .modetag.hard { background: #c81e3a; }

/* ---------- 랭킹 ---------- */
#btnRank { background-image: url('../assets/ui/btn_rank.png'); }
#topbar .sidebtn { width: 52px; height: 52px; }
#topbar #btnMenu { margin-right: 4px; }
#topbar { gap: 6px; }
.pt-col { min-width: 74px; }
.pt-col b { font-size: 15px; }
.rlist { display: flex; flex-direction: column; gap: 6px; }
.rrow2 { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #fffdf8; border: 2px solid #eadbc0; }
.rrow2.me { border-color: #f5c518; background: #fff6d0; }
.rrow2 .rk { width: 30px; text-align: center; font-size: 20px; font-weight: 900; color: #8a6a3a; }
.rrow2 .rn { flex: 1; font-weight: 900; font-size: 16px; }
.rrow2 .rs { display: flex; flex-direction: column; align-items: flex-end; }
.rrow2 .rs b { font-size: 17px; color: #8a4a00; } .rrow2 .rs small { font-size: 11px; color: #8a6a3a; }
.frow { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #eadbc0; font-size: 13px; }
.frow .chip { flex-shrink: 0; border: 0; border-radius: 10px; }
.frow small { color: #8a6a3a; }
.inp { width: 100%; padding: 12px; margin: 6px 0; border-radius: 10px; border: 3px solid #eadbc0; font-size: 17px; font-family: inherit; }
.rowbtn.gold { background: #f5c518; }
.who { position: relative; margin-top: 4px; padding: 6px 14px; border-radius: 16px; background: rgba(0,0,0,.45); color: #fff; font-size: 13px; }
#news { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.news-item { padding: 9px 16px; border-radius: 22px; background: linear-gradient(90deg, #6a3fd6, #d4142e); color: #fff; font-weight: 800; font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,.35); border: 2px solid #fff; animation: newsIn .35s ease-out; text-align: center; transition: opacity .4s, transform .4s; }
.news-item.out { opacity: 0; transform: translateY(-12px); }
@keyframes newsIn { from { transform: translateY(-20px); opacity: 0; } }
#btnStart span { white-space: nowrap; font-size: clamp(26px, 9vw, 38px); }
/* 팝업은 시작 화면보다 위에 (닉네임 입력 창이 시작 화면 뒤에 가려지던 문제) */
#overlay { z-index: 120; }
.zoom { z-index: 140; }
#news { z-index: 150; }
/* 입력 창이 있는 작은 팝업은 위쪽에 띄워서 휴대폰 키보드에 가리지 않게 */
#overlay:has(.inp) { align-items: flex-start; padding-top: 8vh; }

/* ---------- 카드 일러스트 ---------- */
.card-art { background: radial-gradient(circle at 50% 42%, #fff 0%, #fff 38%, var(--l) 100%); overflow: hidden; }
.card-art img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; display: block; }
.card.grade-B .card-art, .card.grade-A .card-art { background: radial-gradient(circle at 50% 42%, #fff 0%, #fff 30%, var(--l) 75%, var(--m) 100%); }
/* S상 풀아트: 그림이 카드 전체, 금테 */
.card.full { padding: 4px; background: linear-gradient(145deg, #fff6c0, #e0a800 30%, #fff3b0 50%, #b8860b 70%, #ffe680); }
.card.full .card-full { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: cover; border-radius: 5px; }
.card.full .card-in { position: relative; background: none; justify-content: space-between; padding: 4px; }
.card.full .card-namebar { background: linear-gradient(transparent, rgba(0,0,0,.75) 35%); margin: 0 -4px -4px; padding: 14px 4px 4px; border-radius: 0 0 5px 5px; }
.card.full .card-name { font-size: 1.15em; color: #fff3b0; }
.card.full .card-stars { color: #fff3b0; }

/* 토스트는 팝업보다 위에 */
body > #toast { position: fixed; bottom: 18vh; z-index: 160; }

/* ---------- 등급별 카드 테두리 ---------- */
.card.grade-G, .card.grade-F { background: #e9e4da; }
.card.grade-E, .card.grade-D { background: linear-gradient(145deg, #f3c9a0, #b06d34 45%, #f0bf90 60%, #8a4f22); }
.card.grade-C, .card.grade-B { background: linear-gradient(145deg, #ffffff, #b8bec8 45%, #f4f6fa 60%, #8e96a3); }
.card.grade-A { background: linear-gradient(145deg, #fff3b0, #d9a520 45%, #fff3b0 60%, #b8860b); }
.card.full.grade-S { background: conic-gradient(from 0deg, #ff5e7e, #ffd84a, #6be38f, #5ab0ff, #c084fc, #ff5e7e); animation: sframe 4s linear infinite; }
@keyframes sframe { to { filter: hue-rotate(360deg); } }
.card.full.grade-S .card-full, .card.full.grade-S .card-in { animation: sframeBack 4s linear infinite; }
@keyframes sframeBack { to { filter: hue-rotate(-360deg); } }

/* ---------- 도감 ---------- */
#bagTabs { display: flex; flex-direction: column; height: 100%; }
.dex-total { text-align: center; font-size: 15px; margin: 2px 0 8px; }
.dex-total b { font-size: 22px; color: #8a4a00; } .dex-total small { color: #8a6a3a; }
.dex-total .bar { height: 10px; border-radius: 6px; background: #ece0cc; margin: 6px 10px 0; overflow: hidden; }
.dex-total .bar i { display: block; height: 100%; background: linear-gradient(90deg, #f5c518, #ff8a00); }
.dex-tiers { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.dex-tiers::-webkit-scrollbar { display: none; }
.dex-tiers button { flex-shrink: 0; padding: 6px 10px; border-radius: 10px; background: #ece0cc; font-weight: 800; font-size: 12px; color: #7a6040; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.dex-tiers button small { font-size: 10px; opacity: .8; }
.dex-tiers button.on { background: #f5c518; color: #3a2410; }
.dex-tiers button.done { box-shadow: inset 0 0 0 2px #2f8a1a; }
.dex-title { margin: 8px 0 6px; text-align: center; }
.dex-title small { color: #8a6a3a; font-size: 13px; }
.dex-done { color: #2f8a1a; font-size: 14px; }
.dex-row { margin-bottom: 10px; }
.dex-row .chip { font-size: 12px; padding: 1px 8px; margin-bottom: 4px; }
.dex-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.dexcard { text-align: center; font-size: 9px; line-height: 1.2; cursor: pointer; }
.dexcard .card { width: 100%; font-size: 6px; padding: 3px; }
.dexcard small { display: block; margin-top: 2px; color: #6b4a1a; }
.dexcard.none { cursor: default; }
.card-back { aspect-ratio: 63 / 88; border-radius: 6px; background: repeating-linear-gradient(45deg, #3a2a50 0 6px, #2c1f3e 6px 12px); border: 3px solid var(--gc); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; opacity: .55; }
.card-back b { font-size: 22px; line-height: 1; } .card-back span { font-size: 9px; font-weight: 800; }

/* 충전 + 버튼은 관리자에게만 보임 */
body:not(.admin) .pill .plus { display: none; }
#gNick { background: #fff; }

/* ---------- 출석 체크 ---------- */
.daily { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.dday { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 10px; background: #fff; border: 2px solid #eadbc0; font-size: 12px; }
.dday small { font-size: 10px; color: #8a6a3a; font-weight: 800; }
.dday .coin { width: 26px; height: 26px; background: url('../assets/ui/coin.png') center / contain no-repeat; }
.dday b { font-size: 12px; }
.dday.big { grid-column: span 2; background: linear-gradient(#fff6d0, #ffe18a); border-color: #e0a92b; }
.dday.big .coin { width: 36px; height: 36px; }
.dday.today { border-color: #f5c518; box-shadow: 0 0 0 3px #f5c51866, 0 0 12px #f5c518; animation: pulse 1.2s ease-in-out infinite; }
.dday.got { opacity: .55; }
.dday i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 30px; color: #2f8a1a; font-style: normal; font-weight: 900; }
.rowbtn.big { font-size: 17px; padding: 14px; }
/* 광산 탭이 옆으로 숨지 않게 여러 줄로 (도감·상품 목록) */
.dex-tiers { flex-wrap: wrap; overflow: visible; justify-content: center; }
.dex-tiers button { flex: 0 0 calc(25% - 5px); padding: 5px 2px; }
#prizeTabs .tabs { flex-wrap: wrap; overflow: visible; justify-content: center; }
#prizeTabs .tabs button { flex: 0 0 calc(25% - 5px); padding: 7px 2px; font-size: 12px; }
#rankTabs { display: flex; flex-direction: column; height: 100%; }
#rankTabs .tabs { flex-wrap: wrap; overflow: visible; justify-content: center; }
#rankTabs .tabs button { flex: 0 0 calc(33.3% - 5px); padding: 7px 2px; font-size: 12px; }
/* 제작자 표시: 타이틀 상단 + 게임 화면 하단 */
#title .maker { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 7px 18px; border-radius: 999px; background: rgba(40, 20, 6, .72); border: 2px solid rgba(255, 214, 110, .75); box-shadow: 0 3px 10px rgba(0,0,0,.35); font-size: 17px; font-weight: 700; color: #fff; letter-spacing: .02em; pointer-events: none; z-index: 2; }
#title .maker b { color: #ffd54a; font-weight: 900; font-size: 19px; }
.maker-game { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; pointer-events: none; }
.maker-game { font-size: 14px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000, 0 0 6px rgba(0,0,0,.6); }
.maker-game b { color: #ffd54a; font-weight: 900; }

/* 등급 표시(○상)는 한글이 예쁜 검은고딕으로 */
.chip, .card-back span { font-family: 'Black Han Sans', 'Malgun Gothic', sans-serif; font-weight: 400; letter-spacing: .5px; }
.chip.big small { font-family: 'Pretendard', 'Malgun Gothic', sans-serif; font-weight: 700; }

/* 시간 선물 배지 (포인트 칸 아래) */
#pointsPill { position: relative; }
#giftBadge { position: absolute; left: 50%; bottom: -19px; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 800; line-height: 1; padding: 4px 9px; border-radius: 999px; background: #5b3a12; color: #ffe9b0; border: 2px solid #e0a92b; pointer-events: none; z-index: 3; }
#giftBadge.ready { background: linear-gradient(#ff5a4e, #d81b2c); color: #fff; border-color: #ffe14a; animation: giftPulse 0.9s ease-in-out infinite alternate; }
@keyframes giftPulse { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.12); } }

/* 업데이트 완료 알림 (화면 가운데) */
.upd-done { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 400; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 26px; min-width: 260px; max-width: 86vw; border-radius: 18px; background: rgba(30, 16, 4, .92); border: 3px solid #ffd54a; box-shadow: 0 8px 30px rgba(0,0,0,.45), 0 0 24px rgba(255, 213, 74, .45); color: #fff; text-align: center; transition: opacity .45s, transform .45s; }
.upd-done b { white-space: nowrap; font-family: 'Black Han Sans', 'Malgun Gothic', sans-serif; font-weight: 400; font-size: 26px; color: #ffd54a; letter-spacing: 1px; }
.upd-done span { font-size: 15px; font-weight: 700; line-height: 1.4; word-break: keep-all; }
.upd-done.out { opacity: 0; transform: translate(-50%, -60%); }

/* 시간 선물 배지 크게 */
#giftBadge { bottom: -26px; font-size: 15px; font-weight: 800; padding: 6px 14px; border-width: 2px; background: linear-gradient(#7a4a12, #4a2a08); color: #ffe9b0; box-shadow: 0 3px 8px rgba(0,0,0,.4); }
#giftBadge b { color: #fff; font-size: 16px; font-variant-numeric: tabular-nums; }
/* 상단 공지 크게 */
.news-item { font-size: 16px; padding: 12px 20px; line-height: 1.35; word-break: keep-all; }
#news { width: min(94vw, 460px); }
/* 포인트 카드 (선물) */
.card.pointcard { background: linear-gradient(145deg, #fff3b0, #f2b51b 50%, #ffe27a); }
.pointcard .pc-in { height: 100%; border-radius: 6px; background: radial-gradient(circle at 50% 38%, #fff8d6, #ffcc3a 70%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #6b3a10; text-align: center; }
.pointcard .pc-top { font-family: 'Black Han Sans', sans-serif; font-size: 1.2em; letter-spacing: 2px; color: #b5651d; }
.pointcard .pc-ico { font-size: 3em; line-height: 1.1; }
.pointcard .pc-val { font-family: 'Black Han Sans', sans-serif; font-size: 2em; line-height: 1; color: #8a3a00; }
.pointcard .pc-unit { font-weight: 900; font-size: 1.1em; }
.pointcard .pc-name { font-weight: 800; font-size: .95em; margin-top: 2px; }

/* 메뉴 단색 아이콘 */
.mico { flex-shrink: 0; vertical-align: -4px; margin-right: 8px; color: #7a4a10; }
.rowbtn { display: flex; align-items: center; justify-content: center; }
.slider span { display: flex; align-items: center; width: 96px; }

/* 이모지 대신 단색 아이콘 — 놓이는 곳마다 색 */
.news-item { display: flex; align-items: center; justify-content: center; gap: 8px; }
.news-item .mico { color: #fff; margin: 0; width: 22px; height: 22px; }
#giftBadge .mico { color: #ffd54a; width: 18px; height: 18px; margin-right: 5px; vertical-align: -4px; }
.upd-done b .mico { color: #ffd54a; width: 24px; height: 24px; margin-right: 6px; vertical-align: -3px; }
.dex-done .mico { width: 16px; height: 16px; margin-right: 3px; vertical-align: -3px; color: inherit; }
#btnWho .mico { color: #ffe9b0; width: 18px; height: 18px; margin-right: 6px; vertical-align: -4px; }
.daily .mico { width: 16px; height: 16px; margin: 0; color: #fff; }
.rowbtn.gold .mico { color: #3b2208; }
/* 랭킹 1~3등 메달 */
.medal { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; font-style: normal; font-family: 'Black Han Sans', sans-serif; font-size: 16px; color: #fff; border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); }
.medal.m1 { background: linear-gradient(160deg, #ffe27a, #e0a10f); color: #6b3a10; }
.medal.m2 { background: linear-gradient(160deg, #f1f3f6, #a5adb8); color: #3c4450; }
.medal.m3 { background: linear-gradient(160deg, #f6c79c, #c06f2c); }

/* 수익 랭킹: 마이너스 숨김 */
.rest-note { margin: 6px 0 2px; padding: 10px; border-radius: 12px; background: #f1e3c6; color: #7a5a2a; text-align: center; font-size: 13px; font-weight: 700; }
.rest-note b { color: #8a4a00; }
.only-me { font-style: normal; margin-right: 4px; padding: 1px 6px; border-radius: 8px; background: #e6d6b8; color: #7a5a2a; font-size: 10px; font-weight: 800; vertical-align: 2px; }

/* 출석·지원금 [기본 받기] [광고 보고 2배] (2026-11-16) */
.adpair { display: flex; gap: 8px; margin-top: 8px; }
.adpair .rowbtn { flex: 1 1 0; min-width: 0; margin: 0; flex-direction: column; gap: 2px; padding: 10px 6px; font-size: 15px; white-space: nowrap; }
.adpair .rowbtn.gold { color: #2a1a08; }
.adpair .rowbtn .l { display: inline-flex; align-items: center; gap: 4px; }
.adpair .rowbtn small { font-size: 13px; font-weight: 700; color: inherit; opacity: .8; }
