/* Entry screen: a full-screen backdrop (a muted loop of race footage, its first frame as the
   poster), the title and two cards. Students join with the lesson code; teachers sign in. No
   3D world loads here. The footage keeps its karts about 76% across, clear of the cards, and
   the same poster stays behind a waiting student's lobby until a course is loaded. */
.entry,.entry-backdrop{position:fixed;inset:0;display:none}
.entry-backdrop{z-index:1;background:#0b131c url(media/entry-poster.webp) 76% 50%/cover no-repeat}
.entry-backdrop::after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,#08101af2,#08101ac7 45%,#08101aa6)}
html.no-world .entry-backdrop{display:block}
.entry{z-index:9;overflow:hidden;background:#0b131c}
html.entry-open .entry{display:block}
html.entry-open #loading-screen{display:none}
.entry-media{position:absolute;inset:0;background:#0b131c url(media/entry-poster.webp) 76% 50%/cover no-repeat}
.entry-media video{display:block;width:100%;height:100%;object-fit:cover;object-position:76% 50%}
.entry-media::after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,#08101af0 0%,#08101ad6 32%,#08101a80 56%,#08101a1a 78%),linear-gradient(0deg,#08101a8c,#08101a00 34%)}
.entry-inner{position:relative;z-index:1;box-sizing:border-box;height:100%;word-break:keep-all;overflow-wrap:break-word;display:flex;flex-direction:column;justify-content:center;gap:28px;padding:88px clamp(24px,5vw,88px) 36px}

.entry-title{margin:0;font-size:clamp(46px,5.2vw,74px);line-height:1.04;letter-spacing:-2px;color:#f3f2e8;text-shadow:0 2px 24px #0009}
.entry-title .title-english{font-size:13px;letter-spacing:.5em;margin-top:12px}

.entry-cards{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(0,1fr);gap:16px;width:min(740px,100%);align-items:stretch}
.entry-card{display:flex;flex-direction:column;gap:14px;margin:0;padding:24px;background:#0e1822eb;border:1px solid #4a5967;border-radius:8px;box-shadow:0 18px 48px #02060b66}
.entry-card h2{margin:0;font-size:26px;line-height:1.2;letter-spacing:-.4px}
.entry-help{margin:0;font-size:16px;line-height:1.55;color:#c4cfd8;text-wrap:pretty}
.entry-card label{gap:8px;margin:0;font-size:16px;color:#dfe5ea}
.entry-label{font-weight:650;color:#dfe5ea;font-size:16px}
.entry-label em{font-style:normal;font-weight:400;font-size:14px;color:#a3b3bf;margin-left:6px}
.entry-card input{min-height:56px;padding:10px 16px;font-size:22px;border-radius:6px;background:#132130;border:1px solid #52626f;color:#f3f2e8}
.entry-card input::placeholder{font-size:18px;color:#7f8f9b}
#join-code{font-family:ui-monospace,Consolas,monospace;letter-spacing:.22em;text-transform:uppercase}
#join-code::placeholder{font-family:"Segoe UI","Malgun Gothic",sans-serif;letter-spacing:0;text-transform:none}
.entry-card input[aria-invalid=true]{border-color:#e4866b;box-shadow:0 0 0 1px #e4866b}
.entry-error{margin:-4px 0 0;font-size:15px;line-height:1.5;color:#f4ad94}
.entry-error:empty{display:none}
.entry-card .primary{margin-top:auto;min-height:58px;font-size:20px;border-radius:6px}
.entry-card .primary:disabled{opacity:.7}

.teacher-signin,.teacher-wait{display:flex;flex-direction:column;gap:14px}
.entry-teacher:not([data-state=pending]):not([data-state=rejected]) .teacher-wait,.entry-teacher[data-state=pending] .teacher-signin,.entry-teacher[data-state=rejected] .teacher-signin{display:none}
.entry-google{min-height:56px;font-size:18px;font-weight:700;border-radius:6px;background:#192735;border-color:#8192a0}
.entry-google:hover{background:#22344a;border-color:#b8c5ce}
.teacher-wait-title{margin:0;font-size:19px;font-weight:700;color:var(--accent)}
.teacher-wait-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px}
.teacher-wait-actions button{min-height:48px;font-size:16px}
.teacher-wait-actions button[hidden]{display:none}
.text-button{min-height:44px;padding:6px 0;background:none;border:0;border-radius:0;color:#b9d6e4;font-size:15px;text-align:left;text-decoration:underline;text-underline-offset:3px}
.text-button:hover{background:none;color:#e6f1f6}
.entry-practice{margin-top:auto;align-self:stretch;padding-top:14px;border-top:1px solid #33414d}

/* Only 사용방법 stays in the header on the entry screen; the big title is the brand. */
html.entry-open .game-header{background:none}
html.entry-open .game-header .logo{visibility:hidden}
html.entry-open .game-header nav>:not(#help-open){display:none}
html.entry-open .game-header #help-open{min-height:44px;padding:10px 18px;font-size:15px}

@media(max-height:640px) and (min-width:721px){
 .entry-inner{justify-content:flex-start;gap:16px;padding-top:68px;overflow-y:auto}
 .entry-title{font-size:44px}
}
@media(max-width:720px){
 .entry-inner{justify-content:flex-start;gap:16px;padding:68px 16px 16px;overflow-y:auto;overscroll-behavior:contain}
 .entry-title{font-size:42px;letter-spacing:-1px}
 .entry-title .title-english{font-size:11px;margin-top:8px}
 .entry-cards{grid-template-columns:1fr;gap:12px}
 .entry-card{padding:18px;gap:12px}
 .entry-card h2{font-size:22px}
 .entry-help{font-size:15px}
 .entry-card input{min-height:50px;font-size:20px}
 .entry-card .primary{min-height:52px;font-size:18px}
 .entry-google{min-height:50px}
 .entry-practice{margin-top:2px}
 .entry-media::after{background:linear-gradient(0deg,#08101af0 0%,#08101ad9 70%,#08101a99 100%)}
 .entry-backdrop::after{background:linear-gradient(0deg,#08101af5,#08101acc)}
}
@media(max-width:640px){
 html.entry-open body:not(.racing) .game-header{display:flex;height:calc(56px + env(safe-area-inset-top));padding-top:env(safe-area-inset-top);padding-bottom:0}
 html.entry-open body:not(.racing) .game-header nav{display:flex;width:auto;margin-left:auto}
 html.entry-open body:not(.racing) .game-header nav button{width:auto}
}
