* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #14201a; --panel: #1d2f26; --panel2: #243a2f; --ink: #eef3ec; --dim: #9db8a8;
  --gold: #f2c14e; --red: #e4572e; --accent: #57c98a;
  --wan: #7fb2e5; --tong: #6fce8b; --tiao: #f0a35e; --honor: #e58aa5;
}
body { background: var(--bg); color: var(--ink); font-family: "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif; }
#app { max-width: 560px; margin: 0 auto; padding: 12px 12px 40px; }
header h1 { font-size: 30px; letter-spacing: 2px; }
header h1 .en { font-size: 14px; color: var(--gold); letter-spacing: 3px; }
.sub { color: var(--dim); font-size: 13px; margin-top: 2px; }
section { margin-top: 12px; }
.label { font-size: 12px; color: var(--dim); margin-bottom: 6px; }
.hidden { display: none !important; }

#hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.hud-cell { background: var(--panel); border-radius: 8px; padding: 7px 4px; text-align: center; font-size: 12px; color: var(--dim); }
.hud-cell b { display: block; color: var(--ink); font-size: 16px; margin-top: 2px; }

#boss { background: #3a2320; border: 1px solid var(--red); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
#audit-bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; }
#audit-bar .bar { flex: 1; height: 10px; background: #241512; border-radius: 5px; overflow: hidden; }
#audit-fill { height: 100%; background: var(--red); width: 0%; transition: width .3s; }

#talisman-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tslot { background: var(--panel); border: 1px dashed #3d5a4a; border-radius: 8px; min-height: 58px; padding: 6px; font-size: 12px; text-align: center; color: var(--dim); }
.tslot.filled { border-style: solid; border-color: var(--gold); color: var(--ink); background: var(--panel2); }
.tslot.sealed { opacity: .45; border-color: var(--red); }
.tslot .tname { font-weight: 700; color: var(--gold); display: block; font-size: 13px; }
.tslot .tdesc { font-size: 11px; line-height: 1.35; display: block; margin-top: 2px; }

#ready-info { background: #26343f; border: 1px solid #4a7ca5; border-radius: 8px; padding: 8px 10px; font-size: 13px; }

#river-reveal { display: flex; gap: 8px; }
#claims { display: flex; flex-wrap: wrap; gap: 6px; }
button { font: inherit; cursor: pointer; border: none; border-radius: 8px; padding: 10px 14px; background: var(--accent); color: #0c1710; font-weight: 700; font-size: 15px; }
button.ghost { background: var(--panel2); color: var(--ink); border: 1px solid #3d5a4a; }
button.warn { background: var(--gold); }
button.danger { background: var(--red); color: #fff; }
button:disabled { opacity: .4; cursor: default; }
.claim-btn { background: var(--panel2); color: var(--gold); border: 1px solid var(--gold); font-size: 14px; padding: 8px 10px; }

.tile { width: 40px; height: 54px; border-radius: 6px; background: #f4efe2; color: #20301f; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; border: 2px solid transparent; position: relative; padding: 0; }
.tile.small { width: 26px; height: 36px; font-size: 12px; border-radius: 4px; }
.tile.suit0 { box-shadow: inset 0 -5px 0 var(--wan); }
.tile.suit1 { box-shadow: inset 0 -5px 0 var(--tong); }
.tile.suit2 { box-shadow: inset 0 -5px 0 var(--tiao); }
.tile.suit3 { box-shadow: inset 0 -5px 0 var(--honor); color: #8c2f4e; }
.tile.selected { border-color: var(--gold); transform: translateY(-6px); }
.tile.drawn { border-color: var(--accent); }
.tile .badge { position: absolute; top: -7px; right: -5px; font-size: 9px; background: var(--red); color: #fff; border-radius: 6px; padding: 1px 4px; }
.tile .badge.safe { background: #4a7ca5; }
.tile.gray { opacity: .45; }
.setbox { display: inline-flex; gap: 2px; background: var(--panel); padding: 4px; border-radius: 8px; margin: 0 6px 6px 0; vertical-align: top; }
.setbox .kind { font-size: 10px; color: var(--dim); align-self: center; margin-left: 3px; }
#hand { display: flex; flex-wrap: wrap; gap: 4px; }
#exposed { min-height: 10px; }
#river { display: flex; flex-wrap: wrap; gap: 3px; opacity: .85; }
#status { font-size: 14px; min-height: 22px; margin-bottom: 8px; }
#buttons { display: flex; flex-wrap: wrap; gap: 8px; }

#modal { position: fixed; inset: 0; background: rgba(5, 10, 8, .78); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 18px 10px; z-index: 10; }
#modal-card { background: var(--panel); border-radius: 12px; padding: 16px; width: 100%; max-width: 520px; }
#modal-card h2 { font-size: 20px; margin-bottom: 8px; }
#modal-card h3 { font-size: 15px; margin: 12px 0 6px; color: var(--gold); }
.opt-btn { display: block; width: 100%; text-align: left; margin-bottom: 8px; background: var(--panel2); color: var(--ink); border: 1px solid #3d5a4a; font-weight: 400; }
.opt-btn.sel { border-color: var(--gold); background: #31493b; }
.opt-btn .big { font-size: 17px; font-weight: 700; color: var(--gold); }
.settle-step { font-size: 14px; padding: 5px 8px; border-radius: 6px; background: var(--panel2); margin-bottom: 5px; display: flex; justify-content: space-between; gap: 10px; }
.settle-step .v { font-weight: 700; color: var(--gold); white-space: nowrap; }
.settle-total { font-size: 24px; text-align: center; margin: 12px 0; }
.shop-item { background: var(--panel2); border: 1px solid #3d5a4a; border-radius: 8px; padding: 10px; margin-bottom: 8px; font-size: 13px; }
.shop-item.sel { border-color: var(--gold); }
.shop-item .tname { color: var(--gold); font-weight: 700; font-size: 15px; }
details { margin-top: 14px; background: var(--panel); border-radius: 8px; padding: 10px; font-size: 13px; color: var(--dim); }
details summary { cursor: pointer; color: var(--ink); }
details input[type="number"] { width: 110px; padding: 4px; border-radius: 4px; border: 1px solid #3d5a4a; background: var(--bg); color: var(--ink); }
details button { padding: 6px 10px; font-size: 13px; margin: 4px 0; }
table.fan { border-collapse: collapse; margin: 6px 0; }
table.fan td { border: 1px solid #3d5a4a; padding: 3px 8px; font-size: 12px; }

body.juice .tile { transition: transform .12s; }
body.juice .pop { animation: pop .45s ease; }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.18); } 100% { transform: scale(1); } }
body.juice .pulse { animation: pulseBg .5s ease; }
@keyframes pulseBg { 0% { background: #3d5a2e; } 100% { background: var(--panel); } }
.final-score { font-size: 30px; color: var(--gold); text-align: center; margin: 8px 0; }
