/* style.css — shared look of 花宵平安京: night lacquer, gold filigree, crimson. Modules add src/css/*.css */
:root {
  --font: serif;
  --gold: #f3d27a; --gold2: #c9973a; --crimson: #b3243a; --ink: #1b1022; --text: #fff7ea; --violet: #9b6ad6; --pink: #ff9ec0;
  --outline: 0 0 2px #2a0f1e, 1px 1px 0 #2a0f1e, -1px 1px 0 #2a0f1e, 1px -1px 0 #2a0f1e, -1px -1px 0 #2a0f1e, 0 2px 4px rgba(0,0,0,.7);
}
html, body { margin: 0; height: 100%; background: #120a18; overflow: hidden; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#backdrop { position: fixed; inset: -40px; background: #120a18 center / cover no-repeat; filter: blur(16px) brightness(.5); transition: background-image .4s; }
#stage { position: absolute; left: 0; top: 0; width: 396px; height: 704px; transform-origin: 0 0; overflow: hidden; font-family: var(--font); color: var(--text); background: #1a0f22; }
#stage * { box-sizing: border-box; }
#screen { position: absolute; inset: 0; transition: opacity .16s; }
#screen.fade-out { opacity: 0; }
#screen.fade-in { animation: fadeIn .3s ease-out; }
#fx { position: absolute; left: 0; top: 0; width: 396px; height: 704px; pointer-events: none; z-index: 30; }
#overlay { position: absolute; inset: 0; pointer-events: none; z-index: 40; }
#overlay .layer { position: absolute; inset: 0; pointer-events: auto; background: rgba(10, 4, 16, .6); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; }
#overlay .layer.in { opacity: 1; }
#overlay .layer.out { opacity: 0; pointer-events: none; }
#overlay .layer.in > .pop { animation: pop .3s cubic-bezier(.3, 1.6, .5, 1); }
#toast { position: absolute; top: 112px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 60; }
.toast-item { background: rgba(24, 10, 30, .92); border: 1.5px solid var(--gold); border-radius: 20px; padding: 7px 16px; font-size: 15px; font-weight: 700; text-shadow: var(--outline); max-width: 340px; text-align: center; animation: drop .3s cubic-bezier(.3, 1.6, .5, 1); transition: opacity .35s, transform .35s; }
.toast-item.out { opacity: 0; transform: translateY(-10px); }
.hidden { display: none !important; }

/* 9-slice panel and button from the generated UI art */
.panel { border: 26px solid transparent; border-image-source: var(--panel-img, url(assets/ui-panel.webp)); border-image-slice: var(--panel-slice, 162 74 178 74) fill; border-image-width: var(--panel-bw, 78px 36px 85px); border-image-outset: var(--panel-out, 54px 10px 61px); border-image-repeat: stretch; padding: 6px 4px; }
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; min-width: 64px; padding: 4px 16px;
  border: 14px solid transparent; border-image-source: var(--btn-img, url(assets/ui-button.webp)); border-image-slice: var(--btn-slice, 105 60 118 60) fill; border-image-width: var(--btn-bw, 50px 29px 57px); border-image-outset: var(--btn-out, 38px 4px 45px); border-image-repeat: stretch; background: none;
  font-family: var(--font); font-weight: 800; font-size: 16px; color: var(--text); text-shadow: var(--outline); cursor: pointer; transition: transform .1s, filter .15s; }
.hud-chip.bag { width: 44px; min-width: 44px; justify-content: center; padding: 0; }
.hud-chip.bag img { width: 30px; height: 30px; object-fit: contain; }
.bag-list { display: flex; flex-direction: column; gap: 8px; width: 268px; max-width: 100%; }
.bag-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: rgba(255, 240, 220, .06); border: 1px solid rgba(243, 210, 122, .25); }
.bag-row.none { opacity: .55; }
.bag-row img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.bag-tx { flex: 1; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.bag-tx b { color: var(--gold); font-size: 15px; text-shadow: var(--outline); }
.bag-tx span { font-size: 12px; opacity: .9; line-height: 1.3; }
.bag-n { font-size: 18px; font-weight: 900; color: var(--text); text-shadow: var(--outline); min-width: 36px; text-align: right; }
.btn .btn-label { white-space: nowrap; line-height: 1.1; }
.btn .btn-icon { width: 24px; height: 24px; object-fit: contain; }
.btn.small { min-height: 44px; font-size: 14px; padding: 2px 10px; }
.btn.primary { filter: saturate(1.15) brightness(1.08) drop-shadow(0 0 6px rgba(243, 210, 122, .55)); font-size: 17px; }
.btn:active { transform: scale(.93); }
@media (hover: hover) { .btn:hover { filter: brightness(1.22) drop-shadow(0 0 6px rgba(243, 210, 122, .8)); transform: scale(1.03); } }
.btn:disabled { filter: grayscale(.85) brightness(.55); cursor: default; }
.kfocus { filter: brightness(1.25) drop-shadow(0 0 7px rgba(255, 225, 140, 1)) !important; transform: scale(1.05); }
.title-text { font-weight: 900; color: var(--gold); text-shadow: var(--outline); }

/* dialog */
.dialog { width: 340px; max-height: 640px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.dialog-title { font-size: 20px; font-weight: 900; color: var(--gold); text-align: center; text-shadow: var(--outline); }
.dialog-text { white-space: pre-line; font-size: 15px; line-height: 1.6; text-shadow: var(--outline); }
.dialog-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px; }

/* tab bar (bottom of the five main screens) */
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; height: 66px; display: flex; padding: 4px 6px 6px; z-index: 20;
  background: linear-gradient(180deg, rgba(40, 14, 40, .92), rgba(18, 6, 22, .98)); border-top: 2px solid var(--gold2); box-shadow: 0 -4px 14px rgba(0, 0, 0, .5); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: none; border: 0; color: var(--text); font-family: var(--font); cursor: pointer; transition: transform .12s; min-height: 54px; }
.tab:active { transform: scale(.9); }
.tab-seal { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 900; color: #ffe9e9;
  background: radial-gradient(circle at 35% 30%, #d8405a, #7a1428); border: 1.5px solid var(--gold2); text-shadow: 0 1px 2px #000; }
.tab-label { font-size: 13px; font-weight: 700; text-shadow: var(--outline); white-space: nowrap; }
.tab.on .tab-seal { background: radial-gradient(circle at 35% 30%, #fff1b8, #c9973a); color: #3a1020; transform: scale(1.12); box-shadow: 0 0 10px rgba(243, 210, 122, .8); }
.tab.on .tab-label { color: var(--gold); }

/* HUD chips */
.hud-strip { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.hud-when { display: flex; gap: 6px; align-items: baseline; background: rgba(20, 8, 26, .72); border: 1px solid rgba(243, 210, 122, .6); border-radius: 16px; padding: 3px 10px; height: 30px; font-weight: 800; text-shadow: var(--outline); white-space: nowrap; }
.hud-age { font-size: 16px; color: var(--gold); } .hud-season { font-size: 16px; } .hud-week { font-size: 13px; }
.hud-chip { display: flex; align-items: center; gap: 4px; background: rgba(20, 8, 26, .72); border: 1px solid rgba(243, 210, 122, .6); border-radius: 16px; padding: 2px 10px 2px 3px; height: 30px; color: var(--text); font-family: var(--font); }
.hud-chip img { width: 24px; height: 24px; object-fit: contain; }
button.hud-chip { cursor: pointer; min-height: 30px; }
.hud-num { font-size: 16px; font-weight: 800; text-shadow: var(--outline); }

.float-text { position: absolute; z-index: 35; transform: translate(-50%, -50%); font-weight: 900; font-size: 18px; color: var(--gold); text-shadow: var(--outline); pointer-events: none; white-space: nowrap; animation: floatUp 1.3s ease-out forwards; }

/* title */
.screen-title { background: #1a0f22; }
.title-art { position: absolute; inset: 0; background: center / cover no-repeat; animation: slowZoom 18s ease-in-out infinite alternate; }
.title-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 8, 30, .35) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,0) 70%, rgba(14, 4, 20, .75) 100%); }
.title-logo { position: absolute; left: 50%; top: 62px; width: 330px; max-height: 210px; object-fit: contain; transform: translateX(-50%); animation: logoIn .8s cubic-bezier(.3, 1.5, .5, 1) both, floaty 4s ease-in-out .8s infinite; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .6)); }
.title-start { position: absolute; left: 40px; right: 40px; bottom: 82px; min-height: 44px; line-height: 44px; text-align: center; font-size: 20px; font-weight: 900; color: #fff4dc; text-shadow: var(--outline), 0 0 12px rgba(255, 190, 220, .8); animation: pulse 1.8s ease-in-out infinite; }
.title-sub { position: absolute; left: 0; right: 0; bottom: 62px; text-align: center; font-size: 14px; color: var(--gold); text-shadow: var(--outline); }
.title-petal { position: absolute; top: -20px; width: 14px; height: 10px; border-radius: 70% 0 70% 0; background: linear-gradient(135deg, #ffd6e4, #ff8fb8); opacity: .85; pointer-events: none; animation: petalFall linear infinite; }

/* intro video */
#intro { position: absolute; inset: 0; z-index: 70; background: #000 url(assets/cover-bg.webp) center / cover no-repeat; }
#introVideo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#introSkip { position: absolute; right: 16px; bottom: 24px; }
.subtitle { position: absolute; left: 16px; right: 16px; bottom: 96px; text-align: center; font-size: 17px; font-weight: 800; line-height: 1.5; text-shadow: var(--outline); color: #fff; }

@keyframes fadeIn { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes drop { 0% { transform: translateY(-16px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }
@keyframes pulse { 0%, 100% { opacity: .65; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes logoIn { 0% { opacity: 0; transform: translateX(-50%) scale(.6) translateY(-30px); } 100% { opacity: 1; transform: translateX(-50%) scale(1); } }
@keyframes floaty { 0%, 100% { margin-top: 0; } 50% { margin-top: -6px; } }
@keyframes slowZoom { from { transform: scale(1); } to { transform: scale(1.08); } }
@keyframes petalFall { 0% { transform: translate(0, 0) rotate(0); } 100% { transform: translate(-80px, 760px) rotate(540deg); } }
@keyframes shake { 0%, 100% { margin-left: 0; } 20% { margin-left: -5px; } 40% { margin-left: 5px; } 60% { margin-left: -3px; } 80% { margin-left: 3px; } }
#stage.shake { animation: shake .35s; }
