* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #10140e; color: #eef0e6; overscroll-behavior: none;
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; user-select: none; }
/* 크기 단위: 1rem = 10px × 화면 배율. 배율·전장 크기·세로/가로 배치는 js/layout.js가 기기 화면을 읽어 정한다. */
html { font-size: 10px; }
body { font-size: 1.6rem; }
#app { width: 100%; height: 100vh; height: 100dvh; display: grid; background: #1b2118; overflow: hidden;
  grid-template: "hud" auto "field" auto "info" minmax(0, 1fr) "actions" auto / minmax(0, 1fr);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#app.land { grid-template: "field hud" auto "field info" minmax(0, 1fr) "field actions" auto / auto minmax(0, 1fr); }
#hud { grid-area: hud; } #field { grid-area: field; } #info { grid-area: info; } #actions { grid-area: actions; }
#hud { display: flex; align-items: center; gap: 0.6rem; padding: calc(0.6rem + var(--vy, 0rem) * .4) 0.8rem; background: #141a12; border-bottom: 2px solid #2e3a27; }
.stat { flex: 1; min-width: 0; text-align: center; line-height: 1.15; }
.stat small { display: block; font-size: 1rem; color: #9aa68c; }
.stat b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stat.gold b { color: #ffd45e; }
.stat.warn b { color: #ff6b5e; }
button { font: inherit; color: inherit; border: 0; border-radius: 1rem; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .42; }
button:active:not(:disabled) { transform: translateY(1px); filter: brightness(1.15); }
.mini { width: 4.4rem; height: 4rem; background: #2e3a27; font-weight: 700; }
#field { display: block; touch-action: none; justify-self: center; align-self: center; }
#info { min-height: 0; overflow: auto; padding: 0.8rem 1rem; font-size: 1.3rem; background: #161c13; border-top: 2px solid #2e3a27; }
#info h3 { margin: 0 0 2px; font-size: 1.6rem; } #info h3 em { font-style: normal; font-size: 1.2rem; color: #9aa68c; margin-left: 0.6rem; }
#info p { margin: 2px 0; color: #c5cdb8; } #info .hint { color: #8b967e; }
#info .row { display: flex; gap: 0.8rem; margin-top: 0.6rem; } #info .row button { flex: 1; padding: calc(1rem + var(--vy, 0rem) * .6); font-weight: 700; }
.ok { background: #4c8a3c; } .no { background: #3a4234; } .sell { background: #7a3b32; }
.pv { font-size: 1.5rem; font-weight: 700; } .pv b { color: #ffd45e; }
#actions { display: flex; flex-wrap: wrap; gap: 0.6rem; padding: 0.8rem; background: #141a12; }
#actions .sub { flex: 1 1 100%; display: flex; gap: 0.6rem; }
.sm { flex: 1; min-width: 0; padding: calc(0.6rem + var(--vy, 0rem) * .5) 0.2rem; background: #2e3a27; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.sm span { font-weight: 700; font-size: 1.3rem; white-space: nowrap; } .sm small { font-size: 1.1rem; color: #ffe9a6; white-space: nowrap; }
.sm.go { background: #6a3f8a; } .stat.sup b { color: #8fd0ff; }
.gam { background: #6a3f8a; }
.big { flex: 1; padding: calc(1rem + var(--vy, 0rem)) 0.4rem; background: #4c8a3c; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.big span { font-weight: 800; font-size: 1.5rem; } .big small { font-size: 1.2rem; color: #ffe9a6; }
.big.alt { background: #7a6a2c; } .big.ghost { background: #2e3a27; flex: .8; } .big.ghost small { color: #9aa68c; }
#overlay { position: fixed; inset: 0; display: none; background: rgba(8, 11, 7, .93); overflow: auto; z-index: 5; }
#overlay.on { display: block; }
.panel { max-width: 52rem; margin: 0 auto; padding: calc(2rem + env(safe-area-inset-top)) calc(1.4rem + env(safe-area-inset-right)) calc(4rem + env(safe-area-inset-bottom)) calc(1.4rem + env(safe-area-inset-left)); }
.panel h1 { font-size: 3.2rem; margin: 2.6rem 0 0.4rem; text-align: center; letter-spacing: -1px; }
.panel h2 { font-size: 1.9rem; margin: 1.8rem 0 0.8rem; } .panel .sub { text-align: center; color: #9aa68c; margin: 0 0 1.8rem; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.card { padding: 1.4rem 1rem; text-align: left; border: 2px solid rgba(255, 255, 255, .18); }
.card b { font-size: 2rem; display: block; } .card small { display: block; margin-top: 0.4rem; font-size: 1.2rem; line-height: 1.35; opacity: .92; }
.card i { font-style: normal; font-size: 1.1rem; opacity: .75; display: block; margin-top: 0.6rem; }
.wide { display: block; width: 100%; padding: 1.4rem; margin-top: 1rem; font-weight: 800; font-size: 1.6rem; background: #4c8a3c; }
.wide.sec { background: #2e3a27; font-weight: 600; }
table { border-collapse: collapse; width: 100%; font-size: 1.2rem; } td, th { border: 1px solid #36422e; padding: 0.5rem 0.3rem; text-align: center; }
th { background: #232c1e; } .chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { padding: 0.3rem 0.7rem; border-radius: 9.9rem; background: #2e3a27; font-size: 1.2rem; }
.list p { margin: 0.4rem 0; font-size: 1.3rem; color: #c5cdb8; } .list b { color: #eef0e6; }
.up { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem 0; border-bottom: 1px solid #2e3a27; font-size: 1.3rem; }
.up div { flex: 1; } .up button { padding: 0.8rem 1.2rem; background: #7a6a2c; font-weight: 700; }
#toast { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); padding: 0.8rem 1.6rem; border-radius: 9.9rem; background: rgba(0, 0, 0, .8);
  font-weight: 700; font-size: 1.4rem; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 9; white-space: nowrap; }
#toast.on { opacity: 1; }
