:root { --ink: #4a2a1a; --pink: #ff8fb1; --yellow: #ffd45c; --sky: #7fd6ff; --mint: #7dffb0; --paper: #fffaf0; --shadow: 0 6px 0 rgba(74, 42, 26, .18); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #bfe6ff; color: var(--ink); font-family: "Zen Maru Gothic", sans-serif; -webkit-user-select: none; user-select: none; touch-action: none; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font: inherit; cursor: pointer; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; display: none; }
body[data-mode="aim"] #hud, body[data-mode="run"] #hud { display: block; }
#dist { position: absolute; left: 18px; top: 14px; font-family: "Mochiy Pop One", sans-serif; color: #fff; text-shadow: 0 3px 0 rgba(74, 42, 26, .45), 0 0 14px rgba(0, 0, 0, .15); }
#dist b { font-size: 54px; font-weight: 400; letter-spacing: .02em; }
#dist small { font-size: 22px; margin-left: 4px; }
#zoneName { font-family: "Zen Maru Gothic"; font-weight: 900; font-size: 14px; background: rgba(255, 255, 255, .85); color: var(--ink); border-radius: 99px; padding: 3px 12px; display: table; margin-top: 2px; text-shadow: none; }
#scoreBox { position: absolute; right: 18px; top: 16px; background: rgba(255, 250, 240, .92); border-radius: 18px; padding: 6px 16px; box-shadow: var(--shadow); text-align: right; }
#scoreBox span { font-size: 12px; font-weight: 900; display: block; opacity: .7; }
#scoreBox b { font-family: "Mochiy Pop One"; font-weight: 400; font-size: 26px; }
#streak { position: absolute; right: 18px; top: 92px; font-family: "Mochiy Pop One"; font-size: 22px; color: #fff; text-shadow: 0 3px 0 #e2557d; opacity: 0; transition: opacity .2s, transform .2s; }
#streak.on { opacity: 1; }
#qcard { position: absolute; left: 50%; top: 14px; transform: translateX(-50%) translateY(-160%); width: min(680px, calc(100% - 330px)); background: var(--paper); border: 4px solid var(--ink); border-radius: 22px; padding: 8px 14px 12px; box-shadow: var(--shadow); transition: transform .28s cubic-bezier(.3, 1.4, .5, 1); text-align: center; pointer-events: auto; }
#qcard.on { transform: translateX(-50%) translateY(0); }
#qcard .qn { font-size: 13px; font-weight: 900; color: #e2557d; }
#qcard .qt { font-size: 22px; font-weight: 900; line-height: 1.35; }
.qtime { height: 6px; border-radius: 3px; background: #f0e2cc; margin: 6px 0 8px; overflow: hidden; } .qtime i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff8fb1, #ffd45c); }
#qcard.done .qtime { visibility: hidden; }
#choices { display: flex; gap: 8px; }
#choices button { flex: 1; min-width: 0; border: 4px solid #fff; border-radius: 16px; padding: 10px 6px; font-weight: 900; font-size: 18px; color: var(--ink); background: #fff; box-shadow: 0 4px 0 rgba(74, 42, 26, .18); display: flex; align-items: center; gap: 6px; justify-content: center; transition: transform .1s, background .15s; touch-action: manipulation; }
#choices button:nth-child(1) { border-color: var(--pink); } #choices button:nth-child(2) { border-color: var(--yellow); } #choices button:nth-child(3) { border-color: var(--sky); }
#choices button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(74, 42, 26, .18); }
#choices button.right { background: var(--mint); transform: scale(1.06); } #choices button.wrong { background: #d9d9d9; opacity: .7; }
#choices button:disabled:not(.right) { opacity: .55; }
#choices kbd { font-family: "Mochiy Pop One"; font-size: 12px; background: var(--ink); color: #fff; border-radius: 7px; padding: 1px 6px; }
#scoreBox .spd { font-size: 12px; font-weight: 900; opacity: .75; } #scoreBox .spd b { font-family: "Mochiy Pop One"; font-weight: 400; font-size: 16px; }
#waitMsg { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); background: rgba(255, 255, 255, .92); border-radius: 99px; padding: 8px 18px; font-weight: 900; box-shadow: var(--shadow); opacity: 0; transition: opacity .2s; white-space: nowrap; }
#waitMsg.on { opacity: 1; }
.genreBox { background: rgba(255, 250, 240, .92); border-radius: 18px; padding: 10px 14px; box-shadow: var(--shadow); max-width: min(620px, 94vw); text-align: center; }
.genreBox .gl { font-size: 13px; font-weight: 900; margin-bottom: 6px; }
#genres { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip { border: 3px solid #e8d9c2; background: #fff; color: #9b8a78; border-radius: 99px; padding: 6px 12px; font-weight: 900; font-size: 15px; }
.chip small { font-size: 11px; margin-left: 4px; opacity: .7; }
.chip.on { border-color: var(--pink); background: #fff0f5; color: var(--ink); } .chip.on .cn::before { content: '✓ '; color: #e2557d; }
.genreBox .best { font-size: 13px; font-weight: 700; margin-top: 6px; opacity: .8; }
#bookGrid h3 { margin: 10px 0 6px; font-size: 17px; } #bookGrid h3 small { font-size: 13px; color: #e2557d; }
.rq .gn { font-size: 11px; font-weight: 900; color: #e2557d; margin-right: 6px; }
#meter { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); width: min(520px, 86vw); text-align: center; display: none; }
body[data-mode="aim"] #meter { display: block; }
#meter .lab { font-weight: 900; font-size: 20px; color: #fff; text-shadow: 0 2px 0 rgba(74, 42, 26, .5); margin-bottom: 8px; }
#meter .bar { position: relative; height: 30px; border-radius: 99px; background: rgba(255, 255, 255, .85); border: 4px solid #fff; box-shadow: var(--shadow); overflow: hidden; }
#meter .bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #7fd6ff, #ffd45c 70%, #ff8fb1); border-radius: 99px; }
#meter .bar em { position: absolute; right: 4%; width: 10%; top: 0; bottom: 0; background: rgba(255, 255, 255, .55); border-left: 2px dashed #e2557d; border-right: 2px dashed #e2557d; }
#meter .key { font-size: 13px; font-weight: 700; color: #fff; margin-top: 6px; text-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
#pops { position: absolute; inset: 0; }
.pop { position: absolute; transform: translate(-50%, -50%); font-family: "Mochiy Pop One"; font-size: 22px; color: #fff; text-shadow: 0 3px 0 rgba(74, 42, 26, .55); white-space: nowrap; animation: pop 1s ease-out forwards; }
.pop.big { font-size: 34px; text-shadow: 0 4px 0 #e2557d; }
.pop.good { color: #fff; text-shadow: 0 3px 0 #1fa463; font-size: 30px; } .pop.bad { color: #f2f2f2; text-shadow: 0 3px 0 #6b6b6b; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }
#bigmsg { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-family: "Mochiy Pop One"; font-size: 56px; color: #fff; text-shadow: 0 5px 0 #e2557d, 0 0 30px rgba(255, 143, 177, .6); opacity: 0; white-space: nowrap; }
#bigmsg.on { animation: big 1.1s ease-out forwards; }
@keyframes big { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1); } }

/* ---------- screens & sheets ---------- */
.screen, .sheet { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; flex-direction: column; }
body[data-mode="title"] #title, body[data-mode="loading"] #title { display: flex; }
#title { background: linear-gradient(180deg, rgba(127, 214, 255, .0), rgba(255, 250, 240, .35)); gap: 18px; }
.logo { text-align: center; }
.logo .sub1 { font-weight: 900; font-size: 18px; background: #fff; display: inline-block; padding: 4px 16px; border-radius: 99px; box-shadow: var(--shadow); }
.logo h1 { margin: 10px 0 0; font-family: "Mochiy Pop One"; font-weight: 400; font-size: clamp(42px, 8vw, 92px); line-height: 1.05; color: #fff; text-shadow: 0 6px 0 #e2557d, 0 10px 24px rgba(226, 85, 125, .35); display: flex; flex-direction: column; align-items: center; }
.logo h1 span:nth-child(2) { color: #ffe066; text-shadow: 0 6px 0 #e08a1e, 0 10px 24px rgba(224, 138, 30, .35); font-size: 1.15em; }
.field { font-weight: 900; background: rgba(255, 255, 255, .9); border-radius: 14px; padding: 6px 16px; box-shadow: var(--shadow); }
.btns { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.btns > button, .row > button:not(.sub), #shopGo { font-family: "Mochiy Pop One"; font-size: 30px; padding: 12px 54px; border: 0; border-radius: 99px; background: linear-gradient(180deg, #ff9fbd, #ff6f91); color: #fff; box-shadow: 0 7px 0 #c8436a; }
.btns > button:disabled { filter: grayscale(.7); opacity: .6; }
button.sub { font-weight: 900; font-size: 16px; padding: 9px 18px; border: 3px solid var(--ink); border-radius: 99px; background: #fff; color: var(--ink); box-shadow: var(--shadow); }
#loadMsg { font-weight: 700; background: rgba(255, 255, 255, .8); padding: 4px 14px; border-radius: 99px; }
body:not([data-mode="loading"]) #loadMsg { display: none; }
.sheet { background: rgba(74, 42, 26, .28); z-index: 5; }
.sheet.on { display: flex; }
.paper { background: var(--paper); border: 5px solid var(--ink); border-radius: 26px; padding: 18px 26px 22px; max-width: min(560px, 94vw); max-height: 92vh; overflow: auto; box-shadow: 0 10px 0 rgba(74, 42, 26, .25); }
.paper.wide { max-width: min(860px, 96vw); width: 100%; }
.paper h2 { margin: 0 0 10px; font-family: "Mochiy Pop One"; font-weight: 400; font-size: 26px; display: flex; align-items: center; gap: 12px; }
.paper ul { padding-left: 1.2em; line-height: 1.65; }
.paper .close { margin-top: 8px; }
.coins { font-family: "Zen Maru Gothic"; font-weight: 900; font-size: 16px; background: #fff3c4; padding: 3px 12px; border-radius: 99px; }
.slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.slot { background: #fff; border: 3px solid #f0e2cc; border-radius: 18px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.slot .sl { font-size: 12px; font-weight: 900; color: #e2557d; } .slot .nm { font-size: 19px; font-weight: 900; }
.slot .lv { display: flex; gap: 3px; } .slot .lv i { width: 18px; height: 8px; border-radius: 4px; background: #eadfcd; } .slot .lv i.on { background: var(--pink); }
.slot .wh { font-size: 12px; opacity: .75; } .slot .nx { font-size: 13px; }
.slot button { margin-top: 4px; border: 0; border-radius: 99px; padding: 7px 10px; font-weight: 900; background: var(--yellow); color: var(--ink); box-shadow: 0 4px 0 #d9a92a; }
.slot button:disabled { background: #eee; box-shadow: none; color: #aaa; }
.rtop { display: flex; align-items: baseline; gap: 16px; }
.rdist { font-family: "Mochiy Pop One"; } .rdist b { font-size: 64px; font-weight: 400; color: #e2557d; } .rdist small { font-size: 24px; }
.rbest { font-weight: 900; color: #1fa463; }
.rstats { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; } .rstats span { background: #fff; border-radius: 99px; padding: 4px 12px; font-weight: 700; font-size: 14px; border: 2px solid #f0e2cc; }
.rcoins { font-weight: 900; font-size: 18px; margin-bottom: 8px; } .rcoins b { font-family: "Mochiy Pop One"; font-weight: 400; color: #e08a1e; font-size: 24px; }
.rlist { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 6px; margin-bottom: 14px; }
.rq { background: #fff; border-radius: 14px; padding: 5px 10px; font-size: 13px; border-left: 8px solid var(--mint); font-size: 14px; }
.rq.ng { border-left-color: #c9c9c9; } .rq b { font-size: 16px; } .rq .nt { opacity: .8; font-size: 13px; } .rq .yours { color: #888; font-size: 12px; }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 12px; }
.bcard { background: #fff; border-radius: 14px; padding: 8px 10px; border: 2px solid #f0e2cc; font-size: 13px; } .bcard b { font-size: 16px; display: block; } .bcard.no { opacity: .45; } .bcard .z { font-size: 11px; color: #e2557d; font-weight: 900; }
#touch { position: fixed; bottom: 96px; left: 0; right: 0; display: none; justify-content: space-between; padding: 0 14px; pointer-events: none; }
body.touch[data-mode="run"] #touch { display: flex; }
#touch button { pointer-events: auto; width: 72px; height: 72px; border-radius: 50%; border: 4px solid #fff; background: rgba(255, 255, 255, .55); font-size: 28px; color: var(--ink); }
#err { position: fixed; left: 8px; bottom: 8px; max-width: 70vw; white-space: pre-wrap; font: 12px monospace; background: #fff0f0; color: #a00; padding: 6px; display: none; z-index: 9; }
@media (max-width: 720px) {
  #dist b { font-size: 34px; } #qcard { width: calc(100% - 16px); top: 84px; }
  #choices { gap: 5px; } #choices button { font-size: 14px; padding: 9px 3px; } #choices kbd { display: none; } #qcard .qt { font-size: 17px; }
  #scoreBox { padding: 4px 10px; } #scoreBox b { font-size: 20px; } #streak { top: 70px; }
}

/* b4: card picture in the question, stage picker, mastery chips, rewards */
.qrow { display: flex; align-items: center; gap: 12px; text-align: left; }
#qImg { width: 112px; height: 112px; border-radius: 14px; object-fit: cover; background: #fff; border: 3px solid #f0e2cc; flex: none; display: none; }
#qcard.hasImg #qImg { display: block; }
.qbody { flex: 1; min-width: 0; } #qcard:not(.hasImg) .qrow { text-align: center; }
.pickBox { background: rgba(255, 250, 240, .93); border-radius: 18px; padding: 10px 14px; box-shadow: var(--shadow); max-width: min(760px, 96vw); text-align: center; max-height: 46vh; overflow: auto; }
.pickBox .gl { font-size: 13px; font-weight: 900; margin: 4px 0 6px; } .pickBox .gl small { font-weight: 700; opacity: .7; }
.pickBox .best { font-size: 13px; font-weight: 700; margin-top: 6px; }
#stages { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 4px; }
.stage { border: 3px solid #e8d9c2; background: #fff; border-radius: 14px; padding: 6px 12px; font-weight: 900; font-size: 15px; color: var(--ink); }
.stage small { display: block; font-size: 11px; font-weight: 700; opacity: .7; }
.stage.on { border-color: #4fb6ff; background: #eef8ff; } .stage.lock { opacity: .45; }
.chip { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.chip .mb { display: block; width: 100%; min-width: 70px; height: 5px; border-radius: 3px; background: #eadfcd; overflow: hidden; } .chip .mb i { display: block; height: 100%; background: linear-gradient(90deg, #7fd6ff, #7dffb0); }
.chip .ml { font-size: 10px; font-weight: 900; color: #e08a1e; }
.chip.master .ml { color: #1fa463; }
.rrew { font-size: 13px; margin-bottom: 8px; opacity: .85; }
.lvline { font-weight: 900; margin: -4px 0 10px; color: #1fa463; }
@media (max-width: 720px) { #qImg { width: 64px; height: 64px; } .pickBox { max-height: 42vh; } }
#genres { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.chip { padding: 5px 8px; font-size: 14px; border-radius: 14px; }
@media (max-width: 720px) { #genres { grid-template-columns: 1fr 1fr; } .chip { font-size: 12.5px; padding: 4px 6px; } .chip .ml { font-size: 9.5px; } .stage { font-size: 13px; padding: 4px 8px; } .logo h1 { font-size: 40px; } }

/* b5: frames on the title, one-choice pickers, gear frames */
#frames { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: min(760px, 96vw); }
.frame { position: relative; display: flex; align-items: center; gap: 10px; text-align: left; background: rgba(255, 250, 240, .95); border: 4px solid #fff; border-radius: 20px; padding: 8px 12px 8px 8px; box-shadow: var(--shadow); min-width: 300px; flex: 1; color: var(--ink); }
.frame img { width: 92px; height: 66px; object-fit: cover; border-radius: 12px; background: #e8eef8; flex: none; }
#fGenre img { width: 66px; }
.frame .ft { display: flex; flex-direction: column; min-width: 0; flex: 1; } .frame small { font-size: 11px; font-weight: 900; color: #e2557d; } .frame b { font-size: 19px; font-weight: 900; } .frame em { font-style: normal; font-size: 11.5px; font-weight: 700; opacity: .75; }
.frame .mb { display: block; height: 5px; border-radius: 3px; background: #eadfcd; overflow: hidden; margin: 2px 0; } .frame .mb i { display: block; height: 100%; background: linear-gradient(90deg, #7fd6ff, #7dffb0); }
.frame .chg { position: absolute; right: 8px; top: 6px; font-style: normal; font-size: 11px; font-weight: 900; background: var(--ink); color: #fff; border-radius: 99px; padding: 1px 8px; }
.gearBox { background: rgba(255, 250, 240, .95); border-radius: 20px; padding: 8px 10px 10px; box-shadow: var(--shadow); max-width: min(760px, 96vw); width: 100%; }
.gearHead { display: flex; gap: 10px; align-items: center; font-weight: 900; font-size: 13px; margin-bottom: 6px; } .gearHead > span:first-child { color: #e2557d; } .gearHead .coins { margin-left: auto; }
.gearRow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gframe { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #fff; border: 3px solid #f0e2cc; border-radius: 16px; padding: 6px; color: var(--ink); font-weight: 900; }
.gframe img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: #fff6e6; }
.gframe small { font-size: 10.5px; color: #e2557d; } .gframe b { font-size: 13px; line-height: 1.2; text-align: center; } .gframe .lv { display: flex; gap: 2px; } .gframe .lv i { width: 10px; height: 5px; border-radius: 3px; background: #eadfcd; } .gframe .lv i.on { background: var(--pink); }
.gframe .up { margin-top: 3px; border: 0; border-radius: 99px; padding: 4px 8px; font-weight: 900; font-size: 12px; background: var(--yellow); color: var(--ink); box-shadow: 0 3px 0 #d9a92a; }
.gframe .up:disabled { background: #eee; box-shadow: none; color: #aaa; } .gframe .what { font-size: 10.5px; font-weight: 700; opacity: .7; }
.shopRow .gframe img { width: 84px; height: 84px; }
.gframe.can { border-color: var(--yellow); }
.pickGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 12px; }
.pcard { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 4px solid #f0e2cc; border-radius: 16px; padding: 8px; text-align: left; color: var(--ink); font-weight: 900; }
.pcard img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; background: #e8eef8; }
#genreGrid .pcard img { aspect-ratio: 1; }
.pcard b { font-size: 16px; } .pcard em { font-style: normal; font-size: 12px; font-weight: 700; opacity: .75; } .pcard .mb { display: block; height: 6px; border-radius: 3px; background: #eadfcd; overflow: hidden; } .pcard .mb i { display: block; height: 100%; background: linear-gradient(90deg, #7fd6ff, #7dffb0); }
.pcard.on { border-color: #4fb6ff; background: #eef8ff; } .pcard.lock { opacity: .5; } .pcard .mul { color: #e08a1e; } .pcard.master .mul { color: #1fa463; }
#genreGrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.hint { font-family: "Zen Maru Gothic"; font-size: 12px; font-weight: 700; opacity: .7; }
.rgearHead { font-weight: 900; margin: 6px 0; } .rgearHead b { font-family: "Mochiy Pop One"; font-weight: 400; color: #e08a1e; }
#title { gap: 12px; }
@media (max-width: 720px) {
  .frame { min-width: 0; width: 100%; padding: 6px 10px 6px 6px; } .frame img { width: 70px; height: 52px; } #fGenre img { width: 52px; } .frame b { font-size: 16px; }
  .gframe img { width: 52px; height: 52px; } .gframe b { font-size: 11.5px; } .shopRow .gframe img { width: 64px; height: 64px; }
  .pickGrid { grid-template-columns: 1fr 1fr; } #genreGrid { grid-template-columns: 1fr 1fr; } .logo h1 { font-size: 36px; } .logo .sub1 { font-size: 14px; }
}

/* b5: the title must fit short screens (logo shrinks with the height) */
.logo h1 { font-size: clamp(30px, min(8vw, 8.5vh), 92px); }
@media (max-height: 700px) { .logo .sub1 { display: none; } .logo h1 { flex-direction: row; gap: .25em; margin-top: 0; } .logo h1 span:nth-child(2) { font-size: 1.05em; } #title { gap: 8px; } .btns > button { font-size: 24px; padding: 8px 44px; } }
@media (max-width: 720px) { .frame { flex: 1 1 100%; } .frame .chg { top: 50%; transform: translateY(-50%); } .gearHead { flex-wrap: wrap; font-size: 12px; } }

/* b6: picture cards in the result list too */
.rq { display: flex; gap: 10px; align-items: center; } .rq .rqb { flex: 1; min-width: 0; }
.rq .rimg { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; border: 2px solid #f0e2cc; flex: none; background: #fff; }
.rq.ng .rimg { width: 84px; height: 84px; }

/* b7: the next area */
#nextArea { font-family: 'Zen Maru Gothic'; font-weight: 900; font-size: 12px; color: #fff; text-shadow: 0 1px 0 rgba(74,42,26,.6); margin-top: 3px; }
#nextArea b { font-family: 'Mochiy Pop One'; font-weight: 400; font-size: 14px; }

/* b9: titles, review run, BGM */
#titleChip { display: inline-block; margin-bottom: 6px; font-weight: 900; font-size: 13px; color: #fff; background: linear-gradient(90deg, #ff8fb1, #ffb84a); border-radius: 99px; padding: 2px 12px; box-shadow: var(--shadow); }
#titleChip:empty { display: none; }
#reviewBtn:disabled { opacity: .45; }
.achGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 12px; }
.ach { background: #fff; border: 3px solid #f0e2cc; border-radius: 14px; padding: 8px 10px; text-align: left; color: var(--ink); font-weight: 700; font-size: 12px; }
.ach b { display: block; font-size: 15px; font-weight: 900; } .ach.got { border-color: #ffd45c; background: #fffbe8; } .ach.on { border-color: #ff8fb1; background: #fff0f5; } .ach.lock { opacity: .5; }
.rach { font-weight: 900; color: #e08a1e; margin-bottom: 4px; } .rach:empty { display: none; }
.bgmList { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.bgmList button { text-align: left; border: 3px solid #f0e2cc; background: #fff; border-radius: 14px; padding: 8px 12px; font-weight: 900; color: var(--ink); }
.bgmList button.on { border-color: #4fb6ff; background: #eef8ff; }
.vol { display: flex; gap: 8px; align-items: center; font-weight: 900; margin-bottom: 8px; } .vol input { flex: 1; }

/* b9.1: UPDATE button on the title gear frames */
.gframe .upTitle { font-size: 11.5px; padding: 4px 10px; white-space: nowrap; }

/* b15: phones (K: 縦型・スマホで遊ぶ画面) — the title fits a 400 px wide screen, and the hidden question card leaves no edge on screen */
#qcard { transform: translateX(-50%) translateY(calc(-100% - 140px)); }
#qcard.on { transform: translateX(-50%) translateY(0); }
@media (max-width: 480px) {
  #title { justify-content: flex-start; overflow-y: auto; padding: 10px 8px 14px; gap: 8px; }
  .logo h1 { font-size: 34px; } .logo .sub1 { font-size: 11px; padding: 3px 10px; }
  .frame { padding: 6px 8px; } .frame img { width: 46px; height: 46px; }
  .gearBox { padding: 6px; } .gearRow { gap: 5px; } .gframe { padding: 4px 3px; min-width: 0; }
  .gframe img { width: 42px; height: 42px; } .gframe b { font-size: 10.5px; } .gframe small { font-size: 9.5px; }
  .gframe .upTitle { font-size: 9.5px; padding: 3px 5px; white-space: normal; line-height: 1.15; }
  #goBtn { padding: 10px 40px; font-size: 22px; }
}
@media (max-width: 480px) { #bigmsg { font-size: 34px !important; white-space: nowrap; } }

/* b18: Japanese / English — the pairs of long blocks, and no flash of the other language before the swap */
html[lang="en"] [data-lang="ja"], html:not([lang="en"]) [data-lang="en"] { display: none; }
html[lang="en"]:not(.i18n) [data-en] { visibility: hidden; }
html[lang="en"] .logo h1 { letter-spacing: -.01em; }
html[lang="en"] #choices button { font-size: 16px; line-height: 1.15; overflow-wrap: anywhere; }
@media (max-width: 720px) { html[lang="en"] #choices button { font-size: 13px; } html[lang="en"] #qcard .qt { font-size: 16px; } }
