/* ---------- POLIS Web: the Dienst-PC as a web page (server/web.lua) ---------- */

html, body { background: #0b2a4a; }

/* Things that need the game world */
#pc.web #nearby,
#pc.web #person-nearby,
#pc.web #vehicle-nearby,
#pc.web #here { display: none !important; }

#pc.web.logged-out .win-tb-apps,
#pc.web.logged-out .win-place { visibility: hidden; }

.web-login {
    position: absolute;
    inset: 0 0 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    color: #fff;
    background: rgba(8, 24, 44, 0.55);
    backdrop-filter: blur(24px);
    z-index: 8;
    animation: win-fade 200ms ease-out;
}

.web-login-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: min(320px, 100%);
    text-align: center;
}

.web-login-box b { font-size: 26px; font-weight: 600; margin-top: 6px; }
.web-login-box p { font-size: 14px; line-height: 1.45; opacity: 0.85; }

#pc .web-login-box input {
    width: 100%;
    height: 42px;
    margin-top: 8px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-bottom: 2px solid #fff;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 20px;
    letter-spacing: 0.2em;
    text-align: center;
    text-transform: uppercase;
    outline: none;
}

#pc .web-login-box input:focus { background: rgba(255, 255, 255, 0.2); border-bottom-color: #60cdff; }
#pc .web-login-box input::placeholder { color: rgba(255, 255, 255, 0.6); font-size: 15px; letter-spacing: 0.05em; text-transform: none; }

#pc .web-login-box button {
    width: 100%;
    height: 36px;
    border-radius: 4px;
    background: var(--pc-accent);
    color: #fff;
    font-weight: 600;
}

#pc .web-login-box button:hover { background: var(--pc-accent-2); }
#pc .web-login-box button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#pc .web-login-box button:disabled { opacity: 0.6; }

.web-login-error { min-height: 18px; font-size: 13px; color: #ffb4a9; }

.web-switch { color: var(--pc-accent); font-size: 12px; white-space: nowrap; }
.web-switch:hover { text-decoration: underline; }

/* ---------- Phone view: the mPOL phone interface in full screen ---------- */

body.web-mobile { height: 100dvh; }

body.web-mobile #phone {
    position: fixed;
    inset: 0;
    transform: none !important;
}

body.web-mobile #phone.hidden { display: none !important; }

body.web-mobile #phone .frame {
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--bg);
}

body.web-mobile #phone .speaker,
body.web-mobile #phone .homebtn,
body.web-mobile #phone .statusbar { display: none; }

body.web-mobile .appbar { height: calc(46px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0; }
body.web-mobile .appbar h1 { max-width: 55vw; font-size: 17px; }
body.web-mobile .subbar { display: flex; align-items: center; gap: 8px; padding: 5px 12px 6px; font-size: 12px; }
body.web-mobile .subbar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.web-mobile .subbar .web-switch { color: var(--accent); }
body.web-mobile #view { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
body.web-mobile .tile svg { width: 56px; height: 56px; }

/* 16px inputs: phones would zoom in otherwise */
body.web-mobile #phone input,
body.web-mobile #phone textarea { font-size: 16px; }

/* "On scene" needs the game world */
body.web-mobile #view .group-b:has(#nearby),
body.web-mobile #view .group-b:has(#nearby) + .group-f,
body.web-mobile #view .group-h:has(+ .group-b #nearby) { display: none; }

/* Sign-in on the phone: no taskbar */
body.web-mobile .win-taskbar { display: none; }
body.web-mobile .web-login { inset: 0; }
body.web-mobile .win-login-crest { width: 150px; }

/* PC view on a narrow screen: make room for the switch button */
@media (max-width: 600px) {
    body.web .win-place,
    body.web .win-clock { display: none; }
}

/* Bundesfrei (2026-11-14): Anmeldung mit Benutzername + Passwort */
.web-login-box { width: min(360px, 100%); }
.web-login-tabs { display: flex; width: 100%; margin-top: 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.25); }
#pc .web-login-tabs button { flex: 1; width: auto; height: 44px; border-radius: 0; background: transparent; color: rgba(255, 255, 255, 0.75); font-weight: 400; border-bottom: 2px solid transparent; }
#pc .web-login-tabs button[aria-selected="true"] { color: #fff; font-weight: 600; border-bottom-color: #60cdff; }
#pc .web-login-tabs button:hover { background: rgba(255, 255, 255, 0.08); }
.web-field { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; font-size: 14px; }
.web-field span { opacity: 0.9; }
#pc .web-login-box .web-field input { margin-top: 0; height: 44px; font-size: 16px; letter-spacing: normal; text-align: left; text-transform: none; }
#pc .web-login-box input[name="code"] { text-transform: uppercase; letter-spacing: 0.15em; }
#pc .web-login-box .web-submit { height: 44px; margin-top: 6px; }
.web-login-box .setup-only { display: none; }
.web-login-box.setup .setup-only { display: flex; }
.web-login-foot { font-size: 12px; line-height: 1.4; opacity: 0.7; }
