/* NEXISLE — 海岛物语 样式表 */
/* 星露谷风：木质边框 + 羊皮纸面板 + 暖色治愈调性 + 像素硬边 */

:root {
    --wood: #6b4a2a;        /* 木 */
    --wood-d: #3a2a1a;      /* 深木 */
    --wood-l: #8a5a32;      /* 亮木 */
    --parch: #f3e2c0;       /* 羊皮纸 */
    --parch-d: #e3cd9e;     /* 羊皮纸暗 */
    --parch-line: #c9ad79;  /* 羊皮纸分隔线 */
    --ink: #3a2a1a;         /* 墨棕（浅底文字） */
    --ink-soft: #6b5638;
    --gold: #e0a83a;
    --green: #5aa83a;
    --blue: #3a9fd0;
    --pink: #e07a9a;
    --border: #2a1d12;      /* 像素描边 */

    --neon-a: var(--green);
    --neon-b: var(--pink);
    --neon-c: var(--gold);
    --ink-old: #2e2550;
    --glass: rgba(243,226,192,0.94);
    --glass-soft: rgba(243,226,192,0.72);
    --glass-strong: #e3cd9e;
    --glass-border: rgba(42,29,18,0.85);
    --txt: #3a2a1a;
    --txt-dim: #6b5638;
    --radius: 10px;
    --glow: 0 4px 0 rgba(0,0,0,0.22), 0 8px 22px rgba(0,0,0,0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: radial-gradient(120% 120% at 50% 0%, #1f3326 0%, #16241b 55%, #0c140e 100%);
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--txt);
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}

#game-container {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;     /* 星露谷像素风：保持硬边清晰 */
}

/* UI 容器：默认不拦截鼠标，仅交互子元素开启 */
#ui {
    position: absolute;
    inset: 0;
    pointer-events: none;
    font-size: 14px;
}

/* ───────── 内联 SVG 图标 ───────── */
.ico {
    display: inline-block;
    width: 1em; height: 1em;
    vertical-align: -0.16em;
    flex: none;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}
.btn .ico, .panel-head .ico, .title-badge .ico { vertical-align: -0.18em; }

/* ───────── HUD ───────── */
#hud {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 10px 14px;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#hud-top {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--glass);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 7px 14px;
    width: fit-content;
    font-weight: 600;
    box-shadow: var(--glow);
}
#hud-money {
    color: var(--neon-c);
    text-shadow: 0 0 10px rgba(255,216,107,0.55);
    font-weight: 800;
    display: inline-flex; align-items: center; gap: 5px;
}
#hud-money .ico { font-size: 17px; }
.hud-num { font-variant-numeric: tabular-nums; }
#hud-weather { font-size: 18px; display: inline-flex; align-items: center; }
#hud-weather .ico { font-size: 20px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
#hud-wind { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
#hud-wind .ico { font-size: 17px; }
.wind-arrow { display: inline-block; font-weight: 800; transition: transform .4s ease; color: var(--neon-a); }
#festival-banner .ico { filter: none; }
#hud-bars { display: flex; gap: 10px; width: fit-content; }
.bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    background: var(--glass);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    padding: 5px 10px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glow);
}
.bar-bg {
    width: 124px;
    height: 12px;
    background: rgba(10,8,26,0.55);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}
.bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #aef9c8, #5fe6c4 55%, #7ce7ff);
    box-shadow: 0 0 10px rgba(124,231,255,0.6);
    transition: width .25s ease;
}
.bar-fill.red { background: linear-gradient(90deg, #ffd2a0, #ff8fb0 55%, #ff6b9d); box-shadow: 0 0 10px rgba(255,110,157,0.6); }
#hud-tool {
    font-size: 15px;
    font-weight: 700;
    background: var(--glass);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    padding: 5px 12px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    width: fit-content;
    box-shadow: var(--glow);
}

/* ───────── 快捷栏 ───────── */
#hotbar {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    pointer-events: auto;
    padding: 6px;
    background: var(--glass);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    box-shadow: var(--glow);
}
.slot {
    width: 46px;
    height: 46px;
    background: rgba(20,16,44,0.45);
    border: 2px solid rgba(255,255,255,0.22);
    border-radius: 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .12s, transform .08s, box-shadow .12s;
}
.slot:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.5); }
.slot.sel {
    border-color: var(--neon-a);
    box-shadow: 0 0 12px rgba(124,231,255,0.7), inset 0 0 8px rgba(124,231,255,0.25);
}
.slot .ic { font-size: 24px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.slot .ct {
    position: absolute;
    right: 3px; bottom: 1px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px #000;
}
.slot .q {
    position: absolute;
    left: 3px; top: 1px;
    font-size: 10px;
    color: var(--neon-c);
    text-shadow: 0 1px 3px #000;
}

/* ───────── 提示 toast ───────── */
#toast-area {
    position: absolute;
    top: 92px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    pointer-events: none;
}
.toast {
    background: var(--glass-strong);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid rgba(255,216,107,0.55);
    border-radius: 20px;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 700;
    animation: toastIn .25s ease;
    box-shadow: 0 4px 18px rgba(0,0,0,0.45), 0 0 14px rgba(255,216,107,0.18);
    color: var(--txt);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; } }

/* ───────── 节日横幅 ───────── */
#festival-banner {
    --fb-a: #7ce7ff; --fb-b: #ff9ee6; --fb-glow: rgba(255,158,230,0.55);
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-24px) scale(0.92);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 94%;
    padding: 11px 26px;
    background: linear-gradient(100deg, var(--fb-a), var(--fb-b));
    border: 1.5px solid rgba(255,255,255,0.85);
    border-radius: 32px;
    color: #2e2550;
    font-weight: 800;
    box-shadow: 0 8px 28px rgba(0,0,0,0.45), 0 0 26px var(--fb-glow);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    animation: fbGlow 2.4s ease-in-out infinite;
}
#festival-banner[data-type="social"]  { --fb-a:#a8f0c0; --fb-b:#ff9ec4; --fb-glow:rgba(168,240,192,0.55); }
#festival-banner[data-type="weather"] { --fb-a:#9fd0ff; --fb-b:#7c8cff; --fb-glow:rgba(124,140,255,0.6); }
#festival-banner[data-type="harvest"] { --fb-a:#ffd98a; --fb-b:#ff9a52; --fb-glow:rgba(255,154,82,0.6); }
#festival-banner[data-type="fireworks"]{ --fb-a:#bda7ff; --fb-b:#7ce7ff; --fb-glow:rgba(189,167,255,0.6); }
#festival-banner.show {
    animation: fbIn .7s cubic-bezier(.18,.9,.32,1.4) forwards, fbGlow 2.4s ease-in-out infinite;
}
@keyframes fbIn {
    0%   { opacity: 0; transform: translateX(-50%) translateY(-46px) scale(0.9); }
    60%  { opacity: 1; transform: translateX(-50%) translateY(6px) scale(1.03); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes fbGlow {
    0%,100% { box-shadow: 0 8px 28px rgba(0,0,0,0.45), 0 0 18px var(--fb-glow); }
    50%     { box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 34px var(--fb-glow); }
}
/* 流光扫过 */
#festival-banner::after {
    content: '';
    position: absolute;
    top: 0; left: -60%;
    width: 55%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
    transform: skewX(-20deg);
    animation: fbShine 3.2s ease-in-out infinite;
}
@keyframes fbShine { 0%,55% { left: -60%; } 80%,100% { left: 120%; } }
#festival-banner .fb-icon { font-size: 26px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
#festival-banner .fb-text { display: flex; flex-direction: column; line-height: 1.25; }
#festival-banner .fb-name { font-size: 18px; letter-spacing: 1.5px; }
#festival-banner .fb-desc { font-size: 12px; font-weight: 600; opacity: .9; }
#festival-banner .fb-sparkle {
    position: absolute; font-size: 14px; opacity: 0;
    animation: fbFloat 2.8s ease-in-out infinite;
}
#festival-banner .fb-sparkle-l { left: 8px; top: 4px; animation-delay: .3s; }
#festival-banner .fb-sparkle-r { right: 8px; bottom: 4px; animation-delay: 1.1s; }
@keyframes fbFloat {
    0%,100% { opacity: 0; transform: translateY(2px) scale(0.8); }
    50%     { opacity: .95; transform: translateY(-3px) scale(1.1); }
}

/* ───────── 遮罩 / 面板 ───────── */
#overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(8,6,22,0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    pointer-events: auto;
    padding: 20px;
    z-index: 50;
}

/* 霓虹渐变描边（mask 技巧） */
.panel, .dialogue {
    position: relative;
    background: var(--glass-strong);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    color: var(--txt);
    border-radius: var(--radius);
    min-width: 320px;
    max-width: 92vw;
    max-height: 86vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--glow);
}
.panel::before, .dialogue::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1.5px;
    background: linear-gradient(135deg, var(--neon-a), var(--neon-b) 55%, var(--neon-c));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, rgba(124,231,255,0.20), rgba(255,158,230,0.20));
    color: var(--txt);
    padding: 11px 16px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .5px;
    border-bottom: 1px solid rgba(255,255,255,0.16);
}
.panel-head .x {
    border: none;
    background: rgba(255,110,157,0.85);
    color: #fff;
    width: 28px; height: 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: filter .1s, transform .06s;
}
.panel-head .x:hover { filter: brightness(1.1); }
.panel-head .x:active { transform: translateY(1px); }
.panel-body {
    padding: 16px;
    overflow-y: auto;
}

/* 按钮 */
.btn {
    background: linear-gradient(135deg, #6f7be0, #b16fe0);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 12px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: filter .1s, transform .06s, box-shadow .1s;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(124,110,224,0.35);
}
.btn:hover { filter: brightness(1.1); box-shadow: 0 4px 16px rgba(176,111,224,0.5); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: rgba(120,120,140,0.5); border-color: rgba(255,255,255,0.2); cursor: not-allowed; filter: none; box-shadow: none; }
.btn.wide { width: 100%; margin: 4px 0; text-align: left; }
.btn#start { background: linear-gradient(135deg, #ff9ee6, #ffd86b); color: #2e2550; }

/* 标签/分页 */
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tab {
    flex: 1;
    background: rgba(20,16,44,0.5);
    color: var(--txt-dim);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 12px;
    padding: 7px;
    font-weight: 700;
    cursor: pointer;
    transition: all .12s;
}
.tab.active {
    background: linear-gradient(135deg, rgba(124,231,255,0.3), rgba(255,158,230,0.3));
    color: #fff;
    border-color: var(--neon-a);
    box-shadow: 0 0 12px rgba(124,231,255,0.4);
}

/* 列表 */
.list { display: flex; flex-direction: column; gap: 7px; }
.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 12px;
    padding: 9px 12px;
    transition: background .12s;
}
.row:hover { background: rgba(255,255,255,0.14); }
.row span { font-size: 13px; }

/* 网格（背包/箱子/礼物） */
.grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 5px;
}
.cell {
    aspect-ratio: 1;
    background: rgba(20,16,44,0.5);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 22px;
    transition: background .12s, border-color .12s, transform .08s;
}
.cell:hover { background: rgba(255,255,255,0.16); border-color: var(--neon-a); transform: translateY(-2px); }
.cell .ct { position: absolute; right: 3px; bottom: 1px; font-size: 10px; color: #fff; font-weight: 700; text-shadow: 0 1px 3px #000; }
.cell .q { position: absolute; left: 3px; top: 1px; font-size: 9px; color: var(--neon-c); }

.info { margin-bottom: 12px; }
.mut { color: var(--txt-dim); font-size: 12px; font-weight: 500; }

/* 复兴献祭包 */
.bundle {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 12px;
    padding: 9px 12px;
    margin-bottom: 7px;
    font-size: 13px;
}
.bundle span { margin-right: 6px; opacity: .45; }
.bundle span.done { opacity: 1; color: var(--neon-a); text-shadow: 0 0 6px rgba(124,231,255,0.6); }

/* ───────── 对话（带 NPC 立绘） ───────── */
.dialogue {
    width: min(620px, 94vw);
    padding: 18px;
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: stretch;
}
.d-portrait {
    flex: 0 0 132px;
    border-radius: 14px;
    background: radial-gradient(circle at 50% 35%, rgba(124,231,255,0.22), rgba(255,158,230,0.10) 60%, rgba(46,37,80,0.0) 100%);
    border: 1px solid rgba(255,255,255,0.18);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.d-portrait canvas { width: 132px; height: 190px; display: block; }
.d-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.d-name {
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
    font-size: 17px;
    text-shadow: 0 0 12px rgba(124,231,255,0.5);
    letter-spacing: .5px;
}
.d-name .d-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--neon-c);
    margin-left: 8px;
    opacity: .9;
}
.d-text {
    font-size: 15px;
    line-height: 1.6;
    min-height: 72px;
    margin-bottom: 14px;
    color: var(--txt);
    flex: 1;
}
.dialogue .btn { align-self: flex-end; }
.dialogue .btn { animation: dBtnPulse 2.4s ease-in-out infinite; }
@keyframes dBtnPulse {
    0%, 100% { box-shadow: 0 2px 10px rgba(124,110,224,0.35), 0 0 0 0 rgba(176,111,224,0.0); }
    50% { box-shadow: 0 4px 18px rgba(176,111,224,0.55), 0 0 0 6px rgba(176,111,224,0.08); }
}

/* 小屏适配 */
@media (max-width: 600px) {
    .bar-bg { width: 80px; }
    .slot { width: 38px; height: 38px; }
    .slot .ic { font-size: 20px; }
    .grid { grid-template-columns: repeat(6, 1fr); }
    .dialogue { flex-direction: column; align-items: center; }
    .d-portrait { flex: 0 0 auto; align-self: center; }
}

/* ───────── 移动端触控 UI ───────── */
#touch-controls {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 40;
    display: none;          /* touch 设备由 JS 置为 flex */
}
#joystick {
    position: absolute;
    left: 18px; bottom: 180px;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: rgba(20,16,44,0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.28);
    pointer-events: auto;
    touch-action: none;
    box-shadow: var(--glow);
}
#joy-knob {
    position: absolute;
    left: 50%; top: 50%;
    width: 52px; height: 52px;
    margin: -26px 0 0 -26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-a), var(--neon-b));
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: 0 2px 10px rgba(0,0,0,0.4), 0 0 14px rgba(124,231,255,0.5);
}
#btn-action {
    position: absolute;
    right: 22px; bottom: 182px;
    width: 84px; height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6f7be0, #b16fe0);
    border: 2px solid rgba(255,255,255,0.4);
    color: #fff; font-size: 17px; font-weight: 800;
    pointer-events: auto;
    touch-action: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.45), 0 0 16px rgba(176,111,224,0.5);
}
#btn-action:active { transform: scale(.94); filter: brightness(1.1); }
#btn-menu {
    position: absolute;
    right: 12px; top: 64px;
    width: 48px; height: 48px;
    border-radius: 14px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff; font-size: 22px; font-weight: 800;
    pointer-events: auto;
    touch-action: none;
    box-shadow: var(--glow);
}
#btn-menu:active { transform: scale(.94); }
.tmenu { display: flex; flex-direction: column; gap: 2px; }

/* touch 设备（pointer: coarse）整体微调 */
.touch #hud { font-size: 12px; }
.touch #hud-top { gap: 10px; padding: 5px 10px; }
.touch #hotbar { bottom: 10px; gap: 3px; max-width: 100vw; overflow-x: auto; padding: 5px; }
.touch .slot { width: 40px; height: 40px; }
.touch .slot .ic { font-size: 20px; }
.touch .bar-bg { width: 88px; }

/* ───────── 标题 / 开始画面 ───────── */
.title-screen { min-width: 360px; }
.title-body { padding: 22px 22px 20px; }
.title-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 14px 18px;
    margin-bottom: 14px;
    border-radius: 14px;
    background: radial-gradient(circle at 30% 30%, rgba(124,231,255,0.18), rgba(255,158,230,0.10) 60%, rgba(46,37,80,0) 100%);
    border: 1px solid rgba(255,255,255,0.14);
}
.title-portrait {
    flex: 0 0 120px;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: radial-gradient(circle at 50% 40%, rgba(255,216,107,0.22), rgba(124,231,255,0.10) 60%, rgba(46,37,80,0) 100%);
}
.title-portrait canvas { width: 120px; height: 168px; display: block; }
.title-text { flex: 1; min-width: 0; }
.title-badge {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 34px; height: 34px;
    font-size: 22px;
    color: var(--neon-b);
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, rgba(255,158,230,0.28), rgba(124,231,255,0.12) 70%, transparent);
    border: 1px solid rgba(255,255,255,0.25);
    margin-bottom: 6px;
    filter: drop-shadow(0 0 8px rgba(255,158,230,0.5));
    animation: badgeBob 3.4s ease-in-out infinite;
}
@keyframes badgeBob { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-3px) rotate(3deg); } }
.game-title {
    font-size: 40px;
    font-weight: 900;
    letter-spacing: 3px;
    line-height: 1;
    background: linear-gradient(120deg, var(--neon-a), var(--neon-b) 55%, var(--neon-c));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 26px rgba(124,231,255,0.35);
}
.game-sub {
    margin-top: 6px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 8px;
    color: var(--txt);
    text-shadow: 0 0 12px rgba(255,158,230,0.45);
}
.game-tagline {
    margin-top: 10px;
    font-size: 12px;
    color: var(--txt-dim);
    line-height: 1.6;
}
.title-screen #start {
    margin-top: 6px;
    font-size: 15px;
    padding: 10px 22px;
}

/* 设置面板 */
.set-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.set-row label { min-width: 76px; font-size: 13px; color: var(--txt); }
.set-row input[type="range"] { flex: 1; accent-color: var(--neon-a); }
.set-row select { flex: 1; background: rgba(20,16,44,0.7); color: var(--txt); border: 1px solid rgba(255,255,255,0.25); border-radius: 8px; padding: 5px 8px; }
.set-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--neon-a); }

/* ───────── 当前目标追踪条 ───────── */
#objective {
    position: absolute;
    top: 64px; left: 50%; transform: translateX(-50%);
    display: none; align-items: center; gap: 10px;
    max-width: 92%;
    padding: 7px 16px;
    background: linear-gradient(100deg, rgba(48,38,86,0.55), rgba(124,231,255,0.20));
    border: 1px solid rgba(255,255,255,0.34);
    border-radius: 22px;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 18px rgba(0,0,0,0.35), 0 0 16px rgba(124,231,255,0.25);
    color: #eaf2ff; font-size: 13px; font-weight: 600;
    z-index: 4; pointer-events: none; white-space: nowrap;
}
#objective .obj-step {
    flex: none;
    color: var(--neon-a);
    background: rgba(20,16,44,0.55);
    border: 1px solid rgba(124,231,255,0.45);
    border-radius: 14px; padding: 2px 9px; font-size: 11px; letter-spacing: .5px;
}
#objective .obj-text { overflow: hidden; text-overflow: ellipsis; }

/* ───────── 剧情卡 / 开场信 ───────── */
.story-card {
    display: flex; align-items: stretch; gap: 0;
    width: min(560px, 92vw); max-height: 86vh;
    background: linear-gradient(155deg, rgba(40,30,72,0.92), rgba(28,20,54,0.96));
    border: 1px solid color-mix(in srgb, var(--accent, #7ce7ff) 55%, white 0%);
    border-radius: 18px; overflow: hidden;
    box-shadow: 0 18px 60px rgba(0,0,0,0.55), 0 0 30px color-mix(in srgb, var(--accent, #7ce7ff) 40%, transparent);
    animation: cardIn .45s cubic-bezier(.2,.9,.25,1.1);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.card-portrait {
    flex: none; width: 132px;
    background:
        radial-gradient(120% 90% at 50% 18%, color-mix(in srgb, var(--accent,#7ce7ff) 38%, transparent), transparent 70%),
        linear-gradient(180deg, rgba(255,255,255,0.10), rgba(0,0,0,0.18));
    border-right: 1px solid rgba(255,255,255,0.18);
    display: flex; align-items: flex-end; justify-content: center;
}
.card-portrait canvas { width: 132px; height: 184px; display: block; }
.card-body { flex: 1; min-width: 0; padding: 18px 22px 20px; display: flex; flex-direction: column; }
.card-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 19px; font-weight: 800; color: var(--accent, #7ce7ff);
    text-shadow: 0 0 14px color-mix(in srgb, var(--accent,#7ce7ff) 55%, transparent);
    margin-bottom: 12px;
}
.card-title .card-icon { font-size: 20px; }
.card-lines { flex: 1; overflow-y: auto; }
.card-lines p { margin: 0 0 9px; line-height: 1.7; color: #eef3ff; font-size: 14.5px; letter-spacing: .3px; }
.card-obj {
    display: flex; align-items: center; gap: 8px; margin: 8px 0 14px;
    padding: 9px 12px; border-radius: 12px;
    background: rgba(124,231,255,0.12); border: 1px solid rgba(124,231,255,0.4);
    color: #d7f4ff; font-size: 13.5px; font-weight: 600;
}
.card-obj .ico { color: var(--neon-a); font-size: 16px; flex: none; }
.card-next { align-self: flex-end; margin-top: 4px; }

/* ───────── 手账面板 ───────── */
.journal { max-height: 70vh; overflow-y: auto; text-align: left; }
.j-prog { font-size: 14px; color: var(--neon-a); margin-bottom: 10px; font-weight: 700; }
.j-prog b { font-size: 17px; }
.j-sec {
    display: flex; align-items: center; gap: 7px;
    margin: 14px 0 8px; font-size: 14px; font-weight: 800; color: #eaf2ff;
    border-bottom: 1px solid rgba(255,255,255,0.16); padding-bottom: 5px;
}
.j-sec .ico { color: var(--neon-a); font-size: 16px; }
.j-log, .j-tips { list-style: none; margin: 0; padding: 0; }
.j-log li, .j-tips li { padding: 6px 4px; font-size: 13.5px; color: #dfe7ff; line-height: 1.6; border-bottom: 1px dashed rgba(255,255,255,0.08); }
.j-log li .ok { color: #7dffb0; margin-right: 6px; }
.j-log li.mut, .j-tips li.mut { color: rgba(220,228,255,0.6); font-style: italic; }

/* ───────── 新手引导教练标记 ───────── */
#tutor {
    position: absolute; left: 50%; transform: translateX(-50%);
    display: none; align-items: center; gap: 0; z-index: 6; pointer-events: none;
}
.tutor-bottom { bottom: 92px; flex-direction: column; }
.tutor-center { top: 50%; transform: translate(-50%, -50%); flex-direction: column; }
.tutor-box {
    max-width: min(440px, 90vw);
    padding: 11px 18px;
    background: linear-gradient(100deg, rgba(48,38,86,0.9), rgba(255,158,230,0.32));
    border: 1px solid rgba(255,255,255,0.45);
    border-radius: 16px;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 8px 26px rgba(0,0,0,0.45), 0 0 20px rgba(255,158,230,0.35);
    color: #fff; text-align: center;
    animation: tutorPulse 2s ease-in-out infinite;
}
@keyframes tutorPulse { 0%,100% { box-shadow: 0 8px 26px rgba(0,0,0,0.45), 0 0 14px rgba(255,158,230,0.28); } 50% { box-shadow: 0 8px 26px rgba(0,0,0,0.45), 0 0 26px rgba(255,158,230,0.55); } }
.tutor-step { font-size: 11px; color: var(--neon-b); letter-spacing: 1px; margin-bottom: 3px; font-weight: 700; }
.tutor-text { font-size: 14px; line-height: 1.55; font-weight: 600; }
.tutor-text b { color: var(--neon-c); }
.tutor-arrow {
    width: 0; height: 0; margin: 0 auto;
    border-left: 9px solid transparent; border-right: 9px solid transparent;
    border-top: 11px solid rgba(255,158,230,0.7);
}
.tutor-center .tutor-arrow { display: none; }

/* 槽位高亮脉冲（教练标记指向的快捷键） */
#hotbar .slot.coach {
    border-color: var(--neon-b);
    box-shadow: 0 0 0 2px rgba(255,158,230,0.6), 0 0 16px rgba(255,158,230,0.7);
    animation: slotCoach 1.1s ease-in-out infinite;
}
@keyframes slotCoach { 0%,100% { box-shadow: 0 0 0 2px rgba(255,158,230,0.6), 0 0 12px rgba(255,158,230,0.55); } 50% { box-shadow: 0 0 0 3px rgba(255,158,230,0.9), 0 0 24px rgba(255,158,230,0.85); } }

/* 教学完成闪光（覆盖全屏一次性） */
#tutor.flash::after {
    content: ''; position: fixed; inset: 0; pointer-events: none;
    background: radial-gradient(circle at 50% 60%, rgba(255,255,255,0.35), transparent 60%);
    animation: flashOut .6s ease-out forwards;
}
@keyframes flashOut { from { opacity: 1; } to { opacity: 0; } }

/* ════════════════════════════════════════════════════════════════════
   星露谷风覆盖层：木质边框 + 羊皮纸 + 暖色治愈调性（追加于末尾，优先生效）
   ════════════════════════════════════════════════════════════════════ */

/* 通用像素面板：木框 + 羊皮纸内胆 */
.panel {
    background: var(--parch);
    border: 3px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--glow), inset 0 0 0 2px var(--parch-d);
    color: var(--ink);
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    font-size: 16px; font-weight: 800; color: var(--wood-d);
    background: linear-gradient(180deg, var(--wood-l), var(--wood));
    color: var(--parch);
    border-bottom: 3px solid var(--border);
    border-radius: calc(var(--radius) - 3px) calc(var(--radius) - 3px) 0 0;
    letter-spacing: .5px;
}
.panel-body { padding: 14px 16px; color: var(--ink); }
.x {
    background: var(--parch-d); color: var(--ink); border: 2px solid var(--border);
    border-radius: 6px; width: 28px; height: 28px; font-weight: 800; cursor: pointer;
}
.x:hover { background: #d8bd86; }

/* 按钮：木质像素按钮 */
.btn {
    font-family: inherit; font-weight: 700; color: var(--parch);
    background: linear-gradient(180deg, var(--wood-l), var(--wood));
    border: 2px solid var(--border); border-radius: 8px;
    padding: 9px 16px; cursor: pointer; letter-spacing: .5px;
    box-shadow: 0 3px 0 var(--wood-d);
    transition: transform .05s, box-shadow .05s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--wood-d); }
.btn[disabled] { opacity: .5; cursor: not-allowed; filter: grayscale(.4); }
.btn-action {
    background: linear-gradient(180deg, #6cc24a, #4e8a36);
    border-color: #2f5a22; box-shadow: 0 3px 0 #2f5a22; color: #fff;
}
.btn.wide { display: block; width: 100%; margin: 6px 0; }
.btn-menu { background: linear-gradient(180deg, var(--wood-l), var(--wood)); }

/* 顶部 HUD：木质信息条 */
#hud-top { top: 8px; left: 8px; right: 8px; display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud .hud-money, #hud .hud-date, #hud .hud-tool, #hud .hud-weather, #hud .hud-wind {
    background: var(--parch); color: var(--ink);
    border: 2px solid var(--border); border-radius: 8px;
    padding: 4px 9px; font-size: 13px; font-weight: 700;
    box-shadow: 0 2px 0 rgba(0,0,0,.2);
}
#hud .hud-date { font-weight: 600; }
#hud .hud-num { color: var(--wood-d); }
#hud .hud-bars { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
#hud .hud-bars > div {
    width: 150px; height: 12px; background: rgba(42,29,18,.25);
    border: 2px solid var(--border); border-radius: 7px; overflow: hidden;
}
#stamina-fill { height: 100%; background: linear-gradient(180deg, #7fd05a, #4e8a36); transition: width .2s; }
#health-fill { height: 100%; background: linear-gradient(180deg, #ef5a44, #b83324); transition: width .2s; }

/* 物品栏：木质槽位 */
#hotbar { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 4px; padding: 6px; background: rgba(58,42,26,.55);
    border: 3px solid var(--border); border-radius: 12px; box-shadow: var(--glow); }
#hotbar .slot {
    width: 42px; height: 42px; background: var(--parch-d);
    border: 2px solid var(--border); border-radius: 7px;
    position: relative; display: flex; align-items: center; justify-content: center;
    font-size: 20px; cursor: pointer;
}
#hotbar .slot.sel { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 10px rgba(224,168,58,.5); }
#hotbar .slot .ic { font-size: 22px; }
#hotbar .slot .ct { position: absolute; right: 2px; bottom: 1px; font-size: 11px; font-weight: 800; color: var(--ink); }
#hotbar .slot .q { position: absolute; left: 2px; top: 1px; font-size: 10px; color: var(--gold); }
#hotbar .slot.coach {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(224,168,58,.8);
    animation: slotCoach 1.1s ease-in-out infinite;
}
@keyframes slotCoach { 0%,100% { box-shadow: 0 0 0 2px var(--gold), 0 0 10px rgba(224,168,58,.55); }
    50% { box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(224,168,58,.9); } }

/* 当前目标：悬挂木牌 */
#objective {
    top: 58px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(180deg, var(--wood-l), var(--wood));
    border: 3px solid var(--border); border-radius: 10px;
    color: var(--parch); font-size: 13px; font-weight: 700;
    box-shadow: var(--glow); backdrop-filter: none; -webkit-backdrop-filter: none;
    padding: 7px 16px; max-width: 92%;
}
#objective .obj-step {
    color: var(--gold); background: var(--wood-d);
    border: 1px solid #000; border-radius: 8px; padding: 2px 9px; font-size: 11px;
}
#objective .obj-text { color: #fbeccb; }

/* 剧情卡 / 开场信：羊皮纸信笺 + 木框 */
.story-card {
    background: var(--parch);
    border: 3px solid var(--border); border-radius: 14px; overflow: hidden;
    box-shadow: var(--glow);
    animation: cardIn .4s cubic-bezier(.2,.9,.25,1.05);
}
.story-card { --accent: var(--gold); }
.card-portrait {
    width: 132px; flex: none;
    background: linear-gradient(180deg, var(--wood-l), var(--wood-d));
    border-right: 3px solid var(--border);
    display: flex; align-items: flex-end; justify-content: center;
}
.card-portrait canvas { width: 132px; height: 184px; display: block; }
.card-body { padding: 18px 22px 20px; display: flex; flex-direction: column; }
.card-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 19px; font-weight: 800; color: var(--wood-d);
    text-shadow: none; margin-bottom: 12px;
}
.card-lines { flex: 1; overflow-y: auto; }
.card-lines p { margin: 0 0 9px; line-height: 1.7; color: var(--ink); font-size: 14.5px; }
.card-obj {
    display: flex; align-items: center; gap: 8px; margin: 8px 0 14px;
    padding: 9px 12px; border-radius: 10px;
    background: var(--parch-d); border: 2px solid var(--parch-line);
    color: var(--ink); font-size: 13.5px; font-weight: 700;
}
.card-obj .ico { color: var(--wood-d); font-size: 16px; }

/* 手账：羊皮纸 */
.journal { max-height: 70vh; overflow-y: auto; text-align: left; color: var(--ink); }
.j-prog { font-size: 14px; color: var(--wood-d); margin-bottom: 10px; font-weight: 800; }
.j-prog b { font-size: 17px; }
.j-sec {
    display: flex; align-items: center; gap: 7px;
    margin: 14px 0 8px; font-size: 14px; font-weight: 800; color: var(--wood-d);
    border-bottom: 2px solid var(--parch-line); padding-bottom: 5px;
}
.j-sec .ico { color: var(--wood-d); font-size: 16px; }
.j-log, .j-tips { list-style: none; margin: 0; padding: 0; }
.j-log li, .j-tips li { padding: 6px 4px; font-size: 13.5px; color: var(--ink); line-height: 1.6;
    border-bottom: 1px dashed var(--parch-line); }
.j-log li .ok { color: var(--green); margin-right: 6px; font-weight: 800; }
.j-log li.mut, .j-tips li.mut { color: var(--ink-soft); font-style: italic; }

/* 新手引导教练标记：木牌 */
#tutor { z-index: 6; }
.tutor-box {
    max-width: min(440px, 90vw); padding: 11px 18px;
    background: linear-gradient(180deg, var(--wood-l), var(--wood));
    border: 3px solid var(--border); border-radius: 12px;
    box-shadow: var(--glow);
    color: var(--parch); text-align: center;
    animation: tutorPulse 2s ease-in-out infinite;
}
@keyframes tutorPulse { 0%,100% { box-shadow: var(--glow); } 50% { box-shadow: 0 4px 0 rgba(0,0,0,.22), 0 0 22px rgba(224,168,58,.5); } }
.tutor-step { font-size: 11px; color: var(--gold); letter-spacing: 1px; margin-bottom: 3px; font-weight: 800; }
.tutor-text { font-size: 14px; line-height: 1.55; font-weight: 600; }
.tutor-text b { color: var(--gold); }
.tutor-arrow { width: 0; height: 0; margin: 0 auto; border-left: 9px solid transparent; border-right: 9px solid transparent;
    border-top: 11px solid var(--wood); }

/* 对话：木框羊皮纸对话框 */
.dialogue {
    position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
    width: min(720px, 94vw); display: flex; gap: 0; align-items: stretch;
    background: var(--parch); border: 3px solid var(--border); border-radius: 14px;
    box-shadow: var(--glow); overflow: hidden; pointer-events: auto;
}
.d-portrait {
    flex: none; width: 120px;
    background: linear-gradient(180deg, var(--wood-l), var(--wood-d));
    border-right: 3px solid var(--border);
    display: flex; align-items: flex-end; justify-content: center;
}
.d-portrait canvas { width: 120px; height: 160px; display: block; }
.d-main { flex: 1; min-width: 0; padding: 14px 18px; display: flex; flex-direction: column; }
.d-name { font-size: 16px; font-weight: 800; color: var(--wood-d); margin-bottom: 6px; }
.d-tag { margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--parch);
    background: var(--wood); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; }
.d-text { flex: 1; font-size: 14.5px; line-height: 1.7; color: var(--ink); }
#d-next { align-self: flex-end; margin-top: 8px; }

/* 标题画面：木质英雄区 */
.title-screen { background: linear-gradient(180deg, #2a3e2a, #16241b); }
.title-hero {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 28px; border: 3px solid var(--border); border-radius: 18px;
    background: linear-gradient(180deg, var(--wood-l), var(--wood));
    box-shadow: var(--glow); color: var(--parch); text-align: center;
}
.title-portrait canvas { width: 96px; height: 128px; image-rendering: pixelated; }
.game-title { font-size: 40px; font-weight: 900; color: var(--parch);
    text-shadow: 0 3px 0 var(--wood-d), 0 0 18px rgba(224,168,58,.35); letter-spacing: 2px; }
.game-sub { font-size: 15px; color: #f0e0c0; opacity: .92; }
.game-tagline { font-size: 13px; color: #e8d3a8; }
.title-badge { font-size: 12px; color: var(--gold); border: 1px solid var(--gold); border-radius: 20px; padding: 2px 12px; }
#start {
    font-family: inherit; font-weight: 800; font-size: 17px; color: #fff;
    background: linear-gradient(180deg, #6cc24a, #4e8a36);
    border: 2px solid #2f5a22; border-radius: 10px; padding: 12px 40px;
    box-shadow: 0 4px 0 #2f5a22; cursor: pointer; letter-spacing: 1px;
}
#start:hover { filter: brightness(1.06); }
#start:active { transform: translateY(3px); box-shadow: 0 1px 0 #2f5a22; }

/* 标签页 / 行 / 列表 */
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tab {
    flex: 1; padding: 7px; font-weight: 700; color: var(--ink);
    background: var(--parch-d); border: 2px solid var(--border); border-radius: 8px; cursor: pointer;
}
.tab.active { background: var(--wood); color: var(--parch); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 6px; border-bottom: 1px dashed var(--parch-line); font-size: 14px; color: var(--ink); }
.row .mut { color: var(--ink-soft); font-size: 12px; }
.list { display: flex; flex-direction: column; gap: 4px; }

/* 社交好感爱心（像素感） */
.heart, .friend-heart { color: #e8503a; }
.heart.empty { color: rgba(58,42,26,.25); }

/* 设置面板 */
.set-row label { color: var(--ink); }
.set-row select { background: var(--parch-d); color: var(--ink); border: 2px solid var(--border); border-radius: 8px; padding: 5px 8px; }
.set-row input[type="range"] { accent-color: var(--green); }
.set-row input[type="checkbox"] { accent-color: var(--green); }

/* Toast：木质小条 */
.toast {
    background: linear-gradient(180deg, var(--wood-l), var(--wood));
    border: 2px solid var(--border); border-radius: 8px; color: var(--parch);
    font-size: 13px; font-weight: 600; padding: 8px 14px; margin: 4px 0;
    box-shadow: var(--glow);
}
#toast-area { display: flex; flex-direction: column; align-items: center; }

/* 节庆横幅：木质 + 暖色（保留动效） */
#festival-banner {
    background: linear-gradient(180deg, var(--wood-l), var(--wood));
    border: 3px solid var(--border); border-radius: 12px; color: var(--parch);
    box-shadow: var(--glow);
}
#festival-banner .fb-name { color: var(--gold); font-weight: 800; }
