:root{font-family:"Noto Sans KR","Malgun Gothic",system-ui,sans-serif;color:#173b30;background:#f5f3ed;--green:#164d39;--gold:#d8b16a;--felt:#17553d;--dark:#0d3025}*{box-sizing:border-box}body{margin:0}button,select,a{font:inherit}button{cursor:pointer}button:disabled{cursor:default;opacity:.43;animation:none!important}button:focus-visible,a:focus-visible,select:focus-visible{outline:3px solid #e3a634;outline-offset:3px}[hidden]{display:none!important}#hw-root{max-width:1200px;margin:auto;padding:10px;overflow-wrap:break-word}body.embed{background:transparent}body.embed #hw-root{padding:4px}body.embed .hero{display:none}.hero{display:flex;justify-content:space-between;align-items:center;gap:14px;background:radial-gradient(ellipse at 100% 0,#33735a,#102f25 65%);border:1px solid #af9255;padding:22px;border-radius:20px;color:#fff;box-shadow:0 6px 0 #b8a07138}.hero h1{font-family:Georgia,serif;font-size:clamp(27px,5vw,48px);margin:5px 0;color:#fff1d0}.hero em{color:#e8c17a}.hero p{margin:4px 0;color:#d6e6db}.eyebrow{font-size:10px;letter-spacing:1.6px;color:#e8c17a;font-weight:800}.modes,.actions{display:flex;gap:9px;flex-wrap:wrap;align-items:center;margin:12px 0}.modes .pill{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-inline:8px}.pill{display:inline-flex;align-items:center;justify-content:center;min-height:42px;border-radius:999px;background:linear-gradient(#fff,#e4eee7);border:1px solid #a8beb0;box-shadow:0 4px 0 #9db2a3,0 6px 12px #173c2520,inset 0 1px 0 #fff;font-weight:800;color:#204c39;text-decoration:none;padding:8px 15px;font-size:clamp(12px,2vw,15px);transition:transform .12s,box-shadow .12s;white-space:normal}.pill.active,.pill.navy{background:linear-gradient(#45896b,#1c513d);color:white;box-shadow:0 4px 0 #103c2d;border-color:#245d47}.pill.gold{background:linear-gradient(#fff3c8,#d5a656);border-color:#b18a46;color:#42301a;box-shadow:0 4px 0 #8d6733,0 7px 12px #2e1f2022}.pill.red{background:linear-gradient(#e96958,#a52b28);color:#fff;box-shadow:0 4px 0 #742320;border-color:#a52b28}.pill:active:not(:disabled){transform:translateY(3px);box-shadow:0 1px 0 #81978a}.pulse{animation:hwPulse 2.4s ease-in-out infinite}@keyframes hwPulse{0%,100%{scale:1;filter:brightness(1)}50%{scale:1.02;filter:brightness(1.12)}}.panel{background:#fffdfa;border:1px solid #d8ded2;border-radius:16px;padding:clamp(10px,2vw,18px);margin:12px 0;box-shadow:0 3px 12px #193c2410;min-width:0}.panel h2{font-size:18px;margin:0 0 10px}.settings{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.settings label{display:grid;gap:4px;font-size:12px;font-weight:750;min-width:0}.settings select{width:100%;min-width:0;min-height:40px;border-radius:12px;border:1px solid #adbdad;background:linear-gradient(#fff,#edf3ed);box-shadow:0 2px 0 #b9c8ba;color:#244e39;padding:6px;font-weight:700;text-overflow:ellipsis}.micro{color:#66766b;font-size:11px;margin:8px 0 0}.board{border:3px solid #b18a4d;border-radius:20px;background:radial-gradient(ellipse at 50% 28%,#34805b,var(--felt) 62%,var(--dark));box-shadow:0 6px 0 #71502e,0 12px 20px #153c2829,inset 0 0 30px #0a2b2190;padding:clamp(8px,2vw,18px);color:#fff4d9;scroll-margin-top:100px}.boardhead{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 0 10px;font-size:14px}.boardhead strong{color:#f2d49b;font-size:clamp(16px,3vw,22px)}#status{background:#0d3025d9;border:1px solid #83ab8b55;padding:8px;border-radius:10px;font-size:13px;font-weight:700;margin-bottom:10px;min-height:38px}.opp-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.opp-row.one{grid-template-columns:1fr}.opp{background:#0b3026a8;border:1px solid #b9d1aa55;border-radius:10px;padding:6px;min-width:0}.opp-info,.hand-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:5px;font-size:12px;font-weight:800}.opp.current{border-color:#f2ca77;box-shadow:0 0 9px #e4bf6680}.backs{display:flex;gap:2px;justify-content:center;margin-top:5px;height:clamp(19px,4vw,37px)}.backs img{height:100%;min-width:0;max-width:9%;object-fit:contain}.field{margin:10px 0;padding:10px 6px 12px;background:#092e2440;border:1px solid #d1e0c24d;border-radius:13px}.field-head{display:flex;justify-content:space-between;gap:8px;font-size:12px;font-weight:750;margin:0 3px 9px}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(46px,76px));justify-content:center;gap:8px 6px;align-items:start;min-height:45px}.hand{padding:9px 5px 12px;border-top:1px solid #d6dbac55}.hand .cards{margin-top:9px;grid-template-columns:repeat(auto-fit,minmax(43px,76px))}.hwcard{padding:0;border:1px solid #121a17;background:#792b2b;border-radius:7px;box-shadow:0 4px 0 #48171c,0 6px 7px #0005;min-width:0;width:100%;display:block;position:relative;aspect-ratio:2/3;transition:transform .12s,filter .12s;overflow:hidden}.hwcard img{width:100%;height:100%;display:block;object-fit:contain}.hwcard:active:not(:disabled){transform:translateY(3px);box-shadow:0 1px 0 #48171c}.hwcard:disabled{opacity:1;cursor:default}.hwcard.match{outline:2px solid #ffd46e;box-shadow:0 3px 0 #9f7332,0 0 8px #ffd46e}.hwcard.chosen{outline:3px solid #fff3a2;transform:translateY(-3px)}.hwcard.gone{visibility:hidden}.hwcard.hint{outline:3px solid #6ef4bd}.choice-banner{padding:9px;margin:8px 0;border:1px solid #e6c17a;border-radius:10px;background:#0b3026;color:#ffdfa0;font-size:13px}.choice-banner .preview{width:48px;vertical-align:middle;margin-left:8px}#controls .actions{justify-content:center;margin-bottom:4px}#controls .pill{flex:1;max-width:240px}.memory-grid{display:grid;grid-template-columns:repeat(6,minmax(0,78px));gap:10px 7px;justify-content:center;padding:10px 0 16px}.memory-grid .hwcard{max-width:78px}.below{display:grid;grid-template-columns:1.7fr 1fr;gap:10px}.scorecard{padding:9px;border:1px solid #d7dfd4;border-radius:11px;margin-bottom:7px;background:#f3f7f1}.scorehead{display:flex;justify-content:space-between;gap:6px;font-weight:800}.scorehead strong{color:#226247}.chips{display:flex;flex-wrap:wrap;gap:4px;margin-top:7px}.chips span{padding:3px 7px;border:1px solid #d8e4d6;background:#fff;border-radius:99px;font-size:11px}.capture-groups{display:flex;flex-wrap:wrap;gap:7px;margin-top:7px}.capture-group{min-width:0}.capture-group small{display:block;font-size:10px;color:#586d60}.capture-group img{width:26px;margin-right:2px;border-radius:3px}.stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.stat{background:#f0f4ee;border-radius:10px;padding:9px;text-align:center}.stat b{display:block;font-size:20px;color:#20553d}.stat span{font-size:11px;color:#566b5e}.guide p,details{font-size:13px;line-height:1.7}summary{cursor:pointer;font-weight:800;padding:5px 0}.gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(48px,1fr));gap:5px}.gallery img{width:100%;display:block}.gallery span{display:block;text-align:center;font-size:10px}.result{background:#fff2cd;color:#3a2a18;border:1px solid #cda65a;padding:10px;border-radius:10px;text-align:center}.result strong{display:block;font-size:20px}.result p{margin:4px 0;font-size:12px}footer{text-align:center;font-size:11px;color:#68796b;padding:10px}body[data-theme=navy]{--felt:#24415f;--dark:#122b43}body[data-theme=red]{--felt:#803e36;--dark:#4b221f}body[data-theme=contrast]{--felt:#202020;--dark:#000;--gold:#fff}body[data-theme=contrast] .board{background:#151515;border-color:#fff}body[data-theme=contrast] .hwcard{border-color:#fff}body[data-theme=contrast] .panel{border-color:#111;color:#111}body[data-theme=contrast] .scorecard{background:#fff;border-color:#111}@media(max-width:650px){.below{grid-template-columns:1fr;gap:0}.settings{grid-template-columns:repeat(2,minmax(0,1fr))}.hero{padding:14px;flex-wrap:wrap}.cards,.hand .cards{grid-template-columns:repeat(5,minmax(0,1fr));gap:7px 5px}.memory-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:8px 5px}.actions{gap:7px}.actions .pill{padding:7px 10px;flex:1 1 27%;font-size:12px}.board{padding:8px}.opp-info{font-size:11px}.capture-group img{width:22px}}@media(max-width:340px){#hw-root{padding:4px}.modes{gap:5px}.modes .pill{font-size:11px;padding-inline:4px}.memory-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.board{padding:6px}.pill{font-size:11px}.cards,.hand .cards{gap:7px 4px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* V1.1 Real Classic: preserve original 103.2 × 168.2 ratio */
.hwcard{aspect-ratio:103.2/168.2;border-radius:5px;background:#7b1e25;border:1px solid #5a151b;box-shadow:0 3px 0 #6a1b20,0 5px 0 #451014,0 7px 8px #0006}
.hwcard img{object-fit:contain;background:#f9f0df;border-radius:3px;pointer-events:none}
.hwcard:active:not(:disabled){transform:translateY(3px);box-shadow:0 2px 0 #451014}
.hwcard.match{outline:2px solid #ffd46e;outline-offset:1px;box-shadow:0 3px 0 #9f7332,0 0 8px #ffd46e}
.hwcard.hint{outline:3px solid #6ef4bd;outline-offset:1px}
.gallery img,.capture-group img{aspect-ratio:103.2/168.2;object-fit:contain;background:#f9f0df;border-radius:3px}
.classic-notice{font-size:12px;line-height:1.45;color:#486655;margin:8px 0;padding:7px 10px;border:1px solid #c6d5c8;border-radius:10px;background:#f1f6ee}
footer a{color:inherit;text-decoration:underline}

/* V1.3: responsive original PNG ratio, image dimensions independent of network */
#hw-root{container-type:inline-size;min-width:0;width:100%} .board,.field,.hand,.below,.panel,.scorecard{min-width:0;max-width:100%} .board{isolation:isolate} .cards,.hand .cards{display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-start;gap:9px 6px;--card-w:clamp(40px,8.2cqw,106px)} .cards .hwcard{flex:0 0 var(--card-w);width:var(--card-w);max-width:100%} .hwcard{aspect-ratio:2151/3505;border-radius:clamp(3px,0.7cqw,7px);overflow:hidden;isolation:isolate} .hwcard img{width:100%;height:100%;object-fit:contain;display:block;max-width:100%;border-radius:inherit} .hwcard.chosen{outline-offset:1px} .memory-grid{grid-template-columns:repeat(6,minmax(0,94px));gap:10px 7px}.memory-grid .hwcard{max-width:94px} .choice-banner img{width:clamp(35px,8cqw,65px);height:auto;vertical-align:middle;margin-left:8px} .capture-group{max-width:100%;overflow-wrap:anywhere}.capture-group img{width:clamp(23px,4.4cqw,42px);height:auto;aspect-ratio:2151/3505;object-fit:contain} .gallery{grid-template-columns:repeat(auto-fit,minmax(min(100%,64px),1fr));gap:9px}.gallery img{aspect-ratio:2151/3505;height:auto;object-fit:contain}.gallery span{overflow-wrap:anywhere} .hero,.actions,.modes{min-width:0} .actions .pill,.modes .pill{min-width:0;max-width:100%;overflow-wrap:anywhere} .panel details{position:static;float:none;clear:both;overflow-wrap:anywhere} .hero img{flex:none;max-width:30%;height:auto} .hero>div{min-width:0} .boardhead strong{min-width:0;overflow-wrap:anywhere} .boardhead #clock{flex:none} .pill{position:relative;z-index:0} .actions{row-gap:12px;padding-bottom:5px} .classic-notice{overflow-wrap:anywhere} .backs img{max-width:9%;height:100%;width:auto} .backs{overflow:hidden}
@container (max-width:700px){.cards,.hand .cards{--card-w:min(100px,calc((100% - 24px)/5))}.below{grid-template-columns:1fr;gap:0}.settings{grid-template-columns:repeat(2,minmax(0,1fr))}.memory-grid{grid-template-columns:repeat(6,minmax(0,1fr))}.gallery{grid-template-columns:repeat(6,minmax(0,1fr))}.modes .pill{font-size:clamp(10px,2.7cqw,14px)}}
@container (max-width:360px){.cards,.hand .cards{--card-w:calc((100% - 16px)/5);gap:8px 4px}.memory-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.gallery{grid-template-columns:repeat(4,minmax(0,1fr))}.board{padding:6px}.modes .pill{font-size:11px;padding-inline:3px}.actions .pill{flex:1 1 28%;padding-inline:5px}.hero{flex-wrap:wrap}.hero h1{font-size:clamp(25px,9cqw,36px)}}

/* V1.4: compact table, accessible controls, natural document height */
:root{font-size:16px;line-height:1.5}body{min-width:0}#hw-root{height:auto;max-height:none;overflow:visible;padding-bottom:calc(16px + env(safe-area-inset-bottom,0px))}body.embed #hw-root{padding-bottom:18px}.board,.field,.hand,#table,#controls,.below{height:auto;max-height:none;overflow:visible}.board{padding:clamp(8px,1.4cqw,15px)}.boardhead{font-size:16px;padding:2px 0 8px}.boardhead strong{font-size:clamp(18px,2.5cqw,23px)}#status{font-size:16px;line-height:1.45;padding:9px 10px;margin-bottom:8px;border-color:#8db99c88}.opp-info,.hand-head,.field-head{font-size:15px;line-height:1.4}.field-head{flex-wrap:wrap;margin-bottom:8px}.field{padding:9px 5px 11px;margin:8px 0}.hand{padding:8px 5px 10px}.backs{height:clamp(20px,3cqw,28px)}.opp{padding:6px 8px}.cards,.hand .cards{--cols:5;--gap:5px;--cap:68px;--card-w:min(var(--cap),calc((100% - (var(--cols) - 1)*var(--gap))/var(--cols)));gap:9px var(--gap);min-height:32px}.cards .hwcard{flex:0 0 var(--card-w);width:var(--card-w);max-width:var(--card-w)}.hand .cards{margin-top:8px}.memory-grid{grid-template-columns:repeat(6,minmax(0,68px))}.memory-grid .hwcard{max-width:68px}.pill,.actions .pill,.modes .pill{font-size:15px;min-height:46px;line-height:1.3;padding:9px 13px;white-space:normal;overflow:visible;text-overflow:clip;text-align:center;word-break:keep-all;overflow-wrap:anywhere}.modes .pill{flex:1 1 28%;min-width:0}.actions .pill{flex:1 1 28%;min-width:0}.actions{gap:12px 8px}.settings label{font-size:15px;line-height:1.4}.settings select{font-size:15px;min-height:45px;padding:7px 5px}.micro,.classic-notice,footer{font-size:13px;line-height:1.5}.panel h2{font-size:21px;line-height:1.35}.guide p,details{font-size:16px;line-height:1.65}.scorehead{font-size:17px}.chips span{font-size:14px;font-weight:700;padding:4px 8px}.capture-group small,.stat span,.gallery span{font-size:13px}.stat b{font-size:23px}.result p,.choice-banner{font-size:15px}.panel summary{padding:9px 0}.eyebrow{font-size:12px}.hero p{font-size:16px}.panel h3{font-size:19px}.gallery{grid-template-columns:repeat(auto-fit,minmax(min(100%,65px),1fr))}.hero .pill{flex-shrink:0}.hero img{max-width:25%}
@container (min-width:480px){.cards,.hand .cards{--cols:8;--gap:6px;--cap:74px}.memory-grid{grid-template-columns:repeat(8,minmax(0,72px))}.memory-grid .hwcard{max-width:72px}.modes .pill{font-size:16px}}
@container (min-width:620px){.cards,.hand .cards{--cols:10;--gap:7px;--cap:76px}.settings{grid-template-columns:repeat(4,minmax(0,1fr))}.actions .pill{flex:1 1 auto}.memory-grid{grid-template-columns:repeat(8,minmax(0,76px))}.memory-grid .hwcard{max-width:76px}}
@container (min-width:950px){.cards,.hand .cards{--cap:82px}.board{max-width:1000px;margin-inline:auto}.below{max-width:1000px;margin-inline:auto}}
@container (max-width:360px){.cards,.hand .cards{--gap:4px;--cap:62px}.modes .pill,.actions .pill{font-size:14px;padding-inline:5px}.settings select{font-size:14px}.memory-grid{grid-template-columns:repeat(4,minmax(0,64px))}.opp-info,.hand-head,.field-head{font-size:14px}.boardhead strong{font-size:17px}.boardhead{font-size:15px}}
body[data-compact="1"] .cards,body[data-compact="1"] .hand .cards{--cap:60px}body[data-compact="1"] .board{padding:7px}body[data-compact="1"] .field{margin:6px 0;padding-block:6px 9px}body[data-compact="1"] .hand{padding-block:6px 9px}body[data-compact="1"] .backs{height:20px}body[data-compact="1"] #status{padding-block:6px;margin-bottom:6px}body[data-compact="1"] .memory-grid{grid-template-columns:repeat(8,minmax(0,60px))} @container (max-width:360px){body[data-compact="1"] .memory-grid{grid-template-columns:repeat(4,minmax(0,60px))}}
