/* Lumora: warm pirate-cartoon UI on top of the shared site styles */
body.lumora { --wood: #6b3f1f; --wood2: #8a5530; --parch: #f6e7c1; --parch2: #e8d29c; --ink: #3b2412; --sea: #0b2a4a; --goldc: #ffcf3d; background: var(--sea); font-family: 'Rajdhani', system-ui, sans-serif; }
body.lumora #sea, body.lumora #game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
body.lumora #game { cursor: default; }

.lu-card {
  width: min(520px, 100%); margin: auto; padding: 22px 22px 18px; border-radius: 18px; text-align: center; color: var(--ink);
  background: linear-gradient(180deg, var(--parch), var(--parch2)); border: 4px solid var(--wood);
  box-shadow: 0 0 0 3px #3a210f, 0 18px 50px rgba(0, 0, 0, 0.5), inset 0 0 40px rgba(120, 70, 20, 0.25);
  display: flex; flex-direction: column; gap: 12px; animation: pop 0.25s ease-out;
}
.lu-card .input { color: var(--ink); background: #fff8e6; border-color: var(--wood2); box-shadow: none; }
.lu-card .note { color: #6d5233; }
.lu-card a { color: #0b6aa2; }
.lu-logo { display: flex; align-items: center; justify-content: center; gap: 14px; }
.lu-logo img { height: 74px; transform: rotate(-20deg); filter: drop-shadow(0 4px 2px rgba(0, 0, 0, 0.3)); }
.lu-logo img.flip { transform: rotate(200deg); }
.lu-logo h1 { margin: 0; font-family: var(--display); font-size: clamp(2.2rem, 9vw, 3.2rem); letter-spacing: 0.12em; color: var(--goldc);
  -webkit-text-stroke: 2px #5a3210; text-shadow: 0 4px 0 #5a3210, 0 0 22px rgba(255, 207, 61, 0.6); }
.lu-logo p { margin: 0; font-weight: 700; letter-spacing: 0.2em; color: #7a4a22; text-transform: uppercase; font-size: 0.9rem; }
.story { margin: 0; font-size: 1.02rem; line-height: 1.45; text-align: left; background: rgba(255, 255, 255, 0.35); padding: 10px 12px; border-radius: 10px; border-left: 4px solid var(--wood2); }
.btn.gold { border-color: #a86b12; background: linear-gradient(180deg, #ffd85c, #f0a91a); color: #4a2a06; box-shadow: 0 4px 0 #8a520b, 0 8px 20px rgba(0, 0, 0, 0.3); text-shadow: none; }
.btn.gold:disabled { filter: grayscale(0.7); opacity: 0.6; }
.lu-card .btn.ghost { color: var(--ink); border-color: var(--wood2); }
.credit { opacity: 0.7; }
.lumora .account .who { color: #1e7a2e; text-shadow: none; }
.lumora .account .btn { color: var(--ink); }
.lumora .account .link { color: #8a5530; }

/* HUD */
#hud[hidden] { display: none; }
.res { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; pointer-events: none; }
.res span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: rgba(40, 22, 8, 0.75); color: #fff3d6; font-weight: 700; font-size: 0.95rem; border: 1px solid rgba(255, 207, 61, 0.4); }
.res span.full { border-color: #ff6b4a; color: #ffb3a1; }
.captain { position: fixed; top: 10px; left: 10px; z-index: 5; width: 250px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.cap-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; background: rgba(40, 22, 8, 0.75); color: #fff3d6; }
.cap-row .lvl { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(#ffe27a, #e09a12); color: #4a2a06; font-weight: 900; font-family: var(--display); border: 2px solid #5a3210; }
.cap-row > div { flex: 1; min-width: 0; }
.cap-row b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xpbar.small { height: 7px; }
.xpbar.small i { background: linear-gradient(90deg, #ffcf3d, #ff9a1f); box-shadow: none; }
.quest { padding: 8px 10px; border-radius: 12px; background: linear-gradient(180deg, rgba(246, 231, 193, 0.95), rgba(232, 210, 156, 0.95)); color: var(--ink); border: 2px solid var(--wood); font-size: 0.92rem; line-height: 1.25; }
.quest small { display: block; font-weight: 700; color: #8a5530; font-size: 0.75rem; letter-spacing: 0.04em; margin-bottom: 2px; }
.quest .xpbar { margin-top: 5px; background: rgba(0, 0, 0, 0.12); }
.nav { position: fixed; top: 10px; right: 10px; z-index: 5; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; pointer-events: none; }
#mini { width: 150px; height: 150px; border-radius: 50%; border: 3px solid var(--wood); box-shadow: 0 0 0 2px #3a210f, 0 6px 16px rgba(0, 0, 0, 0.4); }
.nav-info { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: #fff3d6; font-weight: 700; font-size: 0.85rem; text-shadow: 0 1px 3px #000; }
.wind i { display: inline-block; font-style: normal; color: #bfe8ff; }
.status { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(420px, 70vw); pointer-events: none; }
.hull { width: 100%; display: flex; align-items: center; gap: 8px; color: #fff3d6; font-weight: 700; text-shadow: 0 1px 3px #000; font-size: 0.85rem; }
.bar { flex: 1; height: 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.5); overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.25); }
.bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #4cd964, #9be15d); transition: width 0.2s; }
.bar i.low { background: linear-gradient(90deg, #ff3d3d, #ff9a1f); }
.guns { display: flex; align-items: center; gap: 10px; }
.reload { width: 70px; height: 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.5); overflow: hidden; }
.reload i { display: block; height: 100%; width: 100%; background: #ffcf3d; }
#sailNotch { color: #fff; font-weight: 700; text-shadow: 0 1px 3px #000; min-width: 60px; text-align: center; }
.fishbar { width: 70%; display: flex; align-items: center; gap: 8px; color: #bff8ff; font-weight: 700; font-size: 0.8rem; text-shadow: 0 1px 3px #000; }
.fishbar[hidden] { display: none; }
.fishbar .bar i { background: linear-gradient(90deg, #3dffd8, #22a7ff); transition: none; }
#dockBtn { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 6; border-color: #a86b12; background: linear-gradient(180deg, #ffd85c, #f0a91a); color: #4a2a06; box-shadow: 0 4px 0 #8a520b; animation: pulse2 0.9s infinite alternate; }
#dockBtn[hidden] { display: none; }
.newbie { position: fixed; left: 50%; top: 52px; transform: translateX(-50%); z-index: 4; font-size: 0.8rem; color: #bfe8ff; text-shadow: 0 1px 3px #000; pointer-events: none; white-space: nowrap; }
.newbie[hidden] { display: none; }
.actions { position: fixed; right: 14px; bottom: 16px; z-index: 6; display: flex; gap: 8px; align-items: flex-end; }
.act { min-width: 74px; padding: 12px 10px; border-radius: 14px; border: 2px solid #5a3210; background: linear-gradient(180deg, #a86a3a, #7a4520); color: #fff3d6; font-weight: 800; font-size: 0.95rem; box-shadow: 0 4px 0 #3a210f; touch-action: none; user-select: none; cursor: pointer; }
.act:active, .act.on { transform: translateY(2px); box-shadow: 0 2px 0 #3a210f; filter: brightness(1.15); }
.act.net { background: linear-gradient(180deg, #2a9fd6, #146b9a); }
.act.small { min-width: 0; padding: 8px 10px; font-size: 1.1rem; }
body:not(.touch) .actions { opacity: 0.85; }
.chat { position: fixed; left: 12px; bottom: 14px; z-index: 6; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
#chatLog { display: flex; flex-direction: column; gap: 2px; font-size: 0.85rem; color: #fff; text-shadow: 0 1px 3px #000; pointer-events: none; max-width: 260px; }
#chatLog b { color: #ffcf3d; }
#chatPick { display: grid; grid-template-columns: repeat(2, auto); gap: 4px; padding: 6px; border-radius: 12px; background: rgba(40, 22, 8, 0.85); }
#chatPick[hidden] { display: none; }
#chatPick button { padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(255, 207, 61, 0.4); background: rgba(255, 255, 255, 0.08); color: #fff3d6; font-weight: 700; cursor: pointer; text-align: left; }
body.touch .chat { bottom: auto; top: 50%; }
body.touch .status { bottom: 6px; width: 46vw; left: 50%; }
body.touch #dockBtn { bottom: 72px; }
@media (max-width: 700px) {
  .captain { width: 190px; font-size: 0.85rem; }
  #mini { width: 110px; height: 110px; }
  .res { top: auto; bottom: 64px; }
  .res span { font-size: 0.8rem; padding: 3px 7px; }
  body.touch .res { top: 6px; bottom: auto; left: auto; right: 124px; transform: none; flex-direction: column; align-items: flex-end; }
  .act { min-width: 62px; padding: 14px 8px; }
}

/* harbor window */
.lu-card.port { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; text-align: left; }
.port-head { display: flex; justify-content: space-between; align-items: center; }
.port-head h2 { margin: 0; font-family: var(--display); color: #7a4a22; }
.port-res { display: flex; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.port-res span { padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.5); border: 1px solid var(--parch2); }
.lumora .tabs { border-color: var(--wood2); background: rgba(90, 50, 16, 0.15); }
.lumora .tabs button { color: #6d5233; }
.lumora .tabs button.on { background: var(--wood); color: #fff3d6; box-shadow: none; }
.port-tabs { grid-template-columns: repeat(3, 1fr); }
.p-list { display: flex; flex-direction: column; gap: 8px; }
.p-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.45); border: 1px solid var(--parch2); }
.p-item.locked { opacity: 0.55; }
.p-item img, .p-item canvas { width: 56px; height: 56px; object-fit: contain; }
.p-item h4 { margin: 0; font-size: 1.05rem; }
.p-item small { display: block; color: #6d5233; }
.p-item .cost { font-weight: 700; font-size: 0.88rem; }
.p-item .cost .no { color: #c0392b; }
.pips { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.pips i { width: 10px; height: 10px; border-radius: 3px; background: rgba(0, 0, 0, 0.15); }
.pips i.on { background: #e09a12; }
.p-btn { padding: 8px 14px; border-radius: 10px; border: 2px solid #5a3210; background: linear-gradient(180deg, #ffd85c, #f0a91a); color: #4a2a06; font-weight: 800; cursor: pointer; white-space: nowrap; }
.p-btn:disabled { filter: grayscale(1); opacity: 0.5; cursor: default; }
.p-btn.alt { background: linear-gradient(180deg, #8fd3ff, #3aa0e0); color: #08304d; }
.colors { display: flex; gap: 8px; margin: 6px 0 4px; }
.colors button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.colors button.on { border-color: var(--ink); }
.market-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.sunk-title { margin: 0; font-family: var(--display); color: #b03a2e; }

/* toasts */
#toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
#toasts div { padding: 7px 16px; border-radius: 999px; background: rgba(40, 22, 8, 0.85); color: #fff3d6; font-weight: 800; border: 1px solid rgba(255, 207, 61, 0.6); animation: pop 0.2s ease-out; }
#toasts div.big { font-size: 1.3rem; font-family: var(--display); color: #ffcf3d; padding: 10px 22px; }
body.lumora .joy { border-color: rgba(255, 243, 214, 0.6); background: rgba(40, 22, 8, 0.25); }
body.lumora .joy i { background: rgba(255, 207, 61, 0.7); box-shadow: 0 0 12px rgba(255, 207, 61, 0.7); }

/* ── base screen ── */
.base-screen { position: fixed; inset: 0; z-index: 12; background: #1d6fa8; }
.base-screen[hidden] { display: none; }
#baseCv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.base-top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; pointer-events: none; }
.base-top > * { pointer-events: auto; }
.base-res { display: flex; gap: 6px; flex-wrap: wrap; }
.base-res span { padding: 5px 10px; border-radius: 12px; background: rgba(40, 22, 8, 0.8); color: #fff3d6; font-weight: 700; font-size: 0.9rem; border: 1px solid rgba(255, 207, 61, 0.4); line-height: 1.1; }
.base-res small { display: block; color: #9be15d; font-size: 0.72rem; }
.base-res span.cap small { color: #ff9a7a; }
.base-info { display: flex; gap: 6px; flex-wrap: wrap; }
.base-info span { padding: 5px 10px; border-radius: 12px; background: rgba(246, 231, 193, 0.92); color: #3b2412; font-weight: 700; font-size: 0.9rem; border: 2px solid #6b3f1f; }
.base-info .shield { background: #d6f0ff; border-color: #2a7fb8; }
.base-btns { margin-left: auto; display: flex; gap: 6px; }
.base-build { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; background: rgba(40, 22, 8, 0.85); color: #fff3d6; font-weight: 700; display: flex; gap: 10px; align-items: center; }
.base-build[hidden] { display: none; }
.base-build .bar { width: 140px; flex: none; }
.plot-panel { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(560px, calc(100% - 20px)); max-height: 56vh; overflow-y: auto;
  padding: 14px 16px; border-radius: 16px; color: #3b2412; background: linear-gradient(180deg, #f6e7c1, #e8d29c); border: 4px solid #6b3f1f; box-shadow: 0 0 0 3px #3a210f, 0 12px 30px rgba(0,0,0,.45); }
.plot-panel[hidden] { display: none; }
.plot-panel.wide { width: min(680px, calc(100% - 20px)); max-height: 70vh; }
.plot-panel h3 { margin: 0 0 4px; font-family: var(--display); color: #7a4a22; display: flex; justify-content: space-between; align-items: center; }
.plot-panel .x { background: none; border: 0; font-size: 1.5rem; color: #6b3f1f; cursor: pointer; }
.plot-panel .desc { margin: 2px 0 8px; color: #6d5233; }
.plot-panel .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.plot-panel .why { color: #b03a2e; font-weight: 700; font-size: 0.85rem; }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.bcard { display: flex; flex-direction: column; gap: 3px; padding: 8px; border-radius: 12px; background: rgba(255,255,255,.5); border: 1px solid #e8d29c; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.bcard:disabled { opacity: .5; cursor: default; }
.bcard canvas { width: 100%; height: 70px; }
.bcard b { font-size: 1rem; }
.bcard small { color: #6d5233; }
.target { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.5); border: 1px solid #e8d29c; margin-bottom: 6px; align-items: center; }
.target small { color: #6d5233; display: block; }
.report { padding: 6px 10px; border-radius: 10px; margin-bottom: 6px; background: rgba(255,255,255,.5); border-left: 5px solid #4cb050; }
.report.lost { border-left-color: #e04a4a; }
.report small { color: #6d5233; }
.battle-banner { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); padding: 18px 26px; border-radius: 18px; text-align: center; color: #3b2412;
  background: linear-gradient(180deg, #f6e7c1, #e8d29c); border: 4px solid #6b3f1f; box-shadow: 0 0 0 3px #3a210f, 0 16px 40px rgba(0,0,0,.5); animation: pop .3s ease-out; }
.battle-banner[hidden] { display: none; }
.battle-banner h2 { margin: 0 0 6px; font-family: var(--display); font-size: 2rem; }
.battle-banner h2.win { color: #2e8b3e; } .battle-banner h2.lose { color: #b03a2e; }
.row-btns { display: flex; gap: 6px; }
@media (max-width: 700px) { .base-btns { margin-left: 0; } .base-res span { font-size: .8rem; padding: 4px 7px; } }

/* ── Phase 3 ── */
.boss-bar { position: fixed; top: 92px; left: 50%; transform: translateX(-50%); z-index: 5; width: min(420px, 70vw); text-align: center; color: #ffb3f0; font-family: var(--display); text-shadow: 0 0 10px #8a1f8a, 0 2px 3px #000; pointer-events: none; }
.boss-bar[hidden] { display: none; }
.boss-bar .bar { height: 14px; margin-top: 4px; border-color: rgba(255, 120, 230, 0.6); }
.boss-bar .bar i { background: linear-gradient(90deg, #8a1f8a, #ff4fd8); }
.port-tabs.trading { grid-template-columns: repeat(2, 1fr); }
.good { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.45); border: 1px solid #e8d29c; }
.good .ico { font-size: 1.9rem; text-align: center; }
.good small { display: block; color: #6d5233; }
.good .stock { height: 6px; border-radius: 99px; background: rgba(0,0,0,.12); overflow: hidden; margin-top: 3px; width: 140px; }
.good .stock i { display: block; height: 100%; background: #2a9fd6; }
.good .btns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tag-cheap { color: #2e8b3e; font-weight: 800; } .tag-dear { color: #b03a2e; font-weight: 800; }

/* phones: action buttons stacked on the right, status bar left of them, nothing overlaps */
@media (max-width: 700px) {
  body.touch .actions { flex-direction: column; align-items: stretch; right: 10px; bottom: 12px; gap: 8px; }
  body.touch .act { min-width: 92px; padding: 14px 8px; font-size: 0.95rem; }
  body.touch .act.net { order: -1; }
  body.touch .status { left: 10px; right: 112px; bottom: 10px; transform: none; width: auto; }
  body.touch #dockBtn { left: 10px; right: 112px; transform: none; bottom: 80px; animation: none; padding: 12px; font-size: 1rem; }
  body.touch .captain { width: 165px; }
  body.touch .quest { font-size: 0.8rem; padding: 6px 8px; }
  body.touch .chat { top: auto; bottom: 120px; left: 10px; }
  body.touch .boss-bar { top: 140px; }
  body.touch .newbie { top: auto; bottom: 96px; white-space: normal; width: 60vw; text-align: center; }
}
@media (max-width: 700px) { body.touch .act.small { min-width: 0; padding: 8px 12px; font-size: 1.1rem; } }

/* ── guilds ── */
.guild-card h2 { display: flex; align-items: center; gap: 8px; font-size: 1.3rem; }
.g-tabs { display: flex; flex-wrap: wrap; }
.g-tabs button { flex: 1; min-width: 80px; }
.g-badge { display: inline-grid; place-items: center; border-radius: 50%; border: 3px solid #3a210f; box-shadow: 0 2px 0 rgba(0,0,0,.3); flex: none; }
.g-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.45); border: 1px solid #e8d29c; margin-bottom: 6px; }
.g-row.me { border-color: #4cb050; }
.g-row small { display: block; color: #6d5233; }
.g-row .btns { display: flex; gap: 4px; }
.g-row .dot { width: 10px; height: 10px; border-radius: 50%; background: #bbb; }
.g-row .dot.on { background: #4cb050; box-shadow: 0 0 6px #4cb050; }
.g-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.g-pick button { width: 38px; height: 38px; border-radius: 10px; border: 2px solid transparent; background: rgba(255,255,255,.6); font-size: 1.3rem; cursor: pointer; }
.g-pick button.on { border-color: #3b2412; }
.g-goal { padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.45); border: 1px solid #e8d29c; }
.g-goal.done { border-color: #4cb050; background: rgba(76,176,80,.15); }
.g-goal .bar { margin: 4px 0; height: 10px; }
.g-chat { max-height: 34vh; overflow-y: auto; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.5); display: flex; flex-direction: column; gap: 3px; font-size: .95rem; }
.g-chat i { color: #6d5233; }
.g-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 5px; margin-top: 8px; }
.g-quick button { padding: 7px; border-radius: 10px; border: 1px solid #8a5530; background: #fff8e6; cursor: pointer; font-weight: 700; color: #3b2412; text-align: left; }
.guild-card .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.guild-card h4 { margin: 12px 0 6px; }
