:root { --ink: #1d2433; --paper: #fbf8f1; --gold: #e0a91b; --red: #d8343f; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #8fc6ef; font-family: "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", system-ui, sans-serif; color: var(--ink); user-select: none; -webkit-user-select: none; touch-action: none; }
canvas#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 34, 60, 0.45); z-index: 20; }
#title { background: radial-gradient(circle at 50% 30%, rgba(255,255,255,0.15), rgba(18,40,80,0.7)); }
.title-box { background: var(--paper); border-radius: 22px; padding: 26px 26px 18px; max-width: 520px; width: 100%; box-shadow: 0 0 0 8px #fff, 0 0 0 10px #c9b98f, 0 18px 50px rgba(0,0,0,0.35); text-align: center; max-height: 100%; overflow: auto; }
.logo { font-size: 34px; font-weight: 900; letter-spacing: 0.04em; line-height: 1.15; color: #1d3557; position: relative; }
.logo small { font-size: 20px; letter-spacing: 0.4em; color: #456; }
.logo .suit { font-size: 26px; position: relative; top: -6px; margin: 0 6px; }
.suit.s1, .suit.s4 { color: #222; } .suit.s2, .suit.s3 { color: var(--red); }
.lead { font-size: 14.5px; line-height: 1.7; margin: 14px 0 16px; }
.name { display: block; font-weight: bold; margin: 8px 0 12px; }
.name input { font: inherit; font-size: 18px; padding: 8px 12px; border-radius: 10px; border: 2px solid #c9b98f; width: 200px; margin-left: 6px; text-align: center; user-select: text; -webkit-user-select: text; }
button.big { font-size: 20px; font-weight: 900; padding: 12px 40px; border-radius: 14px; border: none; background: linear-gradient(#ffcf4a, #f0a91b); color: #4a2a00; box-shadow: 0 4px 0 #b97a0c; }
button.big:active { transform: translateY(3px); box-shadow: 0 1px 0 #b97a0c; }
button.big:disabled { filter: grayscale(0.8); opacity: 0.7; }
.status { min-height: 1.4em; font-size: 13px; color: #a33; margin-top: 8px; }
.howto { text-align: left; margin-top: 10px; font-size: 13px; }
.howto summary { cursor: pointer; font-weight: bold; text-align: center; }
.howto table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.howto td { padding: 3px 6px; border-bottom: 1px dashed #ddd; }
.howto td:first-child { white-space: nowrap; font-weight: bold; width: 40%; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud button, #hud #touch, #minimap { pointer-events: auto; }
#cross { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; }
#cross::before, #cross::after { content: ""; position: absolute; background: #fff; box-shadow: 0 0 2px #000; }
#cross::before { left: 10px; top: 3px; width: 2px; height: 16px; } #cross::after { top: 10px; left: 3px; height: 2px; width: 16px; }
#cross.on::before, #cross.on::after { background: #ffd23f; }
#target { position: absolute; left: 50%; top: calc(50% + 22px); transform: translateX(-50%); color: #fff; text-shadow: 0 1px 3px #000, 0 0 2px #000; font-size: 14px; text-align: center; white-space: nowrap; }
#target .bar { width: 90px; height: 5px; background: rgba(0,0,0,0.5); border-radius: 3px; margin: 3px auto 0; overflow: hidden; }
#target .bar i { display: block; height: 100%; background: #ffd23f; }
#prompt { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); background: rgba(0,0,0,0.55); color: #fff; padding: 6px 14px; border-radius: 10px; font-size: 15px; display: none; }
#hpbar { position: absolute; left: 16px; bottom: 16px; width: 220px; height: 22px; background: rgba(0,0,0,0.45); border-radius: 11px; overflow: hidden; border: 2px solid #fff; }
#hpfill { height: 100%; width: 100%; background: linear-gradient(#ff6b6b, #d8343f); transition: width 0.2s; }
#hptext { position: absolute; inset: 0; color: #fff; font-weight: bold; font-size: 13px; text-align: center; line-height: 18px; text-shadow: 0 1px 2px #000; }
.hudbtn { position: absolute; background: var(--paper); border: none; border-radius: 12px; padding: 6px 12px; box-shadow: 0 0 0 3px #fff, 0 3px 8px rgba(0,0,0,0.3); display: flex; align-items: center; gap: 6px; }
.hudbtn .ico { font-size: 22px; }
#binder-btn { right: 16px; bottom: 16px; font-weight: 900; font-size: 18px; }
#binder-btn small { font-weight: normal; font-size: 12px; color: #666; }
#binder-btn.bump { animation: bump 0.4s; }
@keyframes bump { 50% { transform: scale(1.18); } }
#mic-btn { right: 16px; bottom: 74px; font-size: 13px; }
#mic-btn.on { background: #d9ffe5; } #mic-btn.talk { background: #2bd46a; color: #fff; }
#online { position: absolute; right: 16px; top: 200px; color: #fff; font-size: 12px; text-shadow: 0 1px 2px #000; }
#minimap { position: absolute; right: 16px; top: 14px; width: 180px; height: 180px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.35); background: #2f6fb0; }
#feed { position: absolute; left: 16px; top: 14px; width: min(420px, 60vw); display: flex; flex-direction: column; gap: 4px; }
#feed div { background: rgba(0,0,0,0.5); color: #fff; padding: 4px 10px; border-radius: 8px; font-size: 13px; width: fit-content; max-width: 100%; animation: fadeout 9s forwards; }
#feed div.gold { background: rgba(170,110,0,0.85); font-weight: bold; }
@keyframes fadeout { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
#toast { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); text-align: center; color: #fff; font-weight: 900; font-size: 20px; text-shadow: 0 2px 4px #000; pointer-events: none; }
#toast .t { animation: toast 2.2s forwards; }
@keyframes toast { 0% { opacity: 0; transform: translateY(10px) scale(0.9); } 12% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
#fly img { position: absolute; width: 120px; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,0.4); transition: transform 0.9s cubic-bezier(0.5, 0, 0.75, 0), opacity 0.9s; }
#dead { position: absolute; inset: 0; background: rgba(90, 0, 0, 0.45); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-shadow: 0 2px 4px #000; }
#dead h2 { font-size: 46px; margin: 0; } #dead p { font-size: 18px; margin: 6px; }
#resume { position: absolute; left: 50%; top: 60%; transform: translateX(-50%); background: rgba(0,0,0,0.55); color: #fff; padding: 8px 16px; border-radius: 10px; }

#touch { position: absolute; inset: 0; pointer-events: none; }
#stick { position: absolute; left: 24px; bottom: 60px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,0.18); border: 2px solid rgba(255,255,255,0.5); pointer-events: auto; }
#knob { position: absolute; left: 40px; top: 40px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,0.6); }
.tbtn { position: absolute; width: 70px; height: 70px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,0.35); color: #fff; font-weight: bold; font-size: 15px; pointer-events: auto; }
#t-hit { right: 30px; bottom: 150px; width: 84px; height: 84px; background: rgba(216,52,63,0.6); }
#t-jump { right: 130px; bottom: 120px; } #t-pick { right: 40px; bottom: 250px; } #t-talk { right: 130px; bottom: 210px; }
#t-talk.on { background: rgba(43,212,106,0.8); }
body.touch #binder-btn { bottom: auto; top: 200px; } body.touch #mic-btn { bottom: auto; top: 258px; } body.touch #hpbar { left: 50%; transform: translateX(-50%); bottom: auto; top: 8px; width: 160px; }
body.touch #minimap { width: 120px; height: 120px; } body.touch #online { top: 140px; }

.binder-box { background: linear-gradient(#7a4a26, #5e3518); border-radius: 18px; padding: 14px; width: min(980px, 100%); max-height: 100%; display: flex; flex-direction: column; box-shadow: 0 18px 50px rgba(0,0,0,0.5); color: #fff; }
.binder-box.small { width: min(420px, 100%); }
.binder-box header { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.binder-box h2 { margin: 0; font-size: 22px; }
.close { margin-left: auto; background: #fff; color: #333; border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 18px; }
#binder-progress { flex: 1; font-size: 14px; }
#binder-progress .bar { height: 10px; background: rgba(0,0,0,0.35); border-radius: 5px; overflow: hidden; margin-top: 4px; }
#binder-progress .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd23f, #ff9a1f); }
#binder-grid { overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; padding: 10px; background: #f3ead5; border-radius: 10px; flex: 1; min-height: 200px; }
.slot { aspect-ratio: 63 / 88; border-radius: 8px; background: #e2d6b8; border: 2px dashed #c4b38c; position: relative; display: flex; align-items: center; justify-content: center; color: #9a8a66; font-weight: bold; font-size: 13px; cursor: pointer; overflow: hidden; }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; }
.slot.have .no, .slot.seen .no { display: none; }
.slot.seen img { filter: grayscale(1) brightness(0.9) contrast(0.8); opacity: 0.55; }
.slot .no { position: absolute; top: 4px; left: 6px; font-size: 11px; }
.slot .cnt { position: absolute; right: 4px; bottom: 4px; background: #1d3557; color: #fff; border-radius: 9px; padding: 0 7px; font-size: 12px; }
.slot.have { border: none; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }
.slot.new::after { content: "NEW"; position: absolute; top: 4px; right: 4px; background: var(--red); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 6px; }
#binder-detail { position: absolute; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
#binder-detail .d { background: var(--paper); color: var(--ink); border-radius: 16px; padding: 16px; display: flex; gap: 16px; max-width: 560px; align-items: center; flex-wrap: wrap; justify-content: center; }
#binder-detail img { width: 210px; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,0.35); }
#binder-detail .t { flex: 1; min-width: 200px; } #binder-detail h3 { margin: 0 0 6px; font-size: 22px; }
#fame { font-size: 12px; margin-top: 8px; opacity: 0.9; }
#people-list { background: #f3ead5; color: #333; border-radius: 10px; padding: 8px; max-height: 50vh; overflow: auto; }
#people-list .row { display: flex; align-items: center; gap: 8px; padding: 6px; border-bottom: 1px dashed #ccb; }
#people-list .row span { flex: 1; } #people-list button { border: none; border-radius: 8px; padding: 4px 10px; background: #1d3557; color: #fff; }
#people-list button.muted { background: #a33; }
.vol { display: block; margin-top: 10px; font-size: 14px; } .vol input { width: 60%; vertical-align: middle; }
@media (max-width: 600px) { .logo { font-size: 26px; } .lead { font-size: 13px; } #binder-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); } }
