/* Before I Start — styles */
:root {
    --gold: #e8c46a;
    --ink: #f0e8dc;
    --card: #1c1610;
    --card2: #261e15;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0d0a07;
    color: var(--ink);
    -webkit-user-select: none; user-select: none;
    -webkit-tap-highlight-color: transparent;
}
#app { position: relative; width: 100vw; height: 100vh; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#fx { position: fixed; pointer-events: none; z-index: 5; }

#ember, #emberCore { transition: opacity .6s; }

.topbtns { position: fixed; top: 12px; right: 12px; z-index: 10; display: flex; gap: 8px; }
.icon-btn {
    width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(20,14,8,.6); color: #e0d0b8;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; backdrop-filter: blur(6px);
    transition: background .2s, transform .15s;
}
.icon-btn:hover { background: rgba(60,44,26,.75); transform: scale(1.06); }
.icon-btn.sm { width: 28px; height: 28px; font-size: 17px; line-height: 1; }

.taskline {
    position: fixed; top: 60px; left: 50%; transform: translateX(-50%);
    z-index: 7; font-size: 14px; letter-spacing: .05em; color: rgba(240,220,190,.85);
    text-shadow: 0 1px 4px rgba(0,0,0,.7); max-width: 86vw; text-align: center;
    pointer-events: none; font-style: italic;
}
.clock {
    position: fixed; top: 88px; left: 50%; transform: translateX(-50%);
    z-index: 7; font-size: 34px; font-weight: 200; letter-spacing: .12em;
    color: #ffe9b0; text-shadow: 0 0 18px rgba(255,180,80,.35);
    font-variant-numeric: tabular-nums; pointer-events: none;
}
#status {
    position: fixed; left: 12px; bottom: 12px; z-index: 8;
    font-size: 11.5px; letter-spacing: .04em; color: rgba(230,210,180,.7);
    text-shadow: 0 1px 3px rgba(0,0,0,.7); pointer-events: none;
}
#hint {
    position: fixed; bottom: 96px; left: 50%; transform: translate(-50%, 8px);
    z-index: 9; font-size: 12.5px; color: #ffe9b0;
    background: rgba(30,20,10,.78); padding: 7px 14px; border-radius: 20px;
    border: 1px solid rgba(255,220,140,.25); opacity: 0; pointer-events: none;
    transition: opacity .4s, transform .4s; max-width: 88vw; text-align: center;
}
#hint.show { opacity: 1; transform: translate(-50%, 0); }

/* cards */
.cardx {
    position: fixed; left: 50%; bottom: 46px; transform: translateX(-50%);
    z-index: 12; width: min(320px, 88vw);
    background: rgba(26,19,12,.92); border: 1px solid rgba(232,196,106,.28);
    border-radius: 18px; padding: 20px 22px; text-align: center;
    backdrop-filter: blur(8px);
    box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.cardx .big {
    font-size: 15px; letter-spacing: .35em; color: var(--gold);
    margin-bottom: 14px; font-weight: 600;
}
.cardx input {
    width: 100%; background: var(--card2); color: var(--ink);
    border: 1px solid rgba(255,220,150,.2); border-radius: 10px;
    padding: 10px 12px; font-size: 13.5px; margin-bottom: 12px; outline: none;
    text-align: center;
}
.cardx input:focus { border-color: rgba(255,220,150,.55); }
.durrow { display: flex; gap: 6px; justify-content: center; align-items: center; margin-bottom: 14px; }
.dur {
    background: var(--card2); color: var(--ink); border: 1px solid rgba(255,220,150,.18);
    border-radius: 9px; padding: 6px 11px; font-size: 12.5px; cursor: pointer;
}
.dur.sel { border-color: var(--gold); background: rgba(232,196,106,.15); color: #ffe9b0; }
.durrow .min { font-size: 11px; color: rgba(230,210,180,.6); }
.go {
    width: 100%; padding: 12px; border-radius: 12px; border: 0; cursor: pointer;
    background: linear-gradient(135deg, #e8b95c, #c8862a); color: #241705;
    font-size: 15px; font-weight: 700; letter-spacing: .18em;
    transition: transform .15s, box-shadow .2s;
}
.go:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(232,185,92,.3); }
.endbtn {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
    z-index: 12; background: none; border: 0; cursor: pointer;
    color: rgba(230,210,180,.55); font-size: 12px; letter-spacing: .08em;
    border-bottom: 1px dashed rgba(230,210,180,.3); padding-bottom: 2px;
}
.endbtn:hover { color: #ffd9a0; }
.cardx.done .big { color: #bfe8a0; }
.donemsg { font-size: 13.5px; color: rgba(240,230,215,.9); margin-bottom: 8px; line-height: 1.5; }
.donestats { font-size: 12px; color: rgba(230,210,180,.65); margin-bottom: 14px; }

/* panel */
#panel {
    position: fixed; inset: 0; z-index: 20;
    background: rgba(5,3,1,.55); backdrop-filter: blur(3px);
    display: flex; align-items: flex-end; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .25s;
}
#panel.open { opacity: 1; pointer-events: auto; }
.sheet {
    width: 100%; max-width: 420px; max-height: 74vh; overflow-y: auto;
    background: var(--card); border-radius: 18px 18px 0 0;
    border: 1px solid rgba(232,196,106,.16); border-bottom: 0;
    padding: 14px 18px 26px;
    transform: translateY(30px); transition: transform .28s;
}
#panel.open .sheet { transform: translateY(0); }
.sheet-head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 15px; font-weight: 600; margin-bottom: 10px;
}
.lbl {
    display: block; font-size: 10.5px; text-transform: uppercase;
    letter-spacing: .1em; color: rgba(220,195,155,.6); margin: 8px 0 6px;
}
.optRow { display: flex; flex-wrap: wrap; gap: 7px; }
.opt {
    border: 1px solid rgba(255,220,150,.18); background: var(--card2);
    color: var(--ink); border-radius: 10px; padding: 7px 12px;
    font-size: 12.5px; cursor: pointer; transition: all .18s;
}
.opt.sel { border-color: var(--gold); background: rgba(232,196,106,.14); color: #ffe9b0; }
.hist { font-size: 12.5px; color: rgba(230,215,190,.85); }
.hist .hrow {
    display: flex; justify-content: space-between; gap: 8px;
    padding: 7px 2px; border-bottom: 1px solid rgba(255,220,150,.08);
}
.hist .hrow .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .hrow .d { color: rgba(230,210,180,.55); flex-shrink: 0; }
.hist .empty { color: rgba(230,210,180,.5); font-style: italic; padding: 8px 0; }
