/* DRS Job Creator — admin tablet + player menus */
:root {
    --backdrop: rgba(5, 6, 10, 0.55);
    --bezel: #0b0c11;
    --bezel-edge: #262833;
    --screen: #0d0f17;
    --window: #121420;
    --card: #171a28;
    --card-2: #1c2031;
    --row: #161826;
    --line: #242739;
    --line-soft: #1d2030;
    --white: #f3f4fa;
    --text: #d7d9e6;
    --muted: #868aa3;
    --accent: #8b8ff8;
    --accent-strong: #6d71f0;
    --accent-soft: rgba(139, 143, 248, 0.16);
    --danger: #ff6b66;
    --danger-soft: rgba(255, 107, 102, 0.14);
    --success: #4ade80;
    --success-soft: rgba(74, 222, 128, 0.13);
    --warning: #fbbf24;
    --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: "Manrope", "Segoe UI", sans-serif; }
body { height: 100vh; width: 100vw; overflow: hidden; background: transparent; color: var(--text); }
.hidden { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font: inherit; color: var(--white); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { display: block; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: #2e3248 transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2e3248; border-radius: 6px; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

/* ================================================================ tablet */

.app { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--backdrop); }

.tablet {
    position: relative;
    width: min(1240px, 95vw); height: min(780px, 90vh);
    padding: 16px; border-radius: 42px;
    background: linear-gradient(145deg, #1a1c24 0%, var(--bezel) 38%, var(--bezel) 70%, #16171e 100%);
    box-shadow: 0 0 0 1.5px var(--bezel-edge), 0 0 0 5px #07080b, 0 50px 120px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    animation: tablet-in 0.38s cubic-bezier(0.2, 0.9, 0.25, 1.05);
}
@keyframes tablet-in { from { opacity: 0; transform: translateY(40px) scale(0.97); } to { opacity: 1; transform: none; } }
.tablet-camera { position: absolute; top: 5px; left: 50%; transform: translateX(-50%); width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #3b4160, #0a0b10 70%); }
.tablet-button { position: absolute; background: #1b1d25; border-radius: 3px; }
.tablet-button-power { top: -4px; right: 120px; width: 56px; height: 4px; }
.tablet-button-vol { right: -4px; top: 110px; width: 4px; height: 70px; }

.screen {
    position: relative; width: 100%; height: 100%;
    border-radius: 28px; overflow: hidden; display: flex; flex-direction: column;
    background:
        radial-gradient(900px 500px at 8% -10%, rgba(139, 143, 248, 0.18), transparent 60%),
        radial-gradient(700px 420px at 105% 110%, rgba(94, 234, 212, 0.06), transparent 60%),
        var(--screen);
}
.statusbar { height: 34px; flex: none; display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 10px; padding: 0 22px; font-size: 12.5px; font-weight: 700; color: var(--white); }
.sb-time, .sb-pct { font-variant-numeric: tabular-nums; }
.sb-date { color: var(--muted); font-weight: 600; }
.sb-center { justify-self: center; color: var(--muted); font-weight: 600; }
.sb-icons { display: flex; align-items: center; gap: 7px; }
.sb-icons svg { width: 15px; height: 15px; }
.sb-battery { position: relative; width: 24px; height: 12px; border-radius: 3.5px; border: 1.5px solid rgba(243, 244, 250, 0.7); padding: 1.5px; }
.sb-battery-level { display: block; height: 100%; width: 92%; border-radius: 1.5px; background: var(--white); }
.home-indicator { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); width: 130px; height: 5px; border-radius: 3px; background: rgba(243, 244, 250, 0.3); }

.screen-body { flex: 1; min-height: 0; display: flex; gap: 14px; padding: 4px 16px 26px 12px; }

/* dock */
.dock { flex: none; width: 96px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0; }
.dock-brand { padding: 4px 0 12px; }
.dock-logo { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; font-weight: 800; font-size: 14px; letter-spacing: 0.06em; color: #fff; background: linear-gradient(145deg, var(--accent), var(--accent-strong)); box-shadow: 0 10px 24px -8px rgba(109, 113, 240, 0.7); }
.dock-btn { width: 84px; display: grid; justify-items: center; gap: 6px; padding: 8px 4px; border-radius: 16px; color: var(--muted); transition: background 0.15s, color 0.15s; }
.dock-btn:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.dock-btn.active { color: var(--white); background: var(--accent-soft); }
.app-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--card-2); color: var(--accent); transition: transform 0.15s; }
.dock-btn.active .app-icon { background: linear-gradient(145deg, var(--accent), var(--accent-strong)); color: #fff; }
.dock-btn:hover .app-icon { transform: translateY(-1px); }
.app-icon svg { width: 22px; height: 22px; }
.app-label { font-size: 11.5px; font-weight: 700; }
.dock-close { margin-top: auto; width: 84px; display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 16px; color: var(--danger); font-size: 11.5px; font-weight: 700; }
.dock-close svg { width: 22px; height: 22px; }
.dock-close:hover { background: var(--danger-soft); }

/* window */
.window { flex: 1; min-width: 0; display: flex; flex-direction: column; border-radius: 22px; background: var(--window); border: 1px solid var(--line-soft); overflow: hidden; }
.win-head { flex: none; display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.win-title { flex: 1; min-width: 0; }
.win-title h2 { font-size: 19px; font-weight: 800; color: var(--white); }
.win-title p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.search { position: relative; width: 240px; }
.search svg { position: absolute; left: 12px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; height: 38px; padding: 0 12px 0 34px; border-radius: 12px; border: 1px solid var(--line); background: var(--row); }
.search input:focus { outline: none; border-color: var(--accent); }

.split { flex: 1; min-height: 0; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.groups { border-right: 1px solid var(--line-soft); overflow-y: auto; padding: 10px; display: grid; align-content: start; gap: 4px; }
.group { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; text-align: left; transition: background 0.12s; }
.group:hover { background: var(--row); }
.group.active { background: var(--accent-soft); }
.group-avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--accent); background: var(--card-2); }
.group.active .group-avatar { background: var(--accent); color: #fff; }
.group-name { min-width: 0; }
.group-name strong { display: block; font-size: 13.5px; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-name span { font: 600 11px var(--mono); color: var(--muted); }
.count { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; font: 700 11px var(--mono); color: var(--muted); background: var(--row); }
.count.has { color: var(--accent); background: var(--accent-soft); }

.detail { overflow-y: auto; padding: 20px; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.detail-head h3 { font-size: 20px; font-weight: 800; color: var(--white); }
.detail-head .mono { font: 600 12px var(--mono); color: var(--muted); }
.grade-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.grade-chip { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--row); color: var(--muted); border: 1px solid var(--line); }
.grade-chip b { color: var(--text); font-family: var(--mono); margin-right: 3px; }

.empty { display: grid; place-items: center; text-align: center; gap: 8px; padding: 60px 20px; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--card-2); color: var(--accent); }
.empty-icon svg { width: 26px; height: 26px; }
.empty strong { color: var(--white); font-size: 15px; }

/* marker cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.mcard { display: grid; gap: 12px; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line-soft); transition: border-color 0.15s; }
.mcard:hover { border-color: var(--line); }
.mcard.off { opacity: 0.55; }
.mcard-top { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; }
.type-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: var(--c, var(--accent)); background: var(--cs, var(--accent-soft)); }
.type-ic svg { width: 21px; height: 21px; }
.mcard-top strong { display: block; font-size: 14px; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard-top span { font-size: 12px; color: var(--muted); }
.mcard-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: var(--row); color: var(--muted); }
.tag.mono { font-family: var(--mono); }
.mcard-actions { display: flex; gap: 6px; }
.mcard-actions .btn { flex: 1; }

/* switch */
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #2a2e44; transition: background 0.15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 11px; font-size: 12.5px; font-weight: 700; transition: background 0.15s, color 0.15s, border-color 0.15s; white-space: nowrap; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); }
.btn-primary:hover { background: linear-gradient(135deg, #9a9dfa, var(--accent)); }
.btn-ghost { color: var(--text); background: var(--row); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--white); }
.btn-danger { color: var(--danger); background: var(--danger-soft); }
.btn-danger:hover { background: rgba(255, 107, 102, 0.24); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 11.5px; border-radius: 9px; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn[disabled] { opacity: 0.55; cursor: default; }

/* ================================================================ editor */

.editor { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.editor-body { flex: 1; overflow-y: auto; padding: 18px 20px 30px; display: grid; gap: 14px; align-content: start; }
.section { padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line-soft); display: grid; gap: 14px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-title h4 { font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); line-height: 1.5; }

.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.type-opt { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; padding: 10px; border-radius: 13px; text-align: left; background: var(--row); border: 1px solid var(--line-soft); transition: border-color 0.15s, background 0.15s; }
.type-opt .type-ic { width: 36px; height: 36px; border-radius: 11px; }
.type-opt strong { display: block; font-size: 13px; color: var(--white); }
.type-opt span { font-size: 11px; color: var(--muted); line-height: 1.35; }
.type-opt:hover { border-color: var(--line); }
.type-opt.active { border-color: var(--c, var(--accent)); background: var(--cs, var(--accent-soft)); }

.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.field input, .field select {
    width: 100%; height: 38px; padding: 0 12px; border-radius: 11px;
    border: 1px solid var(--line); background: var(--row);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field input[type="color"] { padding: 4px; cursor: pointer; }
.field .mono, input.mono { font-family: var(--mono); font-size: 12.5px; }
select option { background: #1a1d2c; }
.row-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--row); }
.toggle-row strong { font-size: 13px; color: var(--white); }

.segmented { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--row); border: 1px solid var(--line); gap: 2px; }
.segmented button { height: 32px; padding: 0 14px; border-radius: 9px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.segmented button.active { background: var(--accent); color: #fff; }

/* list editors (vehicles, items, outfits) */
.rows { display: grid; gap: 8px; }
.lrow { display: grid; gap: 8px; align-items: end; padding: 10px; border-radius: 12px; background: var(--row); border: 1px solid var(--line-soft); }
.lrow .field input, .lrow .field select { height: 34px; background: var(--window); }
.lrow-veh { grid-template-columns: 64px 1.1fr 1.3fr 0.8fr 0.6fr 0.6fr 30px; }
.lrow-item { grid-template-columns: 48px 1.1fr 1.3fr 0.8fr 0.9fr 0.55fr 0.8fr 30px; }
.lrow-outfit { grid-template-columns: 1.6fr 0.9fr auto auto 30px; }
.thumb { width: 64px; height: 40px; border-radius: 8px; background: var(--window) center / cover no-repeat; border: 1px solid var(--line-soft); }
.lrow-item .thumb { width: 48px; height: 40px; background-size: contain; }
.adder { display: flex; gap: 8px; }
.adder input { flex: 1; height: 36px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--row); }
.adder input:focus { outline: none; border-color: var(--accent); }
.muted-line { font-size: 12px; color: var(--muted); padding: 6px 2px; }

/* modal + toasts */
.modal { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5, 6, 10, 0.6); z-index: 20; }
.modal-card { width: min(420px, 90%); padding: 22px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); display: grid; gap: 18px; }
.modal-card p { color: var(--white); font-size: 14.5px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toasts { position: absolute; top: 46px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 30; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 700; background: #20243a; color: var(--white); border: 1px solid var(--line); }
.toast.ok { border-color: rgba(74, 222, 128, 0.4); }
.toast.err { border-color: rgba(255, 107, 102, 0.5); color: #ffd1cf; }

/* help */
.help { padding: 24px; display: grid; gap: 14px; overflow-y: auto; }
.help-step { display: grid; grid-template-columns: 38px 1fr; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; background: var(--card); }
.help-step b { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 800 15px var(--mono); }

/* ================================================================ player menus (over the game: solid, no shadows or animations) */

.menu-wrap { position: fixed; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding: 0 3vw; pointer-events: none; }
.menu {
    pointer-events: auto; width: min(460px, 92vw); max-height: 82vh;
    display: flex; flex-direction: column;
    border-radius: 20px; background: rgb(15, 17, 26); border: 1px solid rgb(40, 43, 60); overflow: hidden;
}
.menu-head { display: grid; grid-template-columns: 44px 1fr 34px; gap: 12px; align-items: center; padding: 16px 16px 14px; border-bottom: 1px solid rgb(33, 36, 52); }
.menu-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: var(--c, var(--accent)); background: rgb(28, 31, 48); }
.menu-icon svg { width: 22px; height: 22px; }
.menu-kind { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c, var(--accent)); }
.menu-titles h1 { font-size: 18px; font-weight: 800; color: var(--white); line-height: 1.2; }
.menu-x { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); background: rgb(24, 27, 40); }
.menu-x:hover { color: var(--white); }
.menu-x svg { width: 16px; height: 16px; }
.menu-money { display: flex; gap: 8px; padding: 10px 16px; border-bottom: 1px solid rgb(33, 36, 52); }
.menu-money span { font: 700 12px var(--mono); padding: 4px 9px; border-radius: 8px; background: rgb(24, 27, 40); color: var(--text); }
.menu-body { overflow-y: auto; padding: 12px; display: grid; gap: 8px; }

.veh { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 14px; background: rgb(22, 25, 38); border: 1px solid rgb(33, 36, 52); }
.veh-img { width: 110px; height: 62px; border-radius: 10px; background: rgb(28, 31, 48) center / cover no-repeat; }
.veh strong { display: block; font-size: 14px; color: var(--white); }
.veh span { font: 600 11.5px var(--mono); color: var(--muted); }

.item { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; background: rgb(22, 25, 38); border: 1px solid rgb(33, 36, 52); }
.item-img { width: 52px; height: 52px; border-radius: 12px; background: rgb(28, 31, 48) center / 80% no-repeat; }
.item strong { display: block; font-size: 14px; color: var(--white); }
.item .price { font: 700 12.5px var(--mono); color: var(--success); }
.item .price em { font-style: normal; color: var(--muted); font-weight: 600; }
.buy { display: grid; justify-items: end; gap: 6px; }
.qty { display: inline-flex; align-items: center; border-radius: 9px; background: rgb(28, 31, 48); }
.qty button { width: 26px; height: 26px; font-weight: 800; color: var(--muted); }
.qty button:hover { color: var(--white); }
.qty span { min-width: 22px; text-align: center; font: 700 12px var(--mono); color: var(--white); }

.outfit-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; border-radius: 14px; background: rgb(22, 25, 38); border: 1px solid rgb(33, 36, 52); font-size: 14px; font-weight: 700; color: var(--white); text-align: left; }
.outfit-btn:hover { border-color: var(--accent); }
.outfit-btn svg { width: 16px; height: 16px; color: var(--muted); }

/* [E] prompt */
.prompt { position: fixed; top: 0; bottom: 0; margin: auto 0; height: max-content; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 12px; background: rgb(15, 16, 24); border: 1px solid rgb(38, 40, 54); }
.prompt.right-center { right: 2.4vw; }
.prompt.left-center { left: 2.4vw; }
.prompt.center { left: 0; right: 0; margin: auto; width: max-content; top: 12vh; }
.prompt-key { min-width: 28px; height: 28px; padding: 0 8px; border-radius: 8px; display: grid; place-items: center; font: 800 13px var(--mono); color: #0f1020; background: var(--accent); }
.prompt-text { font-size: 13px; font-weight: 700; color: var(--white); white-space: nowrap; }

@media (max-height: 700px) {
    .tablet { padding: 12px; border-radius: 34px; }
    .screen { border-radius: 24px; }
}
@media (prefers-reduced-motion: reduce) { .tablet { animation: none; } }
