/* 일타양득 타자 */
:root {
  --ink: #3b2f2a; --ink2: #6b5a50; --paper: #fffaf1; --line: #ecdcc7;
  --orange: #ff8a5c; --yellow: #ffc83d; --green: #5cc28a; --blue: #4fa3e3; --purple: #8b7bd8; --pink: #e36fa8; --red: #ef5350;
  --board: #2f5d4a; --board2: #264e3e; --chalk: #f6f3e8;
  --font: 'Gowun Dodum', 'Malgun Gothic', sans-serif;
  --title: 'Jua', 'Malgun Gothic', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: #bfe3f7; overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.screen { position: fixed; inset: 0; }

/* ---------- 위쪽 버튼 ---------- */
.top-bar { position: fixed; top: 14px; right: 16px; display: flex; gap: 8px; z-index: 50; }
.tb-btn { font-family: var(--title); font-size: 17px; padding: 8px 14px; border-radius: 999px; border: 3px solid #fff; background: rgba(255,255,255,.88);
  color: var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.12); transition: transform .12s; }
.tb-btn:hover { transform: translateY(-2px); }
.tb-btn:active { transform: translateY(1px); box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.tb-btn.round { width: 46px; padding: 8px 0; }
.tb-btn.on { background: #fff3c4; }

/* ---------- 🏫 학교 ---------- */
.school-host { position: absolute; inset: 0; }
.school { width: 100%; height: 100%; display: block; font-family: var(--title); }
.school .cloud { animation: drift linear infinite; }
@keyframes drift { from { transform: translateX(-300px); } to { transform: translateX(1900px); } }
.school .cloud:nth-of-type(odd) { animation-name: drift2; }
@keyframes drift2 { from { transform: translateX(-500px); } to { transform: translateX(1700px); } }
.school .birds { animation: birds 38s linear infinite; }
@keyframes birds { 0% { transform: translate(-200px, 210px); } 100% { transform: translate(1800px, 120px); } }
.school .twinkle { animation: twinkle 3.5s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .15; } }
.school .flag { transform-box: fill-box; transform-origin: left center; animation: flag 2.4s ease-in-out infinite; }
@keyframes flag { 50% { transform: skewY(-4deg) scaleX(.94); } }
.school .zzz { font-size: 14px; fill: #6b5a50; animation: zzz 2.4s ease-in-out infinite; opacity: 0; }
@keyframes zzz { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-10px); } }
.school .snow circle { animation: fall linear infinite; }
@keyframes fall { to { transform: translate(60px, 1000px); } }
.school .petals ellipse { animation: petal linear infinite; }
@keyframes petal { 0% { transform: translate(0, 0) rotate(0); } 100% { transform: translate(-260px, 1300px) rotate(720deg); } }

.school .pl-t { font-size: 17px; fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,.18); stroke-width: 2px; }
.school .pl-s { font-size: 11px; fill: #fff; opacity: .95; }
.school .sign-t { font-size: 20px; fill: #fff; letter-spacing: 2px; }
.school .gym-t { font-size: 17px; fill: #7d63a6; }
.school .gate-t { font-size: 14px; fill: #5a4636; }
.school .name-t { font-size: 15px; fill: #fff; letter-spacing: 3px; }

.school [data-pick] { cursor: pointer; }
.school .plaque { transition: transform .2s; }
.school .pl-body { transform-box: fill-box; transform-origin: center top; transition: transform .2s cubic-bezier(.3,1.6,.5,1); }
.school .hot .pl-body { transform: scale(1.22) rotate(-3deg); }
.school .pl-wrap.closed .pl-t { font-size: 15px; }
.school .floor .glass, .school .door .glass { transition: fill .25s; }
.school .floor.hot:not(.closed) .shine { opacity: .6; }
.school .floor.hot:not(.closed) .win { filter: drop-shadow(0 0 8px rgba(255, 210, 90, .95)); }
.school .floor.closed.hot .curtain-c { fill: #f4c7a1; }
.school .bell:hover .bell-swing { filter: drop-shadow(0 0 6px #ffe680); }
.school .bell-swing { transform-box: fill-box; transform-origin: center top; }
.school .bell-swing.ring { animation: ring .7s ease-in-out; }
@keyframes ring { 20% { transform: rotate(22deg); } 45% { transform: rotate(-18deg); } 70% { transform: rotate(10deg); } 90% { transform: rotate(-4deg); } }
.school .bell.glow .bell-swing path:nth-child(2) { animation: bellglow 1.6s ease-in-out infinite; }
@keyframes bellglow { 50% { fill: #fff2a8; filter: drop-shadow(0 0 10px #ffd84d); } }
.school.t-night .floor:not(.closed) .win:nth-child(3n+2) .glass { fill: #ffd77a; }

.home-title { position: absolute; left: 28px; top: 18px; pointer-events: none; }
.logo { display: inline-flex; align-items: baseline; gap: 10px; padding: 10px 22px 12px; border-radius: 22px; background: rgba(255,255,255,.92);
  box-shadow: 0 6px 0 rgba(0,0,0,.1), 0 10px 30px rgba(40,80,140,.18); border: 4px solid #fff; }
.logo b { font-family: var(--title); font-size: 46px; color: #ff7a45; letter-spacing: 1px; text-shadow: 3px 3px 0 #ffe1a8; }
.logo small { font-family: var(--title); font-size: 24px; color: #4fa3e3; }
.logo-han { font-family: var(--title); font-size: 18px; color: #b39c8c; }
.home-title p { margin: 10px 0 0 6px; font-size: 17px; font-weight: 700; color: #2d4a6b; background: rgba(255,255,255,.7); display: inline-block; padding: 4px 12px; border-radius: 10px; }
.home-tip { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); font-family: var(--title); font-size: 22px; color: #fff;
  background: #ff8a5c; padding: 10px 24px; border-radius: 999px; border: 4px solid #fff; box-shadow: 0 6px 0 rgba(0,0,0,.12); animation: bob 2s ease-in-out infinite; pointer-events: none; white-space: nowrap; }
@keyframes bob { 50% { transform: translate(-50%, -6px); } }
.hover-tag { position: fixed; z-index: 40; pointer-events: none; font-family: var(--title); font-size: 18px; background: #fff; color: var(--ink);
  padding: 8px 14px; border-radius: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.18); border: 3px solid var(--tag, #ff8a5c); transform: translate(16px, -50%); white-space: nowrap; }
.hover-tag small { display: block; font-family: var(--font); font-size: 13px; color: var(--ink2); }

/* ---------- 모달·알림 ---------- */
.modal { position: fixed; inset: 0; background: rgba(30, 30, 50, .45); display: grid; place-items: center; z-index: 80; padding: 16px; }
.modal-card { background: var(--paper); border-radius: 24px; padding: 26px 28px; width: min(460px, 100%); max-height: 92vh; overflow: auto; border: 5px solid #fff; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.toast { position: fixed; left: 50%; top: 80px; transform: translateX(-50%); z-index: 90; background: #3b2f2a; color: #fff; padding: 12px 22px; border-radius: 14px;
  font-size: 17px; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: toast .25s ease-out; max-width: calc(100% - 32px); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, -10px); } }

@media (max-width: 760px) {
  .logo b { font-size: 32px; } .logo small { font-size: 18px; } .logo-han { display: none; }
  .home-title { left: 12px; top: 12px; } .home-title p { font-size: 13px; max-width: 60vw; }
  .home-tip { font-size: 17px; bottom: 16px; }
  .top-bar { top: 10px; right: 10px; } .tb-btn { font-size: 15px; padding: 6px 10px; }
}
