@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,700;0,800;1,700&display=swap');

:root {
  --paper: #f3ead8;
  --ink: #221f1a;
  --muted: #706858;
  --rust: #b94636;
  --line: rgba(54, 43, 29, .22);
  --page: min(1540px, calc(100% - 40px));
  --header-height: 67px;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  background:
    radial-gradient(circle at 5% 15%, rgba(185,70,54,.07), transparent 26rem),
    radial-gradient(circle at 90% 40%, rgba(65,93,78,.08), transparent 30rem),
    var(--paper);
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.language-pending { overflow: hidden; }
.language-gate {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 18% 15%, rgba(185,70,54,.14), transparent 34rem),
    radial-gradient(circle at 82% 80%, rgba(41,83,69,.15), transparent 32rem),
    rgba(243,234,216,.98);
}
.language-gate section {
  width: min(880px, 100%);
  padding: clamp(32px, 5vw, 68px);
  border: 1px solid rgba(54,43,29,.28);
  background: rgba(255,250,239,.88);
  box-shadow: 0 28px 80px rgba(64,45,25,.16);
}
.language-gate-eyebrow {
  color: var(--rust);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2em;
}
.language-gate h1 {
  margin: 10px 0 12px;
  font: 800 clamp(42px, 6vw, 76px)/.98 "Playfair Display", Georgia, serif;
}
.language-gate-copy {
  max-width: 650px;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.55;
}
.language-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%),1fr)); gap: 10px; }
.language-options button b { overflow-wrap: anywhere; }
.language-options button {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #f7efdf;
  cursor: pointer;
}
.language-options button.selected { border-color: #205646; box-shadow: inset 0 0 0 2px #205646; }
.language-options button:disabled { cursor: not-allowed; opacity: .48; }
.language-flag { width: 48px; height: 32px; flex-shrink: 0; border: 1px solid var(--line); box-shadow: 0 2px 5px rgba(54,43,29,.12); }
.language-options button small { font-size: 10px; letter-spacing: .04em; }
.language-options button i { height: 16px; }
.language-options button i { color: #205646; font-style: normal; font-weight: 900; }
.language-more { margin: 15px 0 24px; color: var(--muted); font-size: 12px; }
.language-confirm {
  width: 100%;
  min-height: 58px;
  border: 0;
  color: #fff7e9;
  background: #174b40;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  cursor: pointer;
}
.language-header-button {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 42px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.35);
  cursor: pointer;
}
.language-header-button > img { display: block; width: 34px; height: 24px; border-radius: 2px; }
.language-header-button:hover { border-color: var(--rust); background: rgba(255,255,255,.65); }
.language-header-button:focus-visible, .language-gate button:focus-visible { outline: 3px solid var(--rust); outline-offset: 3px; }
.language-cancel { display: block; margin: 14px auto 0; padding: 10px 25px; border: 1px solid var(--line); color: var(--ink); background: transparent; cursor: pointer; }

.hero.with-room-chat{grid-template-columns:minmax(230px,.85fr) minmax(300px,1fr) minmax(365px,1.05fr);gap:clamp(18px,2vw,36px);align-items:center}
.with-room-chat .hero-copy h1{font-size:clamp(55px,5.1vw,90px);line-height:.9}
.with-room-chat .intro{font-size:clamp(18px,1.5vw,24px);line-height:1.5}
.room-chat{min-width:0;height:clamp(390px,72vh,650px);display:flex;flex-direction:column;border:1px solid var(--line);background:#fffaef75;box-shadow:0 18px 55px #3f2f1c14}
.room-chat header{padding:22px;border-bottom:1px solid var(--line)}
.room-chat h2{margin:5px 0 10px;font:800 clamp(26px,2.6vw,40px)/1.05 'Playfair Display',Georgia,serif}
.room-chat header>p:last-child{margin:0;color:var(--muted);font-size:14px;line-height:1.5}
.room-chat-messages{flex:1;min-height:0;overflow-y:auto;padding:16px;overscroll-behavior:contain;scrollbar-gutter:stable}
.room-chat-message{display:grid;gap:6px;padding:13px;margin:0 0 10px;border-left:2px solid #a78e61;background:#fffaebbf;overflow-wrap:anywhere;font-size:15px;line-height:1.45}
.room-chat-message b{color:#205646;font-size:13px}
.room-chat form{display:grid;grid-template-columns:minmax(0,1fr) 50px;padding:13px;border-top:1px solid var(--line)}
.room-chat input{min-width:0;height:48px;padding:10px;border:1px solid var(--line);background:#fffaf0}
.room-chat form button{border:0;background:#205646;color:#fff4da;font-size:26px;cursor:pointer}
.kick-player{margin-left:auto;border:1px solid #a12f35;background:#a12f35;color:white;font-size:11px;padding:7px 9px;cursor:pointer}
@media(max-width:1100px){.hero.with-room-chat{grid-template-columns:minmax(0,1fr) minmax(330px,1fr)}.with-room-chat .hero-copy{grid-column:1/-1}.with-room-chat .hero-copy h1{font-size:58px;line-height:1}.with-room-chat .hero-copy h1 br{display:none}.with-room-chat .hero-copy .intro{margin-top:12px}.with-room-chat .hero-copy .intro br{display:none}.room-chat{height:570px}}
@media(max-width:760px){.hero.with-room-chat{grid-template-columns:1fr}.with-room-chat .hero-copy{grid-column:auto}.room-chat{height:420px}.with-room-chat .room-station{grid-row:2}}

@media (max-width: 760px) {
  .language-gate { padding: 12px; }
  .language-gate section { padding: 28px 20px; }
  .language-options { grid-template-columns: 1fr 1fr; }
  .language-options button { min-height: 95px; gap: 5px; padding: 8px; }
  .language-options button:last-child { grid-column: 1 / -1; flex-direction: row; gap: 14px; min-height: 64px; }
}
@media (max-height: 700px) {
  .language-gate { overflow-y: auto; align-items: start; }
  .language-gate section { padding: 20px; }
  .language-gate h1 { font-size: clamp(30px, 6vw, 54px); }
  .language-gate-copy { margin-bottom: 16px; }
  .language-options button { min-height: 84px; padding: 8px; gap: 4px; }
  .language-more { margin: 12px 0; }
}

.grain {
  position: fixed;
  z-index: 10;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitchTiles'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

/* La cabecera es parte de la arquitectura, no decoración de usar y tirar. */
.topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  width: 100%;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 13px max(20px, calc((100vw - 1540px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(243, 234, 216, .93);
  box-shadow: 0 8px 30px rgba(63,47,28,.04);
  backdrop-filter: blur(13px);
  transition: min-height .2s ease, padding .2s ease, box-shadow .2s ease;
}

.brand-cluster, .top-actions, .brand, .status, .guest-button { display: flex; align-items: center; }
.brand-cluster { min-width: 0; gap: 16px; }
.brand {
  flex: 0 0 auto;
  min-width: 184px;
  text-decoration: none;
  font: 800 clamp(20px, 1.8vw, 28px)/1 "Playfair Display", Georgia, serif;
}
.brand-compact { display: none; font-family: "DM Sans", sans-serif; font-size: 17px; letter-spacing: .12em; }
.header-compact .topbar { min-height: 53px; padding-top: 7px; padding-bottom: 7px; box-shadow: 0 10px 32px rgba(63,47,28,.13); }
.header-compact .brand { min-width: 42px; }
.header-compact .brand-full { display: none; }
.header-compact .brand-compact { display: inline; }

.top-actions { gap: 14px; flex: 0 0 auto; }
.status { gap: 8px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: #668e63; box-shadow: 0 0 0 4px rgba(102,142,99,.12); }
.guest-button {
  gap: 9px;
  min-width: 146px;
  padding: 6px 11px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--ink);
  background: rgba(255,255,255,.25);
  cursor: pointer;
  text-align: left;
  transition: .16s ease;
}
.guest-button:hover { border-color: var(--rust); background: rgba(255,255,255,.5); }
.profile-entry-link{display:block;margin:16px 0;padding:14px 18px;min-height:48px;color:#fff9eb;background:#204e43;border:1px solid #204e43;font-size:15px;font-weight:800;text-align:center;text-decoration:none;line-height:1.4;overflow-wrap:anywhere}.profile-entry-link:focus-visible{outline:3px solid #267a92;outline-offset:3px}.account-notice{position:fixed;z-index:200;bottom:16px;left:16px;right:16px;max-width:600px;margin:0;padding:18px;background:#fff9eb;border:2px solid #a94335;color:#302820;font-size:15px;line-height:1.5}
.guest-button small, .pass-preview small { display: block; color: var(--muted); font-size: 7px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.guest-button b { display: block; max-width: 120px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.guest-avatar { display: grid; flex: 0 0 auto; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: var(--paper); background: var(--rust); font-size: 10px; font-weight: 800; }
.guest-avatar.large { width: 54px; height: 54px; font-size: 16px; }
.back-room-link { padding: 8px 11px; border: 1px solid var(--line); text-decoration: none; font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.back-room-link:hover { border-color: var(--rust); color: var(--rust); }

main, footer { width: var(--page); margin-inline: auto; }
main { padding-top: var(--header-height); }
h1, h2, h3 { font-family: "Playfair Display", Georgia, serif; }
.kicker, .index { margin: 0; color: var(--rust); font-size: 10px; font-weight: 800; letter-spacing: .19em; text-transform: uppercase; }

/* Portada: una sola pantalla de preparación en escritorio. */
.home-main { min-height: calc(100dvh - 48px); }
.hero {
  min-height: calc(100dvh - var(--header-height) - 48px);
  display: grid;
  grid-template-columns: minmax(0, 660px) minmax(430px, 570px);
  align-items: center;
  justify-content: center;
  gap: clamp(34px, 5vw, 86px);
  padding: 18px 0;
}
.hero-copy { min-width: 0; padding-bottom: 1vh; }
.hero-copy .kicker { margin-bottom: 24px; }
.hero-copy h1 { margin: 0; font-size: clamp(64px, 7vw, 116px); line-height: .78; letter-spacing: -.065em; }
.hero-copy h1 em { color: var(--rust); font-weight: 700; }
.intro { max-width: 620px; margin: 29px 0 0; color: var(--muted); font: 700 clamp(18px, 1.8vw, 27px)/1.35 "Playfair Display", Georgia, serif; }

.room-station { min-width: 0; padding: 19px; border: 1px solid var(--line); background: rgba(255,255,255,.3); box-shadow: 0 18px 55px rgba(63,47,28,.08); }
.room-station-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.room-station-head .index { margin-bottom: 4px; }
.room-station-head h2 { margin: 0; font-size: clamp(29px, 2.7vw, 42px); line-height: .95; }
.dialog-copy { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
#roomSetup { padding-top: 12px; }
.room-choice { padding: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.18); }
.room-choice > span, .room-existing > span { color: var(--rust); font-size: 7px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.room-choice h3 { margin: 4px 0 5px; font-size: 19px; }
.room-choice p { margin: 0 0 10px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.room-choice button, .dialog-actions button {
  min-height: 39px;
  padding: 0 13px;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.room-choice button { width: 100%; }
.room-choice-divider { display: flex; align-items: center; gap: 9px; margin: 8px 0; color: var(--muted); font-size: 7px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.room-choice-divider::before, .room-choice-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.room-station label, .guest-dialog label { display: block; margin: 8px 0 5px; color: var(--rust); font-size: 7px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.room-station input, .guest-dialog input { width: 100%; padding: 9px 11px; border: 1px solid var(--line); color: var(--ink); background: rgba(255,255,255,.38); font-size: 12px; font-weight: 600; }
.room-station input:focus, .guest-dialog input:focus { outline: 2px solid rgba(185,70,54,.16); border-color: var(--rust); }
.save-pass { color: var(--paper); background: var(--ink); }
.remove-pass { color: var(--rust); background: rgba(185,70,54,.09); }
.remove-pass:disabled { color: #9a8f7e; background: #ded3c0; cursor: not-allowed; }
.room-error { min-height: 13px; margin: 5px 0 0; color: var(--rust); font-size: 8px; font-weight: 700; }

.room-existing { margin-top: 10px; padding: 12px; border: 1px dashed var(--line); background: rgba(255,255,255,.16); text-align: center; }
.room-existing > span { display: block; }
.room-existing > strong { display: block; margin: 3px 0; font: 800 34px/1 "Playfair Display", serif; letter-spacing: .12em; }
.room-code-heading{display:flex;align-items:center;justify-content:center;gap:clamp(12px,2vw,24px);flex-wrap:wrap;margin:4px 0 16px}
.room-code-heading span{color:var(--rust);font:800 clamp(18px,1.6vw,24px)/1.15 'Playfair Display',Georgia,serif;max-width:10ch;text-align:left}
.room-code-heading strong{font:800 clamp(30px,3vw,44px)/1 'Playfair Display',Georgia,serif;letter-spacing:.1em;overflow-wrap:anywhere}
.room-existing > p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.room-occupants { max-height: 150px; display: grid; gap: 5px; margin: 9px 0 7px; overflow: auto; text-align: left; }
.room-occupant { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border: 1px solid rgba(157,136,99,.45); background: rgba(255,255,255,.28); }
.room-occupant span, .room-occupant img { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; color: var(--paper); background: var(--ink); object-fit: contain; font-size: 9px; font-weight: 800; }
.room-occupant img { padding: 2px; background: #e6d5b4; }
.room-occupant b { min-width: 0; flex: 1; font-size: 10px; }
.room-occupant.is-companion { border-color: rgba(185,70,54,.55); background: rgba(185,70,54,.07); }
.remove-local-player { flex: 0 0 auto; padding: 5px 7px; border: 1px solid var(--line); color: var(--rust); background: transparent; cursor: pointer; font-size: 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.local-player-form { margin: 7px 0 8px; padding-top: 8px; border-top: 1px dashed var(--line); text-align: left; }
.local-player-form label { margin: 0 0 5px; }
.local-player-form > div { display: grid; grid-template-columns: 1fr auto; gap: 5px; }
.local-player-form button { min-width: 78px; border: 0; color: var(--paper); background: var(--ink); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.local-player-form button:disabled { color: #8f8575; background: #d7ccba; }
.local-player-form small { display: block; margin-top: 4px; color: var(--muted); font-size: 7px; line-height: 1.3; }
.companion-toggle, .continue-games { min-height: 39px; border: 0; border-radius: 2px; cursor: pointer; font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.companion-toggle { width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--rust); background: rgba(185,70,54,.09); }
.companion-toggle img { width: 28px; height: 28px; object-fit: contain; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 8px; }
.room-actions { justify-content: stretch; }
.room-actions button { flex: 1; }
.continue-games { color: var(--paper); background: var(--rust); }

/* Catálogo independiente. */
.catalogue-main { min-height: calc(100dvh - 48px); }
.catalogue-stage {
  min-height: calc(100dvh - var(--header-height) - 48px);
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  align-items: stretch;
  gap: 18px;
  padding: 28px 0 38px;
}
.catalogue { min-width: 0; display: contents; }
.section-head { min-width: 0; flex: 0 0 100%; margin: 0; }
.section-head .index { margin-bottom: 7px; }
.section-head h1 { min-width: 0; width: 100%; margin: 0; font-size: clamp(20px, 1.65vw, 28px); line-height: 1.2; letter-spacing: -.025em; }
.games { min-width: 0; flex: 1 1 620px; min-height: clamp(360px, calc(100dvh - 225px), 720px); display: grid; grid-auto-flow: column; grid-auto-columns: max(min(100%, 320px), calc((100% - 14px) / 2)); gap: 14px; padding: 0 0 12px; overflow-x: auto; overscroll-behavior-x:contain; scrollbar-color: var(--rust) rgba(54,43,29,.11); }
.games::-webkit-scrollbar { height: 11px; }
.games::-webkit-scrollbar-track { border-radius: 99px; background: rgba(54,43,29,.11); }
.games::-webkit-scrollbar-thumb { border: 2px solid var(--paper); border-radius: 99px; background: var(--rust); }
.game-card { min-width: 0; display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(80px, 1fr) auto; border: 1px solid var(--line); border-radius: 3px; background: rgba(255,255,255,.2); box-shadow: 0 18px 50px rgba(63,47,28,.07); }
.card-art { position: relative; min-height: 0; overflow: hidden; }
.game-cover { position:absolute; inset:0; width: 100%; height: 100%; display: block; object-fit: cover; }
.uranos-card .game-cover { object-position: 52% 54%; }
.chachi-card .game-cover { object-position: 58% 12%; }
.stamp { position: absolute; right: 13px; bottom: 13px; padding: 7px 10px; border: 3px solid rgba(243,234,216,.72); color: rgba(243,234,216,.85); background: rgba(185,70,54,.68); transform: rotate(-8deg); font-size: 9px; font-weight: 800; line-height: 1; letter-spacing: .12em; text-align: center; }
.card-copy { min-width: 0; display: flex; flex-direction: column; padding: clamp(14px, 1.1vw, 20px); overflow-wrap:anywhere; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.available { padding: 5px 8px; border-radius: 2px; color: #254431; background: rgba(75,122,88,.14); }
.card-copy h2 { margin: 9px 0 8px; font-size: clamp(26px, 2.2vw, 38px); line-height: 1; letter-spacing: -.045em; }
.card-copy > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.card-copy ul { display: flex; flex-wrap: wrap; gap: 5px; margin: 9px 0; padding: 0; list-style: none; }
.card-copy li { padding: 5px 7px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.card-action { flex-shrink:0; width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap:12px; margin-top: auto; padding: 12px 15px; border-radius: 2px; color: #fff7e8; background: var(--ink); text-decoration: none; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; transition: .18s ease; }
.card-action:hover { background: var(--rust); }
.card-action span { font-size: 18px; }
.card-action.busy { opacity: .5; pointer-events: none; }
.card-action.disabled { opacity: .42; pointer-events: none; }

.catalogue-chat { position: relative; top: auto; min-width: min(100%, 280px); flex:1 1 300px; max-width:370px; height:clamp(360px, calc(100dvh - 225px), 720px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); background: rgba(238,224,198,.78); box-shadow: 0 18px 50px rgba(63,47,28,.07); }
.catalogue-chat-head { padding: 20px 20px 15px; border-bottom: 1px solid var(--line); }
.catalogue-chat-head .index { margin: 0 0 6px; }
.catalogue-chat-head h2 { margin: 0; font: 800 31px/.95 "Playfair Display", Georgia, serif; }
.catalogue-chat-head > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.catalogue-chat-messages { min-height: 0; max-height: 100%; flex: 1 1 0; display: flex; flex-direction: column; gap: 7px; padding: 13px; overflow-y: scroll; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--rust) rgba(54,43,29,.1); }
.catalogue-chat-messages::-webkit-scrollbar { width: 9px; }.catalogue-chat-messages::-webkit-scrollbar-track { background: rgba(54,43,29,.1); }.catalogue-chat-messages::-webkit-scrollbar-thumb { border: 2px solid #e2d2b4; border-radius: 8px; background: var(--rust); }
.language-more{text-align:center!important}
.catalogue-chat-message { display: grid; grid-template-columns: 28px 1fr; gap: 8px; margin: 0; padding: 9px; border-left: 3px solid #806c4d; background: rgba(255,249,235,.75); color: #574939; font-size: 10px; line-height: 1.4; }
.catalogue-chat-message > i { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: #294d42; color: #fff1d5; font-style: normal; font-size: 9px; font-weight: 800; }
.catalogue-chat-message b { display: block; margin-bottom: 2px; color: var(--rust); font-size: 8px; letter-spacing: .05em; }
.catalogue-chat-empty { margin: auto; color: var(--muted); font-size: 10px; text-align: center; }
.catalogue-chat-form { display: grid; grid-template-columns: 1fr 46px; padding: 12px; border-top: 1px solid var(--line); }
.catalogue-chat-form input { min-width: 0; padding: 12px; border: 1px solid var(--line); background: #fff9ed; outline: none; font-size: 11px; }
.catalogue-chat-form input:focus { border-color: var(--rust); }
.catalogue-chat-form button { border: 0; color: #fff5df; background: #254c40; font-size: 20px; cursor: pointer; }
.catalogue-chat-form button:disabled { opacity: .45; cursor: wait; }

footer { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 11px 0 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; }
footer > span { color: var(--ink); font-family: "Playfair Display", serif; font-weight: 800; }
footer p { max-width: 620px; margin: 0; text-align: right; }

.guest-dialog { width: min(520px, calc(100% - 24px)); padding: 0; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: var(--paper); box-shadow: 0 30px 90px rgba(38,28,18,.32); }
.guest-dialog::backdrop { background: rgba(34,31,26,.6); backdrop-filter: blur(4px); }
.guest-dialog form { padding: 28px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-head .index { margin-bottom: 5px; }
.dialog-head h2 { margin: 0; font-size: 36px; }
.close-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: transparent; cursor: pointer; font-size: 22px; }
.guest-dialog .dialog-copy { margin: 18px 0 22px; font-size: 12px; line-height: 1.6; }
.guest-dialog #guestDialogCopy { white-space: pre-line; }
.guest-login-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; margin: -4px 0 22px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.guest-login-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 18px; border: 1px solid var(--line); color: #204e43; background: rgba(255,255,255,.3); font-weight: 800; text-decoration: none; }
.guest-login-button:hover { border-color: #204e43; }
.guest-login-button:focus-visible { outline: 3px solid #267a92; outline-offset: 3px; }
.guest-dialog label { margin: 0 0 7px; font-size: 9px; }
.guest-dialog input { padding: 13px 14px; font-size: 14px; }
.pass-preview { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 15px; border: 1px dashed var(--line); background: rgba(255,255,255,.14); }
.pass-preview strong, .pass-preview code { display: block; }
.pass-preview strong { margin: 2px 0; font: 700 20px "Playfair Display", serif; }
.pass-preview code { color: var(--muted); font-size: 9px; letter-spacing: .1em; }
.guest-dialog .dialog-actions { margin-top: 20px; }
.guest-dialog .dialog-actions button { min-height: 44px; }
html.guest-pending .topbar, html.guest-pending main, html.guest-pending footer { visibility: hidden; }
html.guest-pending .guest-dialog::backdrop { background: var(--paper); backdrop-filter: none; }
html.guest-pending .guest-dialog { box-shadow: none; }

.selection-error { position: fixed; z-index: 70; right: 22px; bottom: 22px; max-width: min(420px, calc(100% - 44px)); margin: 0; padding: 14px 18px; border-left: 4px solid var(--rust); color: var(--ink); background: var(--paper); box-shadow: 0 12px 40px rgba(38,28,18,.25); font-size: 11px; font-weight: 700; line-height: 1.45; }

@media (min-width: 981px) and (max-height: 760px) {
  .hero { padding-top: 10px; padding-bottom: 10px; }
  .hero-copy h1 { font-size: clamp(60px, 6.2vw, 88px); }
  .hero-copy .kicker { margin-bottom: 17px; }
  .intro { margin-top: 22px; font-size: clamp(17px, 1.55vw, 22px); }
  .room-station { padding: 15px; }
  .room-station-head { padding-bottom: 9px; }
  .room-station-head h2 { font-size: 30px; }
  .room-existing { margin-top: 8px; padding: 9px; }
  .room-occupants { max-height: 128px; }
}

@media (max-width: 980px) {
  :root { --page: min(100% - 28px, 760px); }
  .status { display: none; }
  .hero { min-height: 0; grid-template-columns: 1fr; gap: 28px; padding: 42px 0; }
  .hero-copy { padding: 0; }
  .hero-copy h1 { font-size: clamp(62px, 14vw, 106px); }
  .room-station { width: 100%; }
  .section-head h1 { font-size: clamp(25px, 5vw, 42px); line-height: .98; white-space: normal; }
  .catalogue-stage { min-height: 0; padding: 24px 0; }
  .section-head { margin-bottom: 22px; }
  .games { min-height:0; grid-auto-columns: min(88%, 520px); }
  .game-card { grid-template-rows: auto auto; }
  .card-art { min-height:0; height:auto; aspect-ratio:16/9; }
  .catalogue-chat { max-width:none; height:430px; }
}

@media (max-width: 620px) {
  :root { --page: calc(100% - 24px); --header-height: 61px; }
  .topbar { gap: 10px; padding-inline: 12px; }
  .brand { min-width: 0; font-size: 19px; }
  .brand-cluster { gap: 8px; }
  .top-actions { gap: 8px; }
  .status { display: none; }
  .catalogue-page .brand-full { display: none; }
  .catalogue-page .brand-compact { display: inline; }
  .language-header-button { flex-basis: 44px; width: 44px; }
  .back-room-link { padding: 7px 8px; font-size: 7px; }
  .guest-button { min-width: 0; padding-right: 6px; }
  .guest-button > span:last-child { display: none; }
  .hero { gap: 23px; padding: 30px 0; }
  .hero-copy h1 { font-size: clamp(52px, 17vw, 82px); }
  .hero-copy .kicker { margin-bottom: 18px; }
  .intro { margin-top: 23px; font-size: 18px; }
  .room-station { padding: 15px; }
  .room-existing > strong { font-size: 30px; }
  .room-actions { flex-direction: column; }
  .games { grid-auto-columns: 94%; }
  .game-card { grid-template-columns: 1fr; }
  .card-copy h2 { font-size: 34px; }
  footer { align-items: flex-start; flex-direction: column; gap: 7px; }
  footer p { text-align: left; }
}

@media (max-width: 410px) {
  .brand-full { display: none; }
  .brand-compact { display: inline; }
  .brand { min-width: 38px; }
  .back-room-link { max-width: 90px; text-align: center; }
}

/* Auditoría v45: las pantallas iniciales también aprovechan el lienzo completo. */
@media (min-width: 981px) {
  .guest-dialog {
    width: min(760px, calc(100vw - 52px));
    border-width: 2px;
  }
  .guest-dialog form { padding: clamp(38px, 3.2vw, 58px); }
  .guest-dialog .dialog-head .index { font-size: clamp(10px, .72vw, 13px); }
  .guest-dialog .dialog-head h2 { font-size: clamp(48px, 4vw, 64px); line-height: .96; }
  .guest-dialog .dialog-copy {
    max-width: 620px;
    margin: 24px 0 28px;
    font-size: clamp(15px, 1vw, 18px);
    line-height: 1.6;
  }
  .guest-dialog label { margin-bottom: 9px; font-size: 11px; }
  .guest-dialog input { min-height: 58px; padding: 15px 17px; font-size: 18px; }
  .pass-preview { gap: 18px; margin-top: 20px; padding: 19px; }
  .pass-preview .guest-avatar.large { width: 64px; height: 64px; font-size: 18px; }
  .pass-preview small { font-size: 9px; }
  .pass-preview strong { font-size: 26px; }
  .pass-preview code { font-size: 11px; }
  .guest-dialog .dialog-actions { margin-top: 26px; }
  .guest-dialog .dialog-actions button { min-height: 56px; padding-inline: 24px; font-size: 12px; }

  .room-station { padding: clamp(22px, 2vw, 30px); }
  .room-station-head h2 { font-size: clamp(36px, 3vw, 48px); }
  .room-station .dialog-copy { font-size: 14px; line-height: 1.55; }
  .room-station label { font-size: 9px; }
  .room-station input { min-height: 48px; font-size: 15px; }
  .room-station button { min-height: 48px; font-size: 11px; }
  .room-choice h3 { font-size: 19px; }
  .room-choice p,
  .room-existing p { font-size: 12px; line-height: 1.5; }
}

@media (min-width: 1500px) and (min-height: 900px) {
  .guest-dialog { width: min(900px, calc(100vw - 72px)); }
  .guest-dialog form { padding: 62px; }
  .guest-dialog .dialog-head h2 { font-size: 70px; }
  .guest-dialog .dialog-copy { max-width: 720px; font-size: 19px; }
  .guest-dialog input { min-height: 66px; font-size: 20px; }
  .pass-preview { padding: 22px; }
  .pass-preview .guest-avatar.large { width: 74px; height: 74px; }
  .pass-preview strong { font-size: 30px; }
  .guest-dialog .dialog-actions button { min-height: 62px; font-size: 13px; }
}

@media (min-width: 981px) and (max-height: 760px) {
  .guest-dialog { width: min(690px, calc(100vw - 38px)); }
  .guest-dialog form { padding: 30px 36px; }
  .guest-dialog .dialog-head h2 { font-size: 45px; }
  .guest-dialog .dialog-copy { margin: 17px 0 19px; font-size: 14px; }
  .guest-dialog input { min-height: 50px; padding-block: 11px; font-size: 16px; }
  .pass-preview { margin-top: 13px; padding: 13px 16px; }
  .pass-preview .guest-avatar.large { width: 54px; height: 54px; }
  .pass-preview strong { font-size: 23px; }
  .guest-dialog .dialog-actions { margin-top: 15px; }
  .guest-dialog .dialog-actions button { min-height: 48px; }
}

@media (max-width: 620px) {
  .guest-dialog form { padding: 24px 20px; }
  .dialog-head h2 { font-size: clamp(31px, 10vw, 42px); }
  .guest-dialog .dialog-copy { margin: 15px 0 18px; font-size: 13px; }
  .guest-dialog input { min-height: 50px; font-size: 16px; }
  .pass-preview { padding: 12px; }
  .pass-preview strong { font-size: 19px; }
}
