/* Florenda Host panel: servers, rent form, server page, admin. Tokens come from fh.css. */
:root { --console-bg: #16171a; --console-text: #dcdde1; --warn: var(--fd-warn); --busy: var(--fd-accent-ink); }

.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;
}
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
.back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 4px;
}
.back:hover { color: var(--text); }

/* status badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 2px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid currentColor;
    flex: 0 0 auto;
}
.badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.badge-ok { color: var(--ok); }
.badge-busy { color: var(--busy); }
.badge-busy::before { animation: fbh-pulse 1.1s ease-in-out infinite; }
.badge-warn { color: var(--warn); }
.badge-bad { color: var(--danger); }
.badge-off { color: var(--muted); }
@keyframes fbh-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) {
    .badge-busy::before { animation: none; }
}

/* cards and layout */
.panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 14px;
}
.panel-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
    min-width: 0;
    margin: 0 0 14px;
}
.panel-grid .panel-card { margin: 0; }
.panel-card h2 { font-size: 18px; margin: 0 0 12px; }
.panel-card > p + p { margin-top: 8px; }
.acts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}
.acts .btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 8px 16px;
    font-size: 15px;
}
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.form-msg {
    margin: 12px 0 0;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    background: rgba(105, 219, 124, 0.1);
    border: 1px solid rgba(105, 219, 124, 0.35);
}
.form-msg.err {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.45);
    color: var(--danger);
}
.form-msg[hidden] { display: none; }

/* server page */
.srv-head { margin: 4px 0 18px; }
.srv-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
}
.srv-title-row h1 {
    font-size: clamp(26px, 4.2vw, 38px);
    line-height: 1.15;
    min-width: 0;
    overflow-wrap: anywhere;
}
.addr-line {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}
.addr-line code {
    font: 700 20px/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace;
    padding: 8px 12px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid var(--line);
    user-select: all;
    overflow-wrap: anywhere;
}
.addr-line code.is-empty {
    font: 500 15px/1.4 inherit;
    font-family: inherit;
    color: var(--muted);
    background: none;
    border: 0;
    padding: 0;
    user-select: text;
}
.addr-line [hidden] { display: none; }
.console {
    margin: 0;
    height: 320px;
    overflow: auto;
    padding: 14px;
    border-radius: 12px;
    background: var(--console-bg);
    color: var(--console-text);
    font: 13px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    border: 1px solid var(--line);
}
.console:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cmd {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.cmd input { flex: 1 1 auto; }

/* inputs (same look as the calculator selects) */
.rent-field {
    display: grid;
    gap: 6px;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}
.rent-field small { font-weight: 500; color: var(--muted); }
.rent-field input,
.rent-field select,
.cmd input,
.inline-field select,
.adm-row select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 8px 12px;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    background-color: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.rent-field select,
.inline-field select,
.adm-row select {
    padding-right: 38px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px 14px;
}
.rent-field input:focus-visible,
.rent-field select:focus-visible,
.cmd input:focus-visible,
.inline-field select:focus-visible,
.adm-row select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
.rent-field select:disabled { opacity: 0.5; cursor: not-allowed; }
.inline-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--muted);
}
.inline-field select { width: auto; }

/* rent form */
.rent-wrap { margin-top: 8px; }
.rent-wrap h2.sec { margin-top: 0; }
.rent-games {
    border: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.rent-games legend {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}
.rent-game { position: relative; display: block; cursor: pointer; }
.rent-game input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.rent-game-box {
    display: grid;
    gap: 2px;
    min-height: 64px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--bg);
}
.rent-game-box b { font-size: 17px; }
.rent-game-box small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.rent-game input:checked + .rent-game-box {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.rent-game input:focus-visible + .rent-game-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.rent-warn { color: var(--warn) !important; }
.rent-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
    align-items: end;
}
.rent-hint { color: var(--muted); font-size: 12.5px; margin: -6px 0 12px; line-height: 1.4; }
.rent-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: 12px;
    border: 1px dashed var(--accent);
    background: color-mix(in srgb, var(--accent) 7%, transparent);
    font-size: 14px;
    cursor: pointer;
}
.rent-check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); flex: 0 0 auto; }
.rent-total {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid var(--line-2);
}
.rent-total span { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rent-total small { color: var(--muted); font-size: 13px; }
.rent-submit { width: 100%; margin-top: 12px; min-height: 48px; }
.rent-note { color: var(--muted); font-size: 13px; margin-top: 10px; line-height: 1.45; }
.rent-note[hidden] { display: none; }

/* my servers */
.srv-list, .adm-list {
    list-style: none;
    display: grid;
    gap: 10px;
    margin: 0 0 14px;
}
.srv {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px 6px 6px;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--line);
}
.srv:hover { border-color: var(--accent); }
.srv-main {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "game name" "game meta";
    gap: 0 12px;
    align-items: center;
    min-width: 0;
    min-height: 56px;
    padding: 6px 10px;
    border-radius: 12px;
}
.srv-main:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.srv-game {
    grid-area: game;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    height: 44px;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    background: var(--grad);
}
.srv-name { grid-area: name; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-meta { grid-area: meta; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.srv-empty {
    padding: 18px;
    border-radius: 16px;
    border: 1px dashed var(--line);
    color: var(--muted);
    margin-bottom: 14px;
}
.srv-empty .btn { margin-top: 12px; }

/* admin */
.adm-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--line);
}
.adm-main { display: grid; gap: 2px; min-width: 0; }
.adm-name { font-weight: 700; overflow-wrap: anywhere; }
.adm-name:hover { color: var(--accent-2); }
.adm-row .acts { grid-column: 1 / -1; margin-top: 4px; }
.adm-row select { width: auto; }

@media (max-width: 860px) {
    .panel-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .nav .nav-wide { display: none; }
    .panel-card { padding: 16px; border-radius: 16px; }
    .rent-games, .rent-row { grid-template-columns: minmax(0, 1fr); }
    .addr-line code { font-size: 17px; }
    .console { height: 260px; font-size: 12px; }
    .cmd { flex-direction: column; }
    .acts .btn { flex: 1 1 auto; }
    .srv { flex-wrap: wrap; padding: 6px 12px 12px 6px; }
    .srv .badge { margin-left: 86px; }
}
