:root {
  --green: #004442; --green-2: #0E5654; --lime: #CBE880; --gold: #84754E; --gold-l: #E8C36A;
  --paper: #EDF3F1; --ink: #1E2B2B; --muted: #5f6f6d;
  --kr: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--paper); color: var(--ink); font-family: var(--kr); min-height: 100%; }
body { padding-bottom: env(safe-area-inset-bottom); }
button { font-family: inherit; }
#top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; background: var(--green); color: #fff; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); }
#top[hidden] { display: none; }
#top img { width: 74px; }
#top .me { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; font-size: 15px; }
#top .me span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tchip { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 12px; font-weight: 800; color: var(--green); background: var(--tc, var(--lime)); white-space: nowrap; }
#top .sc { text-align: right; line-height: 1; }
#top .sc b { font-size: 22px; color: var(--lime); }
#top .sc small { font-size: 12px; margin-left: 2px; }
#tbar { position: fixed; top: 0; left: 0; right: 0; height: 5px; background: transparent; z-index: 11; }
#tbar i { display: block; height: 100%; width: 0; background: var(--lime); transition: width .25s linear; }
#tbar.warn i { background: #F0A27A; }
main { padding: 18px 16px 30px; max-width: 520px; margin: 0 auto; }
.kick { font-size: 12px; font-weight: 800; letter-spacing: .14em; color: var(--gold); }
h1 { font-size: 26px; font-weight: 900; line-height: 1.3; margin: 6px 0 4px; color: var(--green); letter-spacing: -.01em; }
h2 { font-size: 21px; font-weight: 900; line-height: 1.35; margin: 6px 0 12px; color: var(--green); }
.sub { color: var(--muted); font-size: 15px; line-height: 1.5; }
.card { background: #fff; border-radius: 18px; padding: 18px; box-shadow: 0 4px 18px rgba(0,68,66,.08); margin-top: 14px; }
label { display: block; font-weight: 800; font-size: 14px; margin: 18px 0 8px; color: var(--green); }
input[type=text], input[type=number], textarea { width: 100%; font: 700 18px var(--kr); padding: 14px; border: 2px solid #cfdcd8; border-radius: 14px; background: #fff; color: var(--ink); outline: none; }
input:focus, textarea:focus { border-color: var(--green); }
textarea { resize: none; height: 96px; line-height: 1.4; }
.btn { display: block; width: 100%; border: 0; border-radius: 16px; padding: 17px; font-size: 18px; font-weight: 900; background: var(--green); color: #fff; margin-top: 16px; cursor: pointer; transition: transform .1s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn.lime { background: var(--lime); color: var(--green); }
.btn:disabled { opacity: .4; }
.teams { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.teams button { border: 3px solid transparent; border-radius: 14px; padding: 14px 4px; font-size: 16px; font-weight: 900; color: var(--green); background: var(--tc); cursor: pointer; }
.teams button.on { border-color: var(--green); transform: scale(1.04); box-shadow: 0 6px 16px rgba(0,0,0,.15); }
.teams button small { display: block; font-size: 11px; font-weight: 700; opacity: .7; margin-top: 2px; }
.err { color: #b5462f; font-weight: 700; font-size: 14px; margin-top: 10px; min-height: 18px; }
.hero { text-align: center; padding: 26px 0 10px; }
.hero img { width: 120px; }
.hero .logo-bg { background: var(--green); display: inline-block; padding: 16px 22px; border-radius: 18px; }

.opts { display: grid; gap: 10px; margin-top: 8px; }
.opts.grid2 { grid-template-columns: 1fr 1fr; }
.opt { position: relative; display: flex; align-items: center; gap: 12px; min-height: 76px; border: 0; border-radius: 18px; padding: 14px 16px; background: var(--c); color: var(--green); font-size: 19px; font-weight: 900; text-align: left; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.12); transition: transform .1s, opacity .2s; }
.opt:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.opt .sym { font-size: 24px; width: 28px; text-align: center; opacity: .75; }
.opt img { width: 100%; border-radius: 10px; background: #fff; display: block; }
.opts.grid2 .opt { flex-direction: column; align-items: stretch; text-align: center; min-height: 0; }
.opt.sel { outline: 4px solid var(--green); outline-offset: 2px; }
.opt.sel::after { content: '✓'; position: absolute; right: 12px; top: 8px; font-size: 22px; }
.opt.dim { opacity: .35; }

.wait { text-align: center; padding: 40px 10px; }
.drop { width: 70px; height: 70px; margin: 0 auto 20px; background: var(--green); border-radius: 0 50% 50% 50%; transform: rotate(45deg); animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: rotate(45deg) translate(0,0); } 50% { transform: rotate(45deg) translate(-10px,-10px); } }
.big { font-size: 56px; font-weight: 900; color: var(--green); line-height: 1.1; }
.result { text-align: center; border-radius: 22px; padding: 30px 16px; margin-top: 10px; color: #fff; animation: popin .5s cubic-bezier(.2,.9,.3,1.4) both; }
.result.ok { background: var(--green); }
.result.ok .big { color: var(--lime); }
.result.no { background: #6b6f6e; }
.result.no .big { color: #fff; }
.result .em { font-size: 54px; }
.result p { margin-top: 8px; font-size: 16px; line-height: 1.5; }
@keyframes popin { 0% { transform: scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
.stat { display: flex; justify-content: center; gap: 22px; margin-top: 16px; }
.stat div { text-align: center; }
.stat b { display: block; font-size: 26px; color: var(--green); }
.stat small { color: var(--muted); font-size: 12px; }

.ab { display: grid; gap: 12px; }
.ab button { border: 0; border-radius: 20px; padding: 22px 18px; text-align: left; font-size: 19px; font-weight: 900; line-height: 1.35; cursor: pointer; min-height: 120px; position: relative; }
.ab button .L { display: block; font-size: 34px; line-height: 1; margin-bottom: 8px; }
.ab .a { background: var(--green); color: #fff; } .ab .a .L { color: var(--lime); }
.ab .b { background: #fff; color: var(--green); border: 3px solid var(--green); }
.ab button.sel { outline: 5px solid var(--gold-l); outline-offset: 3px; }
.ab button .p { position: absolute; right: 16px; top: 16px; font-size: 22px; }
.vbar { display: flex; height: 16px; border-radius: 10px; overflow: hidden; margin-top: 14px; background: #fff; }
.vbar i { background: var(--lime); transition: width .6s; }

.numpad { display: flex; gap: 8px; align-items: stretch; }
.numpad input { flex: 1; text-align: center; font-size: 34px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.steps button { border: 0; border-radius: 12px; padding: 12px 0; font-size: 17px; font-weight: 900; background: #fff; color: var(--green); box-shadow: 0 2px 0 #cfdcd8; }

.post { background: var(--lime); color: var(--green); border-radius: 14px; padding: 12px 14px; font-weight: 800; margin-top: 8px; font-size: 16px; }
.items { display: grid; gap: 10px; margin-top: 10px; }
.item { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 16px; padding: 14px; box-shadow: 0 2px 10px rgba(0,68,66,.06); }
.item .tx { flex: 1; font-weight: 800; font-size: 16px; line-height: 1.4; }
.item .tx small { display: block; font-weight: 600; color: var(--muted); font-size: 12px; margin-top: 3px; }
.item button { border: 0; background: #f3f3f3; border-radius: 14px; min-width: 64px; padding: 10px 8px; font-size: 18px; font-weight: 900; color: #c55; }
.item button.on { background: #F0A27A; color: #fff; }
.item.mine { opacity: .6; }
.hearts { text-align: center; font-weight: 800; margin-top: 4px; color: var(--green); }
.rank1 { font-size: 64px; text-align: center; }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #222; color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; z-index: 30; max-width: 90%; text-align: center; }
#toast[hidden] { display: none; }
#flash { position: fixed; inset: 0; pointer-events: none; z-index: 40; opacity: 0; }
#flash.ok { background: var(--lime); animation: fl .7s; }
#flash.no { background: #F0A27A; animation: fl .7s; }
@keyframes fl { 0% { opacity: .8; } 100% { opacity: 0; } }
.sec { text-align: center; padding: 50px 10px; }
.sec .r { font-size: 14px; letter-spacing: .3em; font-weight: 800; color: var(--gold); }
.sec .n { font-size: 96px; font-weight: 900; color: var(--green); line-height: 1; margin: 6px 0; }
.verdict { background: var(--green); color: #fff; border-radius: 18px; padding: 18px; margin-top: 14px; }
.verdict .v { color: var(--lime); font-size: 26px; font-weight: 900; }
.verdict .ru { font-weight: 800; font-size: 17px; margin: 8px 0; line-height: 1.4; }
.verdict .tp { font-size: 14px; opacity: .9; line-height: 1.5; }
