/* Wish Bottle — styles */
:root {
    --gold: #e8c46a;
    --ink: #eef0f8;
    --card: #14202e;
    --card2: #1c2c3e;
}
* { 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: #0a1420;
    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; touch-action: none; }

.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(10,20,32,.6); color: #d0dce8;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; backdrop-filter: blur(6px);
    transition: background .2s, transform .15s;
}
.icon-btn:hover { background: rgba(40,62,84,.75); transform: scale(1.06); }
.icon-btn.sm { width: 28px; height: 28px; font-size: 17px; line-height: 1; }

#status {
    position: fixed; left: 12px; bottom: 12px; z-index: 8;
    font-size: 11.5px; letter-spacing: .04em; color: rgba(200,220,240,.62);
    text-shadow: 0 1px 3px rgba(0,0,0,.7); pointer-events: none;
}
#hint {
    position: fixed; top: 14px; left: 50%; transform: translate(-50%, -8px);
    z-index: 9; font-size: 12.5px; color: #ffe9b0;
    background: rgba(14,24,38,.85); padding: 7px 14px; border-radius: 20px;
    border: 1px solid rgba(232,196,106,.28); 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: 40px; transform: translateX(-50%);
    z-index: 12; width: min(330px, 90vw);
    background: rgba(18,28,44,.94); border: 1px solid rgba(232,196,106,.3);
    border-radius: 18px; padding: 20px 22px; text-align: center;
    backdrop-filter: blur(8px); box-shadow: 0 12px 40px rgba(0,0,0,.55);
}
.cardx.scroll {
    background: linear-gradient(180deg, rgba(52,42,22,.96), rgba(40,32,18,.96));
    border-color: rgba(220,190,130,.5);
}
.cardx .big {
    font-size: 14px; letter-spacing: .3em; color: var(--gold);
    margin-bottom: 14px; font-weight: 600;
}
.cardx textarea {
    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;
    resize: none; font-family: inherit;
}
.cardx textarea:focus { border-color: rgba(255,220,150,.55); }
.go {
    width: 100%; padding: 12px; border-radius: 12px; border: 0; cursor: pointer;
    background: linear-gradient(135deg, #e8c46a, #c8962a); color: #241705;
    font-size: 14px; font-weight: 700; letter-spacing: .14em;
    transition: transform .15s, box-shadow .2s;
}
.go:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(232,196,106,.3); }
.wtext {
    font-family: Georgia, serif; font-size: 15.5px; line-height: 1.6;
    color: #f4e8cc; margin-bottom: 10px; font-style: italic;
}
.wmeta { font-size: 11px; color: rgba(240,220,180,.6); margin-bottom: 14px; line-height: 1.6; }

.newbtn {
    position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%);
    z-index: 12; padding: 13px 30px; border-radius: 24px; border: 0; cursor: pointer;
    background: linear-gradient(135deg, #e8c46a, #c8962a); color: #241705;
    font-size: 14px; font-weight: 700; letter-spacing: .1em;
    box-shadow: 0 8px 24px rgba(232,196,106,.25);
}
.newbtn:hover { transform: translateX(-50%) translateY(-1px); }

/* panel */
#panel {
    position: fixed; inset: 0; z-index: 20;
    background: rgba(4,8,14,.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(160,190,235,.14); 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;
}
.hist .hrow { padding: 10px 2px; border-bottom: 1px solid rgba(160,190,235,.09); }
.hist .htext { font-size: 13px; color: rgba(240,244,252,.92); line-height: 1.5; font-style: italic; }
.hist .hmeta { font-size: 10.5px; color: rgba(190,210,235,.55); margin-top: 4px; }
.hist .empty { color: rgba(200,215,240,.5); font-style: italic; padding: 10px 0; font-size: 12.5px; }
