/* la2w — minimal design tokens. L2-ish palette: deep navy void, dark blue
   panels. */

:root {
    --l2-void: #060a14;
    --l2-panel: rgba(8, 14, 28, 0.82);
    --l2-border: #2b3d5f;
    --l2-ink: #e9e2cf;
    --l2-ink-dim: #9aa5bd;
    --l2-radius-sm: 3px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
    background: var(--l2-void);
    color: var(--l2-ink);
    font-family: Georgia, "Palatino Linotype", "Times New Roman", serif;
}

/* Fullscreen render target: the wgpu canvas fills the viewport. */
#scene {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: block;
}

/* Load-error line, bottom-left of the viewport. */
.status {
    position: fixed;
    left: 0.75rem;
    bottom: 0.75rem;
    margin: 0;
    font-size: 0.75rem;
    font-style: italic;
    color: var(--l2-ink-dim);
}

/* Tint over the whole view while the camera is under water. */
.underwater {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.underwater[hidden] {
    display: none;
}

/* DEBUG panel (F4), after Lineage2JS's debug view. */
.debug-view {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 10000;
    width: min(420px, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font: 13px monospace;
    border: 1px solid #444;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.debug-view[hidden] {
    display: none;
}

.debug-view header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.debug-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #444;
}

.debug-tabs button {
    flex: 1 0 auto;
}

.debug-view button,
.debug-view select,
.debug-view input[type="text"] {
    min-height: 26px;
    border: 1px solid #555;
    border-radius: 2px;
    background: #222;
    color: #ddd;
    font: inherit;
}

.debug-view button {
    padding: 4px 8px;
    cursor: pointer;
}

.debug-view button:hover,
.debug-view button.active {
    background: #38506b;
}

.debug-view select,
.debug-view input[type="text"] {
    width: 170px;
    padding: 3px 5px;
}

.debug-view input[type="range"] {
    width: 170px;
}

.debug-view input[type="checkbox"] {
    margin: 0;
}

.debug-content,
.debug-tab-panel {
    min-height: 0;
}

.debug-content {
    overflow: auto;
}

.debug-info {
    margin: 12px 0 0;
    color: #aaa;
    white-space: pre;
}

.debug-graph {
    display: block;
    width: 100%;
    height: auto;
    margin: 4px 0 8px;
    border: 1px solid #333;
    background: #111;
}

.debug-section {
    margin: 0 0 6px;
    border: 1px solid #333;
    background: rgba(0, 0, 0, 0.2);
}

.debug-section summary {
    padding: 7px 8px;
    color: #fff;
    cursor: pointer;
    user-select: none;
}

.debug-section > .debug-row,
.debug-section > button,
.debug-section > .debug-info {
    margin: 5px 8px;
}

.debug-subsection > .debug-row {
    margin: 5px 8px;
}

.debug-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    align-items: center;
    gap: 8px;
    min-height: 28px;
}

.debug-row > span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.debug-row > input[type="checkbox"] {
    justify-self: end;
}
