* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%; height: 100%; overflow: hidden; background: #000;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif; user-select: none;
}
#game { display: block; width: 100vw; height: 100vh; }
#hud { position: fixed; inset: 0; pointer-events: none; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.dim { opacity: .6; }
.small { font-size: 12px; }
.warn { color: #ffd25a; }

#crosshair { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: rgba(255,255,255,.8); }
#clock { position: absolute; left: 24px; top: 18px; font-size: 16px; }
#board { position: absolute; right: 18px; top: 14px; width: 270px; background: rgba(0,0,0,.35); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
#board .bh { font-size: 15px; font-weight: bold; margin-bottom: 4px; }
#boardbody .row { display: flex; gap: 6px; line-height: 1.75; }
#boardbody .row.me { color: #ffd25a; }
#boardbody .rk { width: 22px; opacity: .8; }
#boardbody .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#boardbody .sp { opacity: .75; }
#boardbody .wt { width: 58px; text-align: right; color: #9ee6ff; }
#boardbody .row.me .wt { color: #ffd25a; }
#boardbody .sep { border-top: 1px dashed rgba(255,255,255,.25); margin: 3px 0; }
#catches { margin-top: 6px; padding-top: 5px; border-top: 1px solid rgba(255,255,255,.15); font-size: 12px; opacity: .85; }

#namebox { margin-top: 4px; }
#nameinput {
  font: inherit; font-size: 18px; padding: 8px 12px; width: 240px; border-radius: 6px; border: 1px solid rgba(255,255,255,.4);
  background: rgba(0,0,0,.4); color: #fff; outline: none; text-align: center;
}
#nameinput:focus { border-color: #ffd25a; }
#startbtn { font: inherit; font-size: 18px; padding: 8px 20px; margin-left: 8px; border-radius: 6px; border: 0; background: #ffd25a; color: #222; cursor: pointer; }
#startbtn:hover { background: #ffe08a; }
#startbtn:disabled { background: #777; color: #ddd; cursor: wait; }
#nameerr { margin-top: 8px; min-height: 1.2em; color: #ff8a6a; font-size: 14px; }
#tackle { position: absolute; left: 24px; bottom: 22px; font-size: 14px; line-height: 1.8; background: rgba(0,0,0,.3); padding: 8px 14px; border-radius: 6px; }
#tackle b { display: inline-block; width: 44px; color: #ffd25a; font-weight: normal; }
#tackle .dim { margin-left: 6px; font-size: 12px; }
#hint { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); font-size: 14px; opacity: .85; }
#readout { position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); font-size: 15px; background: rgba(0,0,0,.35); padding: 6px 14px; border-radius: 6px; display: none; white-space: nowrap; }
#readout b { color: #9ee6ff; }
#toast { z-index: 5; position: absolute; left: 50%; top: 28%; transform: translateX(-50%); font-size: 20px; font-weight: bold; opacity: 0; transition: opacity .3s; text-align: center; max-width: 70vw; }
#bite { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); font-size: 26px; font-weight: bold; color: #ffd25a; display: none; animation: pulse .25s infinite alternate; }
@keyframes pulse { to { transform: translateX(-50%) scale(1.08); } }

#power { position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%); width: 420px; display: none; text-align: center; }
#pwtrack { position: relative; height: 18px; background: linear-gradient(90deg, rgba(120,120,120,.6), rgba(120,120,120,.6) 80%, rgba(220,60,40,.8)); border: 1px solid rgba(255,255,255,.5); border-radius: 3px; }
#pwband { position: absolute; top: 0; bottom: 0; background: rgba(60,210,120,.85); }
#pwneedle { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1px; background: #fff; box-shadow: 0 0 4px #000; }
#pwlabel { margin-top: 6px; font-size: 14px; }

#rhythm { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); display: none; }

#card {
  position: absolute; left: 50%; top: 14%; transform: translateX(-50%); display: none;
  background: rgba(10,20,26,.78); border: 1px solid rgba(255,255,255,.2); border-radius: 10px; padding: 18px 30px; text-align: center; min-width: 360px;
}
.cname { font-size: 30px; font-weight: bold; }
.latin { font-size: 13px; font-style: italic; opacity: .6; margin-left: 10px; font-weight: normal; }
.cstats { display: flex; justify-content: center; gap: 36px; margin: 10px 0; font-size: 16px; }
.cstats b { font-size: 34px; color: #9ee6ff; }
.pb { color: #ffd25a; font-weight: bold; margin-bottom: 6px; }
.cmeta { opacity: .8; font-size: 14px; }
.cnote { margin-top: 8px; font-size: 13px; color: #b8e0c8; }
.cnext { margin-top: 12px; font-size: 14px; opacity: .7; }

#journal {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(1100px, 92vw); max-height: 86vh; overflow: auto; display: none;
  background: rgba(8,16,22,.9); border: 1px solid rgba(255,255,255,.2); border-radius: 10px; padding: 18px 24px; text-shadow: none;
}
#journal h2 { font-size: 20px; margin-bottom: 12px; }
#journalbody { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.sp { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sph { font-size: 17px; font-weight: bold; }
.sph .cnt { float: right; font-size: 13px; font-weight: normal; color: #9ee6ff; }
.spn { font-size: 13px; line-height: 1.7; opacity: .85; margin: 4px 0; }
.spl { font-size: 12px; display: flex; flex-wrap: wrap; gap: 10px; color: #ffd25a; }
#journal h3 { font-size: 16px; margin-bottom: 8px; }
#journal table { width: 100%; font-size: 13px; border-collapse: collapse; }
#journal td { padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,.08); }

#overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(10,14,20,.55); color: #fff; cursor: pointer; }
.panel { text-align: center; padding: 34px 46px; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.15); border-radius: 8px; }
.panel h1 { font-size: 40px; letter-spacing: 4px; }
#ovsub { margin-top: 8px; font-size: 16px; color: #ffd25a; }
.controls { margin: 22px 0; display: grid; grid-template-columns: auto auto; gap: 8px 32px; text-align: left; font-size: 15px; }
.controls b { color: #ffd25a; font-weight: normal; display: inline-block; min-width: 130px; }
.start { font-size: 22px; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .4; } }
