/* Menú principal 2.1: partidas, logros, multijugador, configuración, tienda, trucos y avisos de logros */
.menu-card { position: relative; transition: width .2s; }
.menu-card.wide-card { width: min(980px, calc(100vw - 32px)); padding: 26px 30px 24px; }
.menu-card.wide-card h1, .menu-card.wide-card .tagline { display: none; }
.btn.big { font-size: 19px; padding: 16px 20px; }
.btn.icon { padding: 9px 11px; }
.btn.danger { background: rgba(255,90,79,.18); border-color: var(--danger); color: #ffb3ad; }
.btn:disabled { opacity: .5; cursor: default; }
.profile-chip {
  position: absolute; top: 16px; right: 18px; z-index: 2; display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.06);
  color: var(--text); font: 700 13px 'Nunito', sans-serif;
}
.profile-chip:hover { background: rgba(255,255,255,.12); }
.profile-chip i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.profile-chip span { color: var(--muted); }

.wide { text-align: left; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h3 { margin: 4px 0 12px; }
.head-btns { display: flex; gap: 8px; }
.row-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.row-btns.left { justify-content: flex-start; margin-top: 6px; }
.small-text { font-size: 13px; line-height: 1.45; }
.coins-big { font-weight: 900; color: var(--accent); font-size: 18px; }
.wide h3 { font-size: 22px; }

/* Lista de partidas */
.world-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; padding-right: 4px; }
.world-list.compact { max-height: 34vh; }
.world { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.04); }
.world:hover { background: rgba(255,255,255,.07); }
.w-main { flex: 1; min-width: 0; }
.w-name { font-size: 17px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-edit { width: 100%; }
.w-tags { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12.5px; margin-top: 4px; color: var(--text); }
.w-seed { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.w-seed code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: var(--text); background: rgba(255,255,255,.08); padding: 1px 7px; border-radius: 6px; user-select: all; }
.seed-copy { font: 800 11.5px inherit; font-family: inherit; padding: 2px 8px; border-radius: 7px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--text); cursor: pointer; }
.seed-copy:hover { background: rgba(255,255,255,.14); }
.tag { font-weight: 800; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.1); }
.tag.d0 { background: rgba(127,220,111,.18); color: var(--good); }
.tag.d1 { background: rgba(242,181,68,.16); color: var(--accent); }
.tag.d2 { background: rgba(255,90,79,.18); color: #ff9a92; }
.tag.cheat { background: rgba(179,110,224,.2); color: #d9b3f5; }
button.tag { border: 0; font: inherit; font-weight: 800; cursor: pointer; }
.tag.death { background: rgba(224,70,70,.16); color: #ffb4b4; }
.tag.death:hover { background: rgba(224,70,70,.3); }
/* Novedades: una tarjeta por versión con su miniatura y el contenido desplegable */
.news-list { max-height: 64vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding-right: 6px; margin-bottom: 12px; }
.news { border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.04); overflow: hidden; flex: none; }
.news.latest { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(242,181,68,.35); }
.news-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #0e2a3a; }
.news { display: grid; grid-template-columns: 230px 1fr; }
.news.latest { grid-template-columns: 3fr 2fr; }
.news.nothumb { grid-template-columns: 1fr; }
.news-body { padding: 12px 16px 14px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
.news-more { margin-top: 8px; }
.news-title { font-weight: 900; font-size: 17px; }
.news.latest .news-title { font-size: 22px; line-height: 1.25; }
.news.latest .news-badge { vertical-align: 3px; }
.news-badge { font-size: 11.5px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #1d1406; margin-left: 6px; vertical-align: 2px; }
.news-date { color: var(--muted); font-size: 12.5px; }
.news-content { display: none; grid-column: 1 / -1; padding: 0 14px 14px; font-size: 13.5px; line-height: 1.5; }
.news.open .news-content { display: block; }
.news-content h4 { font-family: 'Cinzel', serif; font-size: 14px; color: var(--accent); margin: 14px 0 6px; letter-spacing: .4px; }
.news-content ul { margin: 0; padding-left: 20px; }
.news-content li { margin: 3px 0; }
.news-content p { margin: 6px 0; }
.news-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.news-gallery figure { margin: 0; }
.news-gallery img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.news-gallery figcaption { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.w-btns { display: flex; gap: 6px; flex: none; }
.world-empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }
.world-info { padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--line); line-height: 1.5; margin: 6px 0 12px; }

/* Crear partida */
.diff.on { border-color: var(--accent); background: rgba(242,181,68,.14); }
.diff[data-d="2"].on { border-color: var(--danger); background: rgba(255,90,79,.14); }
.create-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.create-grid .mp-input { display: block; width: 100%; margin-top: 3px; }
.toggle-row { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; font-size: 14.5px; cursor: pointer; }
.toggle-row input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.toggle-row small { display: block; font-size: 12.5px; margin-top: 2px; }

/* Pestañas */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.tabs button { cursor: pointer; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--muted); font: 800 13px 'Nunito', sans-serif; }
.tabs button.on { background: rgba(242,181,68,.16); border-color: var(--accent); color: var(--text); }

/* Logros */
.ach-tiers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 10px; }
.tier { padding: 8px 10px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent); background: color-mix(in srgb, var(--tc) 10%, transparent); }
.tier b { font-size: 18px; color: var(--tc); margin-right: 6px; }
.tier span { font-size: 12.5px; font-weight: 800; }
.tier .bar, .ach .bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; margin-top: 6px; }
.tier .bar i, .ach .bar i { display: block; height: 100%; background: var(--tc); }
.ach-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.ach-list.compact { max-height: 40vh; text-align: left; }
.ach { display: flex; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); border-left: 4px solid var(--tc); background: rgba(255,255,255,.03); opacity: .8; }
.ach.got { opacity: 1; background: color-mix(in srgb, var(--tc) 12%, transparent); }
.ach-ic { font-size: 26px; width: 36px; text-align: center; filter: grayscale(.7); flex: none; }
.ach.got .ach-ic { filter: none; }
.ach-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ach-tx span { font-size: 13px; color: var(--muted); }
.ach-tx small { font-size: 11.5px; margin-top: 2px; }
.ach-side { text-align: right; display: flex; flex-direction: column; gap: 3px; flex: none; }
.tier-tag { font-size: 11.5px; font-weight: 900; color: var(--tc); text-transform: uppercase; letter-spacing: .5px; }
.ach-side small { font-size: 12px; color: var(--muted); }

/* Multijugador */
.mp-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.mp-cols section { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.mp-cols h4 { margin: 0 0 10px; font-size: 16px; }
.mp-cols .mp-input { width: 100%; display: block; margin-top: 3px; }
#mpJoin { width: 100%; margin-top: 10px; }
#mpLobby, #menuMP .mp-info { text-align: left; }
#mpStart { width: 100%; }

/* Configuración */
.set-page { min-height: 300px; }
.char-cols { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
.preview-box { position: relative; height: 360px; border-radius: 14px; border: 1px solid var(--line); background: radial-gradient(ellipse at 50% 30%, rgba(60,130,160,.35), rgba(8,14,18,.6)); overflow: hidden; }
.preview-box canvas.preview3d { width: 100%; height: 100%; display: block; cursor: grab; }
.preview-hint { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-size: 11.5px; color: var(--muted); pointer-events: none; }
.char-edit .mp-input { width: 100%; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.swatches .swatch { width: 28px; height: 28px; }
.cos-slots { display: flex; flex-direction: column; gap: 6px; }
.cos-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.cos-row select, #chItem { padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: #1b2328; color: var(--text); font: 700 13.5px 'Nunito', sans-serif; }
.slider-row { display: grid; grid-template-columns: 230px 1fr 60px; align-items: center; gap: 12px; margin: 12px 0; font-weight: 700; font-size: 14.5px; }
.slider-row input { accent-color: var(--accent); }
.slider-row b { text-align: right; color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { cursor: pointer; padding: 9px 18px; background: rgba(255,255,255,.04); color: var(--text); border: none; border-right: 1px solid var(--line); font: 800 14px 'Nunito', sans-serif; }
.seg button:last-child { border-right: none; }
.seg button.on { background: rgba(242,181,68,.2); color: var(--accent); }
#menuSettings .controls-list { margin: 6px 0 0; max-width: none; grid-template-columns: 170px 1fr; max-height: 30vh; overflow-y: auto; }

/* Tienda */
.shop-body { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-content: start; max-height: 52vh; overflow-y: auto; padding-right: 4px; }
.shop-item { cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text); font-family: 'Nunito', sans-serif; }
.shop-item:hover { background: rgba(255,255,255,.08); }
.shop-item.sel { border-color: var(--accent); background: rgba(242,181,68,.12); }
.si-ic { font-size: 30px; }
.shop-item b { font-size: 13.5px; text-align: center; }
.si-price { font-size: 12.5px; font-weight: 800; color: var(--accent); }
.shop-item.own .si-price { color: var(--good); }
.shop-side .preview-box { height: 250px; }
.shop-flat canvas { width: 100%; border-radius: 14px; border: 1px solid var(--line); display: block; }
#shopInfo h4 { margin: 12px 0 4px; font-size: 17px; }
#shopInfo p { margin: 4px 0 10px; }
#shopInfo .btn { width: 100%; }

/* Trucos */
#cheats { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); }
.cheat-card { position: relative; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; padding: 22px 26px; border-radius: 18px; border: 1px solid rgba(179,110,224,.45); background: linear-gradient(180deg, rgba(26,18,34,.95), rgba(12,10,18,.95)); }
.cheat-card h2 { margin: 0 0 4px; font-family: 'Cinzel', serif; }
.ch-toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 12px 0; }
.ch-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.04); cursor: pointer; font-weight: 800; font-size: 14px; }
.ch-toggle.on { border-color: #b36ee0; background: rgba(179,110,224,.18); }
.ch-toggle input { accent-color: #b36ee0; }
.ch-toggle small { flex-basis: 100%; font-weight: 600; font-size: 12px; color: var(--muted); }
.ch-toggle .ch-key { margin-left: auto; font-size: 11.5px; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: #e6d2f7; font-family: inherit; font-weight: 800; }
.ch-sec { margin: 12px 0; }
.ch-sec > b { display: block; font-size: 13px; color: var(--muted); letter-spacing: .5px; margin-bottom: 4px; }
.mp-input.qty { width: 80px; }
.cheat-card .close { position: absolute; top: 12px; right: 14px; }

/* Avisos de logros */
#toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; min-width: 340px; max-width: 480px; padding: 10px 14px; border-radius: 14px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 28%, #111a1f), rgba(12,18,22,.95)); border: 1px solid var(--tc);
  box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 24px color-mix(in srgb, var(--tc) 35%, transparent); animation: toastIn .45s ease-out;
}
.toast.out { opacity: 0; transform: translateY(-10px); transition: all .7s; }
.t-ic { font-size: 34px; }
.t-tx { flex: 1; display: flex; flex-direction: column; }
.t-tx small { color: var(--tc); font-weight: 900; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; }
.t-tx b { font-size: 17px; }
.t-tx span { font-size: 12.5px; color: var(--muted); }
.t-coins { font-weight: 900; color: var(--accent); white-space: nowrap; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.96); } to { opacity: 1; transform: none; } }
#pauseAch { margin-top: 12px; }

@media (max-width: 760px) {
  .panel-head { margin-right: 0; flex-wrap: wrap; }
  .profile-chip { top: 8px; right: 8px; padding: 5px 9px; }
  .char-cols, .shop-body, .mp-cols, .create-grid { grid-template-columns: 1fr; }
  .ach-tiers { grid-template-columns: repeat(3, 1fr); }
  .slider-row { grid-template-columns: 1fr 1fr 50px; }
  .world { flex-wrap: wrap; }
}

/* Pantalla de carga: tomas panorámicas de las islas */
#loading { overflow: hidden; }
#loadSlides { position: absolute; inset: 0; background: #0b1418; }
#loadSlides .slide {
  position: absolute; inset: -4%; background-size: cover; background-position: center; opacity: 0;
  animation: loadSlide 35s linear infinite; will-change: opacity, transform;
}
#loadSlides .slide:nth-child(even) { animation-name: loadSlide2; }
@keyframes loadSlide {
  0% { opacity: 0; transform: scale(1.02) translate(1.5%, 0); }
  3% { opacity: 1; }
  20% { opacity: 1; }
  23% { opacity: 0; transform: scale(1.12) translate(-1.5%, -1%); }
  100% { opacity: 0; transform: scale(1.12) translate(-1.5%, -1%); }
}
@keyframes loadSlide2 {
  0% { opacity: 0; transform: scale(1.12) translate(-1.5%, 1%); }
  3% { opacity: 1; }
  20% { opacity: 1; }
  23% { opacity: 0; transform: scale(1.03) translate(1.5%, 0); }
  100% { opacity: 0; transform: scale(1.03) translate(1.5%, 0); }
}
#loadSlides .cap {
  position: absolute; left: 8%; bottom: 17%; display: flex; flex-direction: column; gap: 4px; max-width: 520px;
  text-shadow: 0 2px 12px rgba(0,0,0,.8);
}
#loadSlides .cap b { font-family: 'Cinzel', serif; font-size: 42px; color: #ffe3a3; letter-spacing: 1px; }
#loadSlides .cap span { font-size: 17px; color: #f1ece1; }
.load-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 55%, rgba(0,0,0,.75) 100%); pointer-events: none; }
.load-title {
  position: absolute; top: 26px; left: 34px; font-family: 'Cinzel', serif; font-weight: 900; font-size: 34px; letter-spacing: 2px;
  background: linear-gradient(180deg, #ffe3a3, #e59a3a); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,.6));
}
#loading .load-box { position: absolute; left: 0; right: 0; bottom: 5%; }
#loading .load-box p { margin: 6px auto; text-shadow: 0 2px 8px rgba(0,0,0,.8); color: #e8e2d6; }
#loading .spinner { width: 34px; height: 34px; margin-bottom: 10px; }
.load-tip { font-size: 14px !important; color: #c9c3b4 !important; max-width: 640px !important; }
@media (max-width: 760px) { #loadSlides .cap b { font-size: 28px; } #loadSlides .cap { bottom: 22%; left: 6%; right: 6%; } .load-title { font-size: 24px; left: 18px; top: 16px; } }

/* Cinemática de introducción */
#cine { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.cine-bar { position: absolute; left: 0; right: 0; height: 11vh; background: #000; }
.cine-bar.top { top: 0; } .cine-bar.bot { bottom: 0; }
#cineFlash { position: absolute; inset: 0; background: #e8f0ff; opacity: 0; }
#cineBlack { position: absolute; inset: 0; background: #000; opacity: 1; transition: opacity .9s; }
#cineSub { position: absolute; left: 50%; bottom: 14vh; transform: translateX(-50%); max-width: min(900px, 90vw); text-align: center; opacity: 0; transition: opacity .35s; text-shadow: 0 2px 10px #000; font-size: 22px; line-height: 1.4; }
#cineSub.show { opacity: 1; }
#cineSub b { display: block; font-size: 15px; color: var(--accent); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 2px; }
#cineSub .narr { font-style: italic; color: #e8e2d6; font-family: 'Cinzel', serif; font-size: 24px; }
#cineTitle { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; opacity: 0; transition: opacity 1s; z-index: 2; }
#cineTitle.show { opacity: 1; }
#cineTitle small { font-family: 'Cinzel', serif; letter-spacing: 8px; color: #c9c3b4; font-size: 16px; }
#cineTitle b { font-family: 'Cinzel', serif; font-size: 58px; font-weight: 900; background: linear-gradient(180deg, #ffe3a3, #e59a3a); -webkit-background-clip: text; background-clip: text; color: transparent; }
#cineTitle span { font-size: 22px; color: #f1ece1; letter-spacing: 2px; }
.cine-skip { position: absolute; right: 24px; bottom: calc(11vh + 14px); color: #c9c3b4; font-size: 13px; opacity: .8; }

/* HUD del estilo de combate */
#styleHud { position: absolute; right: 16px; bottom: 64px; min-width: 230px; padding: 9px 12px; border-radius: 12px; background: var(--panel); border: 1px solid color-mix(in srgb, var(--sc) 55%, transparent); font-size: 13px; }
#styleHud .st-top { display: flex; gap: 6px; align-items: baseline; }
#styleHud .st-top b { color: var(--sc); }
#styleHud .st-top span { color: var(--muted); font-weight: 800; }
#styleHud .st-xp, #styleHud .st-mana { height: 4px; border-radius: 3px; background: rgba(255,255,255,.12); margin: 5px 0 6px; overflow: hidden; }
#styleHud .st-xp i { display: block; height: 100%; background: var(--sc); }
#styleHud .st-mana i { display: block; height: 100%; background: linear-gradient(90deg, #7a5ae0, #c9a0ff); }
#styleHud .st-techs { display: flex; flex-direction: column; gap: 3px; }
#styleHud .st-tech.lock { opacity: .45; }
#styleHud .st-tech.cd { color: var(--muted); }
#styleHud .st-tech small { color: var(--muted); }
#styleHud kbd { font-size: 11px; }
/* Los diálogos respetan los saltos de línea (pergaminos) */
#dialog .dlg-text { white-space: pre-line; }

/* Voces: bocadillos sobre los personajes que hablan y subtítulos de sus conversaciones */
#bubbles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bubble {
  position: absolute; left: 0; top: 0; max-width: 250px; padding: 7px 11px; border-radius: 12px;
  background: rgba(255, 249, 236, .95); color: #2a2014; font-size: 13px; font-weight: 600; line-height: 1.3;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .35); transform-origin: 50% 100%; animation: bubIn .2s ease-out;
}
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: rgba(255, 249, 236, .95); }
@keyframes bubIn { from { opacity: 0; } to { opacity: 1; } }
#chatSub {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); max-width: min(720px, 86vw);
  padding: 7px 16px; border-radius: 10px; background: rgba(8, 12, 20, .66); color: #fff; font-size: 15px; line-height: 1.35;
  text-align: center; opacity: 0; transition: opacity .25s; pointer-events: none;
}
#chatSub.show { opacity: 1; }
#chatSub b { color: #ffd27a; }

/* Columna inferior derecha del HUD: barco, estilo de combate y teclas, apilados sin solaparse */
#hudRight { position: absolute; right: 14px; bottom: 14px; width: 262px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
#hudRight #shipHud, #hudRight #styleHud { position: static; width: auto; min-width: 0; box-sizing: border-box; }
#hudRight #keyhint { position: static; text-align: right; font-size: 11.5px; line-height: 2.1; }
/* Los subtítulos de las conversaciones, por encima del nombre del objeto y del poder */
#chatSub { bottom: 156px; }
@media (max-width: 1320px) { #hudRight { bottom: 104px; width: 240px; } }

/* ---------- Pizarra de banderas (Tienda → Banderas → Tu propia bandera) ---------- */
.fe-overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(4, 10, 16, .78); backdrop-filter: blur(3px); }
.fe-overlay.hidden { display: none; }
.fe-card { width: min(1020px, 100%); max-height: 100%; overflow: auto; padding: 16px 18px; border-radius: 16px; background: #13232d; border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.fe-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.fe-head h3 { margin: 0; font-family: 'Cinzel', serif; }
.fe-body { display: grid; grid-template-columns: 92px 1fr 210px; gap: 14px; align-items: start; }
.fe-tools { display: grid; grid-template-columns: 1fr; gap: 5px; }
.fe-tools button, .fe-stamps button, .fe-toggle { cursor: pointer; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); color: #fff; border-radius: 9px; font: inherit; }
.fe-tools button { display: flex; flex-direction: column; align-items: center; padding: 5px 2px; }
.fe-tools button span { font-size: 19px; line-height: 1.1; }
.fe-tools button small { font-size: 10.5px; opacity: .8; }
.fe-tools button.on, .fe-stamps button.on, .fe-toggle.on { background: rgba(240, 190, 80, .22); border-color: #f0be50; }
.fe-stage { min-width: 0; }
.fe-canvas { position: relative; width: 100%; aspect-ratio: 480 / 300; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 3px #6a4a2a, 0 8px 24px rgba(0, 0, 0, .45); background: #111; }
.fe-canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.fe-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.fe-size { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.fe-size input { width: 130px; }
.fe-toggle { padding: 5px 10px; font-size: 13px; }
.fe-palette button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); cursor: pointer; padding: 0; }
.fe-palette button.on { border-color: #f0be50; box-shadow: 0 0 0 2px #f0be50; }
.fe-pick { position: relative; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; }
.fe-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.fe-side .mp-label { margin: 0 0 6px; }
.fe-stamps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 12px; }
.fe-stamps button { font-size: 20px; padding: 5px 0; }
.fe-side input#feText { width: 100%; box-sizing: border-box; margin-bottom: 12px; padding: 7px 9px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(0, 0, 0, .3); color: #fff; font: inherit; }
.fe-mast { position: relative; padding: 8px 0 8px 14px; }
.fe-mast::before { content: ''; position: absolute; left: 4px; top: 0; bottom: -20px; width: 7px; border-radius: 3px; background: #7a5230; }
.fe-mast canvas { width: 100%; border-radius: 2px; box-shadow: 0 4px 12px rgba(0, 0, 0, .4); }
.fe-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.fe-grow { flex: 1; }
@media (max-width: 820px) {
  .fe-body { grid-template-columns: 1fr; }
  .fe-tools { grid-template-columns: repeat(5, 1fr); }
  .fe-stamps { grid-template-columns: repeat(6, 1fr); }
}

/* ---------- Cartel de "Se busca" ---------- */
.poster-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px; border-radius: 14px; background: #1c140c; border: 1px solid rgba(240, 190, 80, .3); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); max-height: 100%; }
.poster-card canvas { width: min(384px, 80vw); height: auto; max-height: calc(100vh - 150px); object-fit: contain; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); transform: rotate(-1deg); }
.poster-card p { max-width: 384px; text-align: center; margin: 0; }
/* Elegir bando (faction.js) */
.fac-box { width: min(920px, 100%); max-height: 100%; overflow-y: auto; padding: 22px; border-radius: 16px; background: #10181e; border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); text-align: center; }
.fac-box h2 { margin: 0 0 4px; font-family: 'Cinzel', Georgia, serif; font-size: 28px; color: #f2b544; }
.fac-box > p { margin: 0 0 16px; }
.fac-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.fac-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 14px; text-align: left; border: 2px solid transparent; }
.fac-pirata { background: linear-gradient(160deg, #2a1414, #150c0c); border-color: rgba(232, 112, 95, .45); }
.fac-marina { background: linear-gradient(160deg, #13243a, #0b1422); border-color: rgba(111, 180, 255, .45); }
.fac-card:hover { transform: translateY(-2px); transition: transform .15s; }
.fac-ic { font-size: 44px; text-align: center; line-height: 1; }
.fac-card h3 { margin: 0; text-align: center; font-family: 'Cinzel', Georgia, serif; font-size: 22px; }
.fac-pirata h3 { color: #ff9a86; } .fac-marina h3 { color: #9fcaff; }
.fac-intro { margin: 0; font-size: 14px; color: #d8d2c6; font-style: italic; }
.fac-card ul { margin: 0; padding-left: 4px; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.35; flex: 1; }
.fac-card .btn { margin-top: 6px; align-self: stretch; }
/* Marcador del duelo (duel.js) */
#duelHud { position: fixed; top: 96px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px; background: rgba(14, 20, 24, .78); border: 1px solid rgba(255, 255, 255, .14); z-index: 6; pointer-events: none; }
#duelHud.hidden { display: none; }
#duelHud > span { font-size: 20px; }
.dh-side { width: 170px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.dh-side.foe { text-align: right; }
.dh-side i { display: block; height: 8px; border-radius: 4px; background: #5fd36a; transition: width .2s; }
.dh-side.foe i { background: #ff6a5a; margin-left: auto; }
/* Destello de la parada perfecta (parry.js) */
#parryFlash { position: fixed; inset: 0; pointer-events: none; z-index: 30; opacity: 0; background: radial-gradient(circle, rgba(255, 244, 200, .5), rgba(255, 244, 200, 0) 70%); }
#parryFlash.on { animation: parryFlash .28s ease-out; }
@keyframes parryFlash { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Tablón de encargos ---------- */
.quest-card { width: min(900px, 100%); max-height: 100%; overflow: auto; padding: 16px 18px; border-radius: 16px; background: #1e1a12; border: 1px solid rgba(240, 190, 80, .25); box-shadow: 0 20px 60px rgba(0, 0, 0, .55); }
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-bottom: 14px; }
.q-card { position: relative; padding: 12px 12px 10px; border-radius: 6px; background: linear-gradient(#f3e7c6, #e2cf9e); color: #2e2210; box-shadow: 0 4px 10px rgba(0, 0, 0, .35); transform: rotate(-.6deg); }
.q-card:nth-child(2n) { transform: rotate(.7deg); }
.q-card.active { outline: 2px solid #c8962a; }
.q-card p { margin: 4px 0 6px; font-size: 12.5px; color: #5a4424 !important; }
.q-who { font-size: 12px; font-weight: 800; color: #7a2a1a; margin-bottom: 2px; }
.q-rw { font-size: 12.5px; font-weight: 800; margin: 4px 0 8px; }
.q-prog { height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .15); overflow: hidden; margin-top: 4px; }
.q-prog i { display: block; height: 100%; background: #3a8a3a; }
.q-card small { font-weight: 800; }
.q-btns { display: flex; gap: 6px; flex-wrap: wrap; }
#questHud { margin-top: 6px; padding-top: 5px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.6; }
#questHud.hidden { display: none; }
#graveHud { margin-top: 6px; padding-top: 5px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.6; color: #ffb4b4; }
#graveHud.hidden { display: none; }
#graveHud.urgent { color: #ff6a5a; animation: gravePulse 1s ease-in-out infinite; }
@keyframes gravePulse { 50% { opacity: .55; } }
