@font-face { font-family: font1; src: url(font1.ttf) format('truetype'); font-display: swap; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body { display: grid; place-items: center; height: 100dvh; overflow: hidden; background: #060f16; color: #e8efe2; font-family: font1, Arial, sans-serif; }
#canvas { display: block; max-width: 100%; outline: none; background: #061119; touch-action: none; }
.popup { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; overflow-y: auto; padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)); background: rgba(3, 11, 18, .9); }
.popup.hidden { display: none; }
.popup-content { position: relative; width: min(100%, 380px); max-height: 100%; overflow-y: auto; padding: 26px 26px 24px; border: 1px solid #446568; border-radius: 24px; background: radial-gradient(ellipse at 50% 0%, #23494b 0%, #132a34 36%, #0e202b 80%); box-shadow: 0 24px 70px #0008, inset 0 1px #bce4ce30; text-align: center; animation: enter-name .24s ease-out both; }
.popup-emblem { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 14px; border: 1px solid #7aa597; border-radius: 22px; color: #d4e8c9; background: #203c40; box-shadow: 0 0 24px #7de6c314; transform: rotate(-5deg); }
.popup-eyebrow { margin: 0 0 8px; font-size: 12px; letter-spacing: 2px; color: #a1caba; }
.popup-content h2 { margin: 0; font-size: clamp(26px, 6vw, 32px); line-height: 1.15; font-weight: 700; color: #f0edda; }
.popup-intro { margin: 10px 0 21px; font-size: 16px; line-height: 1.4; color: #a1babc; }
.popup-scorecard { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; padding: 12px 16px; border: 1px solid #466061; border-radius: 13px; background: #0b1c2499; }
.popup-scorecard span { font-size: 12px; letter-spacing: 1px; color: #a8bdb7; }
.popup-scorecard strong { font-size: 30px; line-height: 1; font-weight: 700; color: #e7cb8d; }
.popup-content label { display: block; margin-bottom: 8px; text-align: left; font-size: 15px; color: #d5e4d7; }
.popup-content input { display: block; width: 100%; min-height: 54px; margin: 0; padding: 13px 15px; border: 1px solid #526f74; border-radius: 12px; background: #071923; color: #f2f2df; font: 18px font1, Arial, sans-serif; caret-color: #bce4ce; transition: border-color .15s, box-shadow .15s; }
.popup-content input::placeholder { color: #708e97; opacity: 1; }
.popup-content input:focus { outline: 2px solid #bce4ce; outline-offset: 3px; border-color: #bce4ce; box-shadow: 0 0 0 5px #bce4ce0a; }
.popup-help { margin: 11px 0 0; font-size: 12px; line-height: 1.45; color: #96b3b7; text-align: left; }
#popup-error { margin: 0; font: 14px/1.45 font1, Arial, sans-serif; color: #ffd1c7; text-align: left; overflow-wrap: anywhere; }
#popup-error:not(:empty) { margin-top: 14px; padding: 10px 12px; border: 1px solid #a5695866; border-radius: 10px; background: #552c2b66; }
.popup-actions { display: flex; gap: 10px; margin-top: 24px; }
.popup-actions button { flex: 1; min-width: 0; min-height: 50px; padding: 12px 8px; border: 1px solid transparent; border-radius: 12px; font: 700 16px font1, Arial, sans-serif; cursor: pointer; transition: transform .12s, background .12s; }
#popup-cancel { border-color: #3f5c65; background: #1b323d; color: #b9cecc; }
#popup-submit { flex: 1.35; background: #bce4ce; color: #102d2b; box-shadow: inset 0 -3px #86b4a4; }
.popup-actions button:focus-visible { outline: 2px solid #e7cb8d; outline-offset: 3px; }
.popup-actions button:active:not(:disabled) { transform: translateY(2px); }
.popup-actions button:disabled { opacity: .55; cursor: wait; }
@media (hover: hover) { #popup-submit:hover:not(:disabled) { background: #d0eedc; } #popup-cancel:hover:not(:disabled) { background: #284550; } }
@media (max-height: 620px) { .popup-content { padding: 18px 22px; } .popup-emblem { display: none; } .popup-scorecard { margin-bottom: 16px; } .popup-intro { margin-bottom: 14px; } }
@keyframes enter-name { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (prefers-reduced-motion: reduce) { .popup-content { animation: none; } .popup-content input, .popup-actions button { transition: none; } }
