/* Shared by the seven themes (built from their tokens): header logo, day notices, side panels
   (profile and activity), today's classics, footer links and the legal pages. */

/* ---------- header logo ---------- */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.brand .wordmark { white-space: nowrap; }
.brand-hit {
  display: grid; place-items: center; width: 56px; height: 56px; margin: 0; padding: 0; flex: none;
  background: none; border: 0; border-radius: 50%; box-shadow: none; cursor: pointer; touch-action: manipulation;
}
.brand-hit:focus-visible, .brand:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 2px; }
.brand-logo { display: block; width: 52px; height: 52px; object-fit: contain; transform-origin: 20% 12%; }
a.brand .brand-logo { width: 44px; height: 44px; }
/* Hit 2: hanging from one screw. Falling: the slot keeps its space while a copy falls. Fallen: gone. */
html[data-logo="loose"] [data-logo-slot] .brand-logo, html[data-logo="loose"] img[data-logo-slot] { transform: rotate(14deg); }
html[data-logo="falling"] [data-logo-slot] { visibility: hidden; }
html[data-logo="fallen"] [data-logo-slot] { display: none; }
.logo-falling { position: fixed; z-index: 1000; margin: 0; object-fit: contain; pointer-events: none; transform-origin: 20% 12%; will-change: transform; }

/* ---------- day notices ---------- */
.day-banner {
  width: min(1240px, calc(100% - 32px)); margin: 12px auto 0; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline;
  border: 1px solid var(--line-on-bg); border-radius: var(--radius); color: var(--on-bg); font-size: 15px; line-height: 1.45;
  background: color-mix(in srgb, var(--on-bg) 6%, transparent);
}
.day-banner a { color: inherit; font-weight: 700; }
.day-toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 900; transform: translateX(-50%); max-width: calc(100% - 32px); margin: 0;
  padding: 12px 18px; border-radius: var(--radius); background: var(--dark); color: var(--on-dark); box-shadow: var(--shadow); font-weight: 700;
}

/* ---------- side panels ---------- */
.rails { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "profile" "main" "activity"; }
.rails > main { grid-area: main; min-width: 0; }
.rail-profile { grid-area: profile; }
.rail-activity { grid-area: activity; }
.rail { width: min(1240px, calc(100% - 32px)); margin: 16px auto 0; min-width: 0; }
.rail:empty { display: none; }
.rail-card { background: var(--surface); color: var(--on-surface); border: var(--panel-border); border-radius: var(--radius-card); padding: 16px; box-shadow: var(--panel-frame), var(--shadow); }
.rail-card + .rail-card { margin-top: 14px; }
.rail-card h2, .rail-card h3 { margin: 0 0 8px; font-size: 19px; color: var(--on-surface); }
.rail-card h3 { font-size: 15px; margin-top: 14px; }
.rail-card p { margin: 0 0 8px; }
.rail-card a:not(.btn) { color: var(--surface-accent); font-weight: 700; }
.rail-card .btn { min-height: 44px; }
.rail details > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 800; }
.rail-who { display: flex; align-items: center; gap: 10px; }
.rail-who strong { font-size: 18px; overflow-wrap: anywhere; }
.rail-bio { color: var(--on-surface-muted); font-size: 14px; overflow-wrap: anywhere; }
.rail-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 8px 0; padding: 0; list-style: none; }
.rail-stats li { padding: 8px; border-radius: var(--radius-sm); background: var(--surface-2, color-mix(in srgb, var(--on-surface) 6%, transparent)); font-size: 13px; }
.rail-stats strong { display: block; font-size: 20px; }
.rail-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }
.rail-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.rail-list .btn { min-height: 36px; padding: 4px 10px; font-size: 13px; }
.rail-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 14px; }
.rail-links a { display: inline-flex; align-items: center; min-height: 44px; }
.rail-muted { color: var(--on-surface-muted); font-size: 14px; }
.feed { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.feed li { padding-bottom: 10px; border-bottom: 1px solid var(--surface-line); font-size: 14px; line-height: 1.4; }
.feed li:last-child { border-bottom: 0; padding-bottom: 0; }
.feed time, .feed .feed-meta { display: block; color: var(--on-surface-muted); font-size: 12px; }
.feed .feed-tag { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.rank { margin: 0; padding-left: 1.4em; font-size: 14px; display: grid; gap: 2px; }
/* Columns only when the centre keeps at least ~950 px: the themes size the hero with the viewport. */
@media (min-width: 1600px) {
  .rails { grid-template-columns: 270px minmax(0, 1fr) 300px; grid-template-areas: "profile main activity"; gap: 24px; width: min(1900px, 100%); margin: 0 auto; padding: 0 16px; }
  .rail { width: auto; margin: 22px 0 0; position: sticky; top: 12px; align-self: start; max-height: calc(100vh - 24px); overflow: auto; overscroll-behavior: contain; }
  .rail:empty { display: block; }
  /* A game in progress gets the whole width. */
  html[data-playing] .rails { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main"; }
  html[data-playing] .rail { display: none; }
}
@media (max-width: 1599px) {
  html[data-playing] .rail-profile { display: none; }
}

/* ---------- today's classics ---------- */
.daily-strip .today-head { display: grid; gap: 6px; }
.daily-strip .today-head h2 { margin: 0; }
/* "Estilo de hoy: …" / "Disponibles hoy · …": one quiet tag next to a section heading. */
.section-tag { justify-self: start; margin: 6px 0 0; padding: 3px 10px; border: 1px solid var(--line-on-bg); border-radius: var(--radius-sm); color: var(--on-bg); font-size: 14px; font-weight: 700; }
.today-note { margin: 0; color: var(--on-bg-muted); font-size: 15px; }
.today-grid { margin-top: 14px; }
.classic-card .card-badge { display: inline-block; margin: 0 0 6px; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--surface-3, transparent); color: var(--surface-accent); font-size: 12px; font-weight: 800; }
.not-today { display: grid; gap: 12px; justify-items: start; }
.not-today h1 { margin: 0; color: var(--on-surface); font-size: clamp(28px, 4.4vw, 42px); }

/* ---------- footer: style preview ("Probar estilos") ---------- */
.style-preview { width: 100%; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-on-bg); display: grid; gap: 10px; justify-items: center; }
.style-preview h2 { margin: 0; font: var(--label-font); letter-spacing: var(--label-tracking); text-transform: uppercase; color: var(--on-bg); }
.style-note { margin: 0; max-width: 62ch; font-size: 14px; color: var(--on-bg-muted); }
.theme-options { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 980px; margin: 0; padding: 0; list-style: none; }
.theme-option {
  display: grid; justify-items: center; gap: 6px; width: 100%; min-height: 64px; margin: 0; padding: 8px 6px; cursor: pointer;
  border-radius: 6px; border: 1px solid var(--line-on-bg); background: color-mix(in srgb, var(--on-bg) 6%, transparent);
  color: var(--on-bg); font: 600 13px/1.2 var(--text); box-shadow: none; text-transform: none; letter-spacing: 0;
}
.theme-option:hover { background: color-mix(in srgb, var(--on-bg) 14%, transparent); }
.theme-option:focus-visible, .style-back:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 2px; }
.theme-option[aria-pressed="true"] { border: 2px solid var(--on-bg); background: color-mix(in srgb, var(--on-bg) 18%, transparent); font-weight: 800; }
.theme-option[aria-pressed="true"] .theme-name::before { content: "✓ "; }
.theme-swatch { display: flex; width: 56px; height: 16px; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(127, 127, 127, 0.6); }
.theme-swatch span { flex: 1; }
.theme-status { min-height: 1.5em; margin: 0; font-size: 14px; font-weight: 700; color: var(--on-bg); }
@media (max-width: 1000px) { .theme-options { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) { .theme-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- footer ---------- */
.footer-legal-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 18px; font-size: 14px; }
.footer-legal-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--on-bg); }

/* ---------- legal pages ---------- */
.legal-shell { width: min(820px, calc(100% - 32px)); }
.legal-shell article { line-height: 1.6; }
.legal-shell h1 { margin-top: 0; }
.legal-shell h2 { margin: 26px 0 8px; font-size: 22px; }
.legal-shell table { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.legal-shell th, .legal-shell td { padding: 8px; border: 1px solid var(--surface-line); text-align: left; vertical-align: top; }
.draft-note { padding: 12px 14px; border-left: 5px solid var(--accent); background: var(--surface-3, transparent); font-weight: 600; }
.pending-data { background: color-mix(in srgb, var(--accent) 18%, transparent); padding: 0 4px; border-radius: 3px; font-weight: 700; }

@media (max-width: 640px) {
  .brand-logo { width: 44px; height: 44px; }
  .brand-hit { width: 48px; height: 48px; }
  a.brand .brand-logo { width: 38px; height: 38px; }
  .brand { gap: 6px; }
  .day-banner, .rail { width: calc(100% - 24px); }
}
.rail details > summary { list-style: none; }
.rail details > summary::-webkit-details-marker { display: none; }
.rail details > summary::after { content: "▾"; margin-left: auto; font-size: 18px; transition: transform 0.15s; }
.rail details[open] > summary::after { transform: rotate(180deg); }

/* ---------- rooms ---------- */
body[data-in-room] .table-head { display: none; } /* Inside a room the room is the headline. */
.waiting-for { font-weight: 700; }
@media (max-width: 760px) {
  #party[data-status="playing"] { display: flex; flex-direction: column; }
  #party[data-status="playing"] > .game-room-heading { order: 2; margin-top: 16px; }
}
