/* ==========================================================================
   Recaris design system - shared by recaris.eu and admin.recaris.eu.
   Source of truth: the "Design guide" page in the admin panel.
   Always dark, blocky like the game: 2px borders, small radii, hard
   offset shadows, pressable buttons. Orange (#FF8A1F) is the brand.
   ========================================================================== */

:root {
    --orange:        #ff8a1f;
    --orange-light:  #ff9d45;
    --orange-pale:   #ffb56e;
    --orange-dark:   #c96400;
    --orange-shadow: #9a4700;
    --orange-deep:   #6b3200;
    --ink:           #1c0f02;

    --bg:            #0d0c0b;
    --bg-deep:       #0a0908;
    --surface:       #151412;
    --surface-2:     #1c1a17;
    --surface-hover: #231a12;
    --border:        #2a2622;
    --border-2:      #37322c;
    --line:          #22201d;
    --line-soft:     #1e1c19;

    --text:          #f3efe9;
    --text-body:     #cfc7bd;
    --text-muted:    #a8a097;
    --text-faint:    #7a736b;
    --text-dim:      #6a645d;

    --ok:        #5bd68a;  --ok-bg:     #12301d;  --ok-bd:     #1f4a2e;
    --danger:    #ff7a6b;  --danger-bg: #3a1714;  --danger-bd: #4a2320;
    --warn:      #ff9d45;  --warn-bg:   #3a2410;
    --info:      #7ab4ff;  --info-bg:   #15263a;
    --neutral:   #a8a097;  --neutral-bg:#24211e;
    --red:       #e5483a;  --red-shadow:#7a1f17;

    --f-display: 'Bricolage Grotesque', 'Instrument Sans', system-ui, sans-serif;
    --f-body:    'Instrument Sans', system-ui, sans-serif;
    --f-mono:    'JetBrains Mono', ui-monospace, Consolas, monospace;
    --f-pixel:   'Silkscreen', 'JetBrains Mono', monospace;

    --radius-sm: 3px;
    --radius:    6px;
    --radius-lg: 8px;
    --wrap:      1280px;
}

/* ---------------------------------------------------------------- reset */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
    font-family: var(--f-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
img, svg, video { max-width: 100%; display: block; }
a { color: var(--orange-light); text-decoration: none; }
a:hover { color: var(--orange-pale); }
input, textarea, button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--orange); color: var(--ink); }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
code, kbd { font-family: var(--f-mono); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ typography */

.display   { font-family: var(--f-display); font-weight: 800; letter-spacing: -0.045em; line-height: 0.9; }
.heading   { font-family: var(--f-display); font-weight: 800; letter-spacing: -0.03em; line-height: 0.95; }
.pixel     { font-family: var(--f-pixel); font-weight: 400; }
.mono      { font-family: var(--f-mono); }
.accent    { color: var(--orange); }
.muted     { color: var(--text-muted); }
.faint     { color: var(--text-faint); }
.strong    { font-weight: 700; }
.nowrap    { white-space: nowrap; }
.pretty    { text-wrap: pretty; }

/* Silkscreen label - never for sentences */
.label     { font-family: var(--f-pixel); font-size: 11px; font-weight: 400; color: var(--text-faint); }
.eyebrow   { font-family: var(--f-pixel); font-size: 13px; color: var(--orange-light); margin: 0 0 12px; }

/* inline command / ip chip */
.cmd {
    font-family: var(--f-mono); font-size: 0.85em; color: var(--orange-light);
    background: #241c14; padding: 2px 6px; border-radius: var(--radius-sm);
}
.kbd-ip { font-family: var(--f-mono); color: var(--orange-light); }

/* --------------------------------------------------------------- buttons */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 18px; border-radius: var(--radius); border: 0;
    font-weight: 800; font-size: 15px; line-height: 1.2; text-decoration: none;
    cursor: pointer; transition: background .12s, border-color .12s, color .12s, transform .06s, box-shadow .06s;
    white-space: nowrap;
}
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }

.btn-primary { background: var(--orange); color: var(--ink); box-shadow: 0 5px 0 var(--orange-shadow); }
.btn-primary:hover { background: var(--orange-light); color: var(--ink); }
.btn-primary:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--orange-shadow); }

.btn-secondary { background: var(--surface-2); color: var(--text); border: 2px solid var(--border-2); box-shadow: 0 5px 0 #000; font-weight: 700; }
.btn-secondary:hover { border-color: var(--orange); color: var(--text); }
.btn-secondary:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #000; }

.btn-ghost { background: transparent; color: var(--text-muted); font-weight: 600; padding-left: 12px; padding-right: 12px; }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }

.btn-danger-outline { background: transparent; color: var(--danger); border: 2px solid var(--danger-bd); font-weight: 700; }
.btn-danger-outline:hover { background: var(--danger-bg); color: var(--danger); }

.btn-danger { background: var(--red); color: #fff; box-shadow: 0 5px 0 var(--red-shadow); }
.btn-danger:hover { background: #f05a4c; color: #fff; }
.btn-danger:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--red-shadow); }

.btn-success-outline { background: var(--ok-bg); color: var(--ok); border: 2px solid #2a4a36; font-weight: 700; }
.btn-success-outline:hover { background: #173d26; color: var(--ok); }

/* on orange backgrounds */
.btn-ink { background: var(--ink); color: var(--orange-pale); box-shadow: 0 6px 0 #000; font-family: var(--f-mono); font-weight: 600; }
.btn-ink:hover { color: #ffd2a3; }
.btn-ink:active { transform: translateY(4px); box-shadow: 0 2px 0 #000; }
.btn-outline-ink { background: transparent; color: var(--ink); border: 3px solid var(--ink); }
.btn-outline-ink:hover { background: var(--ink); color: var(--orange-light); }

.btn-sm  { padding: 8px 12px; font-size: 13.5px; }
.btn-sm.btn-primary   { box-shadow: 0 3px 0 var(--orange-shadow); }
.btn-sm.btn-secondary { box-shadow: 0 3px 0 #000; }
.btn-sm.btn-danger    { box-shadow: 0 3px 0 var(--red-shadow); }
.btn-lg  { padding: 16px 22px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }

.text-link { font-weight: 700; }

/* ---------------------------------------------------------------- badges */

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--f-pixel); font-size: 10px; line-height: 1.3;
    padding: 4px 8px; border-radius: var(--radius-sm);
    background: var(--neutral-bg); color: var(--neutral); white-space: nowrap;
}
.badge.dot::before { content: ''; width: 6px; height: 6px; background: currentColor; flex: none; }
.badge-green  { background: var(--ok-bg);      color: var(--ok); }
.badge-red    { background: var(--danger-bg);  color: var(--danger); }
.badge-orange { background: var(--warn-bg);    color: var(--warn); }
.badge-blue   { background: var(--info-bg);    color: var(--info); }
.badge-gray   { background: var(--neutral-bg); color: var(--neutral); }
.badge-solid  { background: var(--orange);     color: var(--ink); }
.badge-danger-solid { background: var(--red); color: #fff; }
.badge-lg { font-size: 11px; padding: 5px 10px; }

/* square status dot */
.sq { display: inline-block; width: 8px; height: 8px; background: currentColor; flex: none; }
.sq-green { background: var(--ok); } .sq-red { background: var(--danger); } .sq-orange { background: var(--orange); } .sq-gray { background: var(--border-2); }

/* ----------------------------------------------------------------- forms */

.field { display: grid; gap: 8px; font-family: var(--f-pixel); font-size: 11px; color: var(--text-body); }
.field > .field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.help { font-family: var(--f-body); font-size: 13px; color: var(--text-faint); }
.field.has-error { color: var(--danger); }
.field.has-error .input { border-color: var(--red); }
.field.has-error .help { color: var(--danger); }

.input, .select, .textarea {
    width: 100%; padding: 13px 14px; border-radius: var(--radius);
    border: 2px solid var(--border-2); background: var(--bg); color: var(--text);
    font-family: var(--f-body); font-size: 15px; outline: none; transition: border-color .12s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--orange); }
.textarea { resize: vertical; line-height: 1.55; }
.input.mono, .textarea.mono { font-family: var(--f-mono); font-size: 13.5px; }
.select { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--text-faint) 50%), linear-gradient(135deg, var(--text-faint) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.select option { background: var(--surface); color: var(--text); }
input[type="date"].input { color-scheme: dark; }
.input-sm, .select.input-sm { padding: 9px 11px; font-size: 14px; }
.select.input-sm { padding-right: 32px; }

.check { display: inline-flex; gap: 10px; align-items: center; font-family: var(--f-body); font-size: 15px; color: var(--text-body); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--orange); margin: 0; flex: none; }

.input-prefix { display: flex; align-items: center; border-radius: var(--radius); border: 2px solid var(--border-2); background: var(--bg); overflow: hidden; }
.input-prefix:focus-within { border-color: var(--orange); }
.input-prefix span { padding: 12px 0 12px 12px; font-family: var(--f-mono); font-size: 12.5px; color: var(--text-dim); white-space: nowrap; }
.input-prefix input { flex: 1; min-width: 0; padding: 12px 12px 12px 2px; border: 0; background: transparent; color: var(--orange-light); font-family: var(--f-mono); font-size: 12.5px; outline: none; }

/* segmented control (Java | Bedrock, ranges) */
.seg { display: inline-flex; flex-wrap: wrap; padding: 5px; border-radius: var(--radius-lg); background: var(--surface); border: 2px solid var(--border); gap: 4px; }
.seg > * { padding: 11px 20px; border-radius: 5px; border: 0; background: transparent; color: var(--text-body); font-weight: 800; font-size: 15px; text-align: center; }
.seg > *:hover { color: var(--text); }
.seg > .is-active, .seg > [aria-selected="true"] { background: var(--orange); color: var(--ink); }
.seg-sm > * { padding: 8px 13px; font-size: 13.5px; font-weight: 700; }

/* filter chips */
.chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 5px;
    border: 2px solid var(--border); background: var(--surface); color: var(--text-body);
    font-size: 13.5px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--border-2); }
.chip.is-active { border-color: var(--orange); background: var(--orange); color: var(--ink); }
.chip .count { font-family: var(--f-pixel); font-size: 10px; opacity: .75; }

/* toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 5px; border: 2px solid var(--border); background: var(--bg); font-size: 14px; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 34px; height: 18px; border-radius: 3px; background: var(--border-2); position: relative; flex: none; transition: background .12s; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 2px; background: var(--text); transition: left .12s; }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { left: 18px; }
.switch input:focus-visible + .track { outline: 2px solid var(--orange); outline-offset: 2px; }

/* ------------------------------------------------------- cards & panels */

.card { border-radius: var(--radius-lg); background: var(--surface); border: 2px solid var(--border); }
.card-pad { padding: 26px; }
.card-hover:hover { border-color: var(--orange); }
.card-hl { box-shadow: 8px 8px 0 var(--orange); }
.card-hl-dark { box-shadow: 8px 8px 0 var(--orange-shadow); }
.card-hl-green { box-shadow: 8px 8px 0 var(--ok); }
.card-dashed { border-style: dashed; border-color: var(--border-2); background: transparent; }
.card-danger { background: #170f0e; border-color: var(--danger-bd); }
.card-on-orange { background: var(--ink); color: var(--text); box-shadow: 6px 6px 0 var(--orange-shadow); border-radius: var(--radius-lg); }

/* block avatar - looks like a Minecraft block */
.block {
    display: grid; place-items: center; flex: none;
    width: 36px; height: 36px; border-radius: 4px;
    background: var(--orange); color: var(--ink);
    font-family: var(--f-display); font-weight: 800; font-size: 19px;
    box-shadow: inset -4px -4px 0 var(--orange-dark), inset 4px 4px 0 var(--orange-pale);
}
.block-xs { width: 22px; height: 22px; font-size: 11px; box-shadow: inset -2px -2px 0 var(--orange-dark), inset 2px 2px 0 var(--orange-pale); font-family: var(--f-pixel); font-weight: 400; }
.block-sm { width: 32px; height: 32px; font-size: 15px; box-shadow: inset -3px -3px 0 var(--orange-dark), inset 3px 3px 0 var(--orange-pale); }
.block-lg { width: 64px; height: 64px; font-size: 28px; box-shadow: inset -6px -6px 0 var(--orange-dark), inset 6px 6px 0 var(--orange-pale); }
.block-xl { width: 88px; height: 88px; font-size: 40px; box-shadow: inset -8px -8px 0 var(--orange-dark), inset 8px 8px 0 var(--orange-pale); }
.block img { width: 100%; height: 100%; border-radius: 4px; image-rendering: pixelated; }

/* ------------------------------------------------ minecraft chat preview */

.mc-line {
    padding: 10px 12px; border-radius: 5px; background: #000;
    font-family: var(--f-mono); font-size: 13px; color: #fff; min-height: 38px;
    white-space: pre-wrap; word-break: break-word;
}
.mc-line .mc-b { font-weight: 800; } .mc-line .mc-i { font-style: italic; }
.mc-line .mc-u { text-decoration: underline; } .mc-line .mc-s { text-decoration: line-through; }
.mc-line .mc-hint { color: var(--text-dim); }

/* -------------------------------------------------------------- progress */

.bar { height: 12px; border-radius: 2px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--orange); }
.bar-sm { height: 10px; }

/* ------------------------------------------------------ image slot / media */

.media { position: relative; overflow: hidden; background: var(--surface-2); }
.media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-ph {
    position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center;
    background:
        radial-gradient(420px 220px at 80% 20%, rgba(255,138,31,0.10), transparent 70%),
        repeating-linear-gradient(45deg, #1c1a17 0 12px, #181614 12px 24px);
    color: var(--text-dim); font-family: var(--f-pixel); font-size: 11px;
}
.media-ph::before { content: ''; display: block; width: 26px; height: 26px; margin: 0 auto 8px; border: 2px solid var(--border-2); border-radius: 3px; box-shadow: inset 0 -8px 0 rgba(255,138,31,.15); }
.media-ph span { max-width: 260px; }

/* ----------------------------------------------------------- toast/modal */

.toast-stack { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
    display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--radius);
    background: var(--surface); border: 2px solid var(--orange); box-shadow: 6px 6px 0 var(--orange-shadow);
    font-size: 14.5px; font-weight: 600; color: var(--text); animation: toast-in .18s ease-out;
}
.toast::before { content: ''; width: 10px; height: 10px; flex: none; background: var(--ok); }
.toast.toast-error { border-color: var(--red); box-shadow: 6px 6px 0 var(--red-shadow); }
.toast.toast-error::before { background: var(--danger); }
.toast.toast-warning::before { background: var(--orange); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

dialog.modal {
    width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; background: transparent; color: var(--text); overflow: visible;
}
dialog.modal::backdrop { background: rgba(0,0,0,0.7); }
.modal-box { padding: 26px; border-radius: var(--radius-lg); background: var(--surface); border: 2px solid var(--border); box-shadow: 10px 10px 0 var(--orange); display: grid; gap: 16px; max-height: calc(100vh - 48px); overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-head h2 { font-family: var(--f-display); font-weight: 800; font-size: 24px; }
.icon-btn { width: 36px; height: 36px; border-radius: 5px; border: 2px solid var(--border-2); background: var(--surface-2); color: var(--text); display: grid; place-items: center; font-size: 14px; }
.icon-btn:hover { border-color: var(--orange); }

/* ----------------------------------------------------------------- misc */

.flash { padding: 14px 18px; border-radius: var(--radius); border: 2px solid var(--border); background: var(--surface); font-weight: 600; }
.flash-success { border-color: var(--ok-bd); background: var(--ok-bg); color: #cfe8d8; }
.flash-error   { border-color: var(--danger-bd); background: var(--danger-bg); color: #f3cfc9; }
.flash-warning { border-color: #5a3514; background: var(--warn-bg); color: #f6d3b0; }

.empty { padding: 44px 22px; text-align: center; color: var(--text-muted); font-size: 15px; }
.divider { border: 0; border-top: 2px solid var(--line); margin: 0; }
.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row-between { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.ml-auto { margin-left: auto; }
