/* The palette and the proportions come from the in-game window: bronze frames,
   gold captions, a dark slate interior and a blue progress trough. */
:root {
    --bg: #07070a;
    --panel: #0d0d12;
    --panel-soft: #121218;
    --frame: #8a7a4e;
    --frame-dim: #5c5132;
    --gold: #d6a84a;
    --gold-dim: #a9743a;
    --text: #d2cec4;
    --text-dim: #9a9488;
    --blue: #3a3ad6;
    --blue-dark: #1b1b6b;
    --tile-w: 420px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
    font-size: 14px;
}

.hidden { display: none !important; }

/* ------------------------------------------------------------ window frame */
.window {
    margin: 10px;
    border: 2px solid var(--frame);
    outline: 1px solid #2a2418;
    background: var(--panel);
    box-shadow: inset 0 0 0 2px #241f14, 0 0 24px #000;
}

.title-bar {
    position: relative;
    border-bottom: 2px solid var(--frame);
    background: linear-gradient(#2a2418, #17140d);
    color: var(--gold);
    text-align: center;
    padding: 5px 12px;
    letter-spacing: .5px;
}

.user-chip {
    position: absolute;
    right: 12px;
    top: 5px;
    color: var(--text-dim);
    font-size: 12px;
}

.user-chip a { color: var(--gold-dim); margin-left: 8px; }

.window-body { display: flex; align-items: flex-start; gap: 10px; padding: 10px; }

/* -------------------------------------------------------------- side panel */
.side { flex: 0 0 330px; position: sticky; top: 10px; }

.mw-box {
    border: 1px solid var(--frame-dim);
    outline: 1px solid #000;
    background: var(--panel-soft);
    padding: 10px;
}

.side-box > * + * { margin-top: 8px; }

.row { display: flex; align-items: center; gap: 8px; }
.row.spread { justify-content: space-between; }
.row > label, .label { color: var(--text); white-space: nowrap; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.mw-sep {
    border: 0;
    border-top: 1px solid var(--frame-dim);
    opacity: .6;
    margin: 12px 0;
}

.mw-input, .mw-select {
    flex: 1;
    min-width: 0;
    background: #08080c;
    border: 1px solid var(--frame-dim);
    color: var(--text);
    padding: 4px 6px;
    font: inherit;
    font-size: 13px;
}

.mw-input:focus, .mw-select:focus { outline: none; border-color: var(--gold); }

.mw-button {
    background: linear-gradient(#1d1a12, #121009);
    border: 1px solid var(--frame-dim);
    color: var(--gold-dim);
    padding: 4px 10px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.mw-button:hover { border-color: var(--frame); color: var(--gold); }
.mw-button.small { padding: 3px 8px; }
.mw-button.active { color: #f0e3c0; border-color: var(--gold); background: linear-gradient(#3a3016, #241d0d); }

/* -------------------------------------------------------------- tile grid */
.grid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.set-head {
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 -4px;
}

.set-head::after { content: ''; flex: 1; border-top: 1px solid var(--frame-dim); }

.set-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--tile-w), 1fr));
    gap: 10px;
}

.tile {
    position: relative;
    border: 1px solid var(--frame-dim);
    background: #0a0a0e;
    padding: 10px;
    height: 136px;
    display: grid;
    grid-template-columns: 64px 1fr;
    grid-template-rows: auto 1fr auto;
    column-gap: 12px;
    cursor: pointer;
    overflow: hidden;
}

.tile:hover { border-color: var(--frame); }

.tile.tested {
    background: linear-gradient(#2a2410, #16130a);
    border-color: var(--gold-dim);
}

.tile .icon {
    grid-row: 1 / 3;
    width: 64px;
    height: 64px;
    border: 1px solid var(--frame-dim);
    background: #000;
    display: block;
}

.tile.locked .icon { opacity: .55; }

.tile .name {
    margin: 0 70px 0 0;
    color: var(--gold-dim);
    font-size: 15px;
    font-weight: normal;
    line-height: 1.2;
}

.tile.tested .name { color: var(--gold); }

.tile .desc {
    margin: 4px 60px 0 0;
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.3;
    grid-column: 2;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tile .foot {
    grid-column: 1 / 3;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-right: 34px;
    align-self: end;
}

.mini { width: 24px; height: 24px; border: 1px solid var(--frame-dim); background: #000; opacity: .45; }

.bar {
    position: relative;
    flex: 1;
    height: 22px;
    min-width: 80px;
    border: 1px solid var(--frame-dim);
    background: #08080c;
}

.bar > i { position: absolute; inset: 1px auto 1px 1px; background: linear-gradient(var(--blue), var(--blue-dark)); }

.bar > span {
    position: relative;
    display: block;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    color: #e8e2d4;
}

.tile .check, .tile .fav {
    position: absolute;
    right: 10px;
    width: 25px;
    height: 25px;
    border: 1px solid var(--frame-dim);
    background: #0a0a0e;
    color: var(--gold);
    font: inherit;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.tile .check { top: 10px; }
.tile .fav { top: 40px; color: var(--gold-dim); opacity: .4; }
.tile .fav.on { opacity: 1; color: var(--gold); }

.badge {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 24px;
    height: 24px;
    border: 1px solid currentColor;
    display: grid;
    place-items: center;
    font-size: 15px;
}

.badge.progression { color: #6f8fe0; }
.badge.win_condition { color: #e0c558; }
.badge.missable { color: #d05a4a; }

.note-pin {
    position: absolute;
    left: 10px;
    bottom: 10px;
    background: #2a1d0d;
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    font-size: 11px;
    padding: 0 5px;
}

/* ------------------------------------------------------------------ drawer */
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 100vw;
    height: 100vh;
    overflow: auto;
    background: var(--panel-soft);
    border-left: 2px solid var(--frame);
    padding: 14px;
    box-shadow: -8px 0 24px #000a;
}

.drawer-head { display: flex; align-items: flex-start; gap: 10px; }
.drawer-head h2 { color: var(--gold); font-size: 17px; font-weight: normal; margin: 0; flex: 1; }
.drawer-desc { color: var(--text); }
.drawer-meta { color: var(--text-dim); font-size: 12px; }
.drawer-section { color: var(--gold); font-size: 14px; font-weight: normal; margin: 16px 0 6px; }
.drawer-objectives { margin-top: 10px; }
.drawer-objectives div { color: var(--text-dim); font-size: 12px; padding: 2px 0; }

.notes > * + * { margin-top: 8px; }

.note {
    border: 1px solid var(--frame-dim);
    background: #0a0a0e;
    padding: 8px;
    font-size: 13px;
}

.note header { display: flex; gap: 8px; font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.note .kind { color: var(--gold-dim); text-transform: uppercase; letter-spacing: .5px; }
.note .drop { margin-left: auto; color: var(--gold-dim); cursor: pointer; background: none; border: 0; font: inherit; }
.note p { margin: 0; white-space: pre-wrap; }

.note-form { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }

/* ------------------------------------------------------------------- login */
.login { position: fixed; inset: 0; display: grid; place-items: center; }

.login-box {
    border: 2px solid var(--frame);
    background: var(--panel-soft);
    padding: 28px 32px;
    max-width: 460px;
    text-align: center;
}

.login-box h1 { color: var(--gold); font-size: 20px; font-weight: normal; margin: 0 0 10px; }
.login-box p { color: var(--text-dim); }
.login-button { margin-top: 10px; padding: 8px 18px; }

@media (max-width: 900px) {
    .window-body { flex-direction: column; }
    .side { position: static; flex: 1 1 auto; width: 100%; }
    .drawer { width: 100vw; }
}
