/* Minitenis · estilos del juego */
:root {
  --bg: #ece8de; --ink: #1d2433; --muted: #6b6f78; --panel: #fbf9f4; --line: #d8d2c4; --soft: #f1ede4;
  --board: #121a2b; --board-ink: #f3f1ea; --lime: #d9ec4b; --accent: #1d2433;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151a22; --ink: #eef0f3; --muted: #9aa1ad; --panel: #1f2631; --line: #36404f; --soft: #262e3a;
    --board: #0b1019; --accent: #d9ec4b; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151a22; --ink: #eef0f3; --muted: #9aa1ad; --panel: #1f2631; --line: #36404f; --soft: #262e3a;
  --board: #0b1019; --accent: #d9ec4b; color-scheme: dark;
}
html { height: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); }
/* Juego, no documento: nada se selecciona ni abre menús al mantener el dedo, y la página no rebota */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
input, select, textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
*, *::before, *::after { box-sizing: inherit; }
body {
  margin: 0; height: 100%; height: 100dvh; overflow: hidden; touch-action: manipulation;
  background: var(--bg); color: var(--ink);
  font-family: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex; flex-direction: column; align-items: center;
}
.score {
  width: calc(100% - 24px); max-width: 400px; margin: 10px 12px 6px;
  background: var(--board); color: var(--board-ink);
  border-radius: 10px; padding: 6px 10px; font-variant-numeric: tabular-nums;
}
.row { display: flex; align-items: center; gap: 8px; height: 26px; font-size: 0.95rem; }
.row .srv { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.row .flag { width: 18px; height: 12px; flex: none; border-radius: 2px; }
.row.serving .srv { background: var(--lime); }
.row .cc { font-size: 0.72rem; opacity: 0.6; width: 26px; flex: none; }
.row .nm { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sets { display: flex; }
.row .sta { width: 30px; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.18); overflow: hidden; flex: none; }
.row .sta i { display: block; height: 100%; width: 100%; background: #7be08a; border-radius: 3px; transition: width 0.2s; }
.row .sta i.low { background: #ff7a59; }
.row .st { width: 18px; text-align: center; opacity: 0.6; }
.row .st.cur { opacity: 1; font-weight: 700; }
.row .pt { min-width: 34px; text-align: center; background: var(--lime); color: #121a2b; border-radius: 5px; font-weight: 800; }
.score .meta { display: flex; gap: 12px; font-size: 0.75rem; padding-top: 2px; }
.score .meta span { opacity: 0.65; }
.score .meta #metaL { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.score .meta [role="button"] { cursor: pointer; opacity: 0.85; text-decoration: underline; text-underline-offset: 2px; }

.stage { flex: 1; min-height: 0; width: 100%; display: flex; justify-content: center; align-items: center; padding: 0 10px; }
.frame { position: relative; }
canvas#c { display: block; width: 100%; height: 100%; border-radius: 14px; touch-action: none; }
canvas#c:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(18, 26, 43, 0.5); border-radius: 14px; padding: 12px;
}
.overlay[hidden] { display: none; }
.card {
  background: var(--panel); color: var(--ink); border-radius: 14px; padding: 18px 16px;
  width: 100%; max-width: 330px; max-height: 100%; overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.card h2 { margin: 0 0 4px; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.card h3 { margin: 14px 0 6px; font-size: 1rem; font-weight: 800; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 0.9rem; line-height: 1.4; }
.lbl { display: block; font-size: 0.85rem; font-weight: 700; margin: 10px 0 5px; }
.seg { display: flex; border: 1.5px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { flex: 1; font: inherit; font-size: 0.88rem; padding: 7px 4px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.seg button + button { border-left: 1.5px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); font-weight: 700; }
.primary {
  width: 100%; font: inherit; font-weight: 800; font-size: 1.05rem; padding: 11px; margin-top: 12px;
  border: 0; border-radius: 10px; background: var(--lime); color: #121a2b; cursor: pointer;
}
.secondary {
  width: 100%; font: inherit; font-size: 0.95rem; padding: 9px; margin-top: 8px;
  border: 1.5px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer;
}
button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.surfs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.surfs button, .roster button, .tours button {
  font: inherit; cursor: pointer; border: 1.5px solid var(--line); border-radius: 9px; background: transparent; color: var(--ink);
}
.surfs button { font-size: 0.78rem; line-height: 1.15; padding: 6px 4px 5px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.surfs button[aria-pressed="true"], .roster button[aria-pressed="true"], .tours button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.sw { width: 34px; height: 22px; border-radius: 4px; display: flex; align-items: center; justify-content: center; flex: none; }
.sw i { width: 22px; height: 12px; border: 1.5px solid rgba(255,255,255,0.9); display: block; }

.roster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.roster button > span { min-width: 0; overflow-wrap: anywhere; }
.roster button { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 2px; text-align: left; }
.roster button:disabled { opacity: 0.35; cursor: not-allowed; }
.roster canvas { width: 40px; height: 52px; flex: none; }
.roster b { display: block; font-size: 0.86rem; line-height: 1.1; }
.roster small { display: block; font-size: 0.72rem; color: var(--muted); }

.detail { margin-top: 10px; background: var(--soft); border-radius: 10px; padding: 10px 12px; }
.detail .who { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 8px; }
.detail .who b { font-size: 1.05rem; }
.detail .who span { font-size: 0.78rem; color: var(--muted); }
.bar { display: grid; grid-template-columns: 70px 1fr 24px; align-items: center; gap: 8px; font-size: 0.8rem; margin-top: 5px; }
.bar i { height: 7px; border-radius: 4px; background: var(--line); position: relative; overflow: hidden; }
.bar i::after { content: ""; position: absolute; inset: 0; width: var(--v); background: var(--ink); border-radius: 4px; }
.bar b { text-align: right; font-variant-numeric: tabular-nums; }
.fav { font-size: 0.8rem; margin-top: 7px; color: var(--muted); }

.tours { display: grid; gap: 6px; }
.tours button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; text-align: left; }
.tours b { display: block; font-size: 0.92rem; }
.tours small { display: block; font-size: 0.75rem; color: var(--muted); }
.tours .cup { margin-left: auto; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }

.round { margin-top: 10px; }
.round h3 { margin: 0 0 4px; font-size: 0.85rem; color: var(--muted); font-weight: 700; }
.m { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; font-size: 0.84rem; padding: 5px 8px; border-radius: 7px; background: var(--soft); margin-bottom: 4px; }
.m.me { box-shadow: inset 0 0 0 1.5px var(--ink); }
.m span:last-of-type { text-align: right; }
.m .w { font-weight: 800; }
.m .l { opacity: 0.5; text-decoration: line-through; }
.m small { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 0.74rem; margin-top: -2px; }
.m em { font-style: normal; color: var(--muted); font-size: 0.75rem; }

.tierhead { margin: 12px 0 6px; }
.tierhead:first-of-type { margin-top: 4px; }
.tier { display: inline-block; font-size: 0.75rem; font-weight: 800; padding: 2px 9px; border-radius: 20px; }
.tier.t-leyenda { background: linear-gradient(90deg, #2b1d4a, #5b3d99); color: #f4d35e; }
.tier.t-oro { background: #e9c64a; color: #3a2a00; }
.tier.t-plata { background: #cfd4da; color: #2a2f36; }
.roster button.t-leyenda { border-color: #b69a3a; }
.roster button.new { justify-content: center; font-weight: 700; min-height: 60px; border-style: dashed; text-align: center; padding: 6px; }
.ctop { display: flex; gap: 12px; align-items: flex-start; }
.ctop canvas { width: 64px; height: 84px; background: var(--soft); border-radius: 10px; flex: none; }
.ctop .f { flex: 1; min-width: 0; }
.ctop input { width: 100%; font: inherit; padding: 7px 9px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); margin-bottom: 6px; }
.ccsel { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.ccsel canvas { width: 27px; height: 18px; flex: none; border-radius: 2px; }
.ccsel select { flex: 1; min-width: 0; font: inherit; font-size: 0.85rem; padding: 6px 6px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); }
.ctop input:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.sws { display: flex; flex-wrap: wrap; gap: 7px; }
.sws button { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,0.2); cursor: pointer; padding: 0; }
.sws button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ink); }
.hs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.hs button { font: inherit; font-size: 0.78rem; padding: 6px 2px; border: 1.5px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; }
.hs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); font-weight: 700; }
.stat { display: grid; grid-template-columns: 72px 30px 1fr 30px; gap: 8px; align-items: center; font-size: 0.85rem; margin-top: 6px; }
.stat button { font: inherit; font-weight: 800; height: 30px; border-radius: 8px; border: 1.5px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.stat button:disabled { opacity: 0.3; cursor: not-allowed; }
.stat b { text-align: center; font-variant-numeric: tabular-nums; }
.budget { font-size: 0.82rem; margin-top: 6px; color: var(--muted); }
.pad { width: 100%; max-width: 420px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px 12px; touch-action: none; user-select: none; -webkit-user-select: none; }
/* Zona del joystick: mucho más grande que el joystick, para que el dedo no "se salga" */
.stickzone { position: relative; flex: 1 1 auto; align-self: stretch; min-height: 136px; touch-action: none; }
body.mov-dpad .stickzone { display: none; }
.stick { width: 132px; height: 132px; border-radius: 50%; background: var(--soft); border: 1.5px solid var(--line); position: absolute; left: var(--sx, 50%); top: var(--sy, 50%);
  transform: translate(-50%, -50%); touch-action: none; pointer-events: none; transition: opacity 0.2s; }
.stickzone.float .stick { --sx: 72px; opacity: 0.55; }
.stickzone.float .stick.on { opacity: 1; }
.stick::after { content: ""; position: absolute; inset: 30%; border-radius: 50%; border: 1.5px dashed var(--line); }
.knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: var(--ink); opacity: 0.85; z-index: 1; transition: transform 0.08s; }
.stick.on .knob { transition: none; }
.btns { display: grid; grid-template-columns: repeat(2, 76px); gap: 8px; }
.btns button {
  height: 52px; border-radius: 14px; border: 0; font: inherit; font-weight: 800; font-size: 0.88rem; color: #121a2b; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; touch-action: none;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.18);
}
.btns button small { font-weight: 600; font-size: 0.68rem; opacity: 0.65; }
.btns button.armed { outline: 3px solid var(--ink); outline-offset: 2px; }
.btns button.held { transform: translateY(2px); box-shadow: none; }
.b-liftado { background: #d9ec4b; } .b-plano { background: #ff9f5a; } .b-cortado { background: #8fd3f4; } .b-globo { background: #c3a6f2; }
@media (hover: none) { .btns button small { display: none; } }
/* ---------- Horizontal 16:9: cancha a pantalla completa, controles encima ---------- */
body.land { display: block; }
.land .stage { position: fixed; inset: 0; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.land canvas#c { border-radius: 0; }
.land .score { position: fixed; z-index: 5; top: calc(8px + env(safe-area-inset-top, 0px)); left: calc(10px + env(safe-area-inset-left, 0px));
  width: 290px; margin: 0; padding: 4px 8px; opacity: 0.93; }
.land .row { height: 22px; font-size: 0.85rem; }
.land #view { display: none; }
.land .pad { display: contents; }
.land .stickzone { position: fixed; z-index: 5; left: 0; bottom: 0; width: 42vw; height: 62vh; min-height: 0; }
.land .stick { --sx: calc(84px + env(safe-area-inset-left, 0px)); --sy: calc(100% - 80px - env(safe-area-inset-bottom, 0px));
  width: 132px; height: 132px; background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.45); backdrop-filter: blur(2px); }
.land .stickzone.float .stick { --sx: calc(84px + env(safe-area-inset-left, 0px)); }
.land.menu-open .stickzone { display: none; }
.land .stick::after { border-color: rgba(255,255,255,0.35); }
.land .dpad { position: fixed; z-index: 5; left: calc(18px + env(safe-area-inset-left, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); width: 132px; height: 132px; }
.land .dp, .land .dc { background: rgba(255,255,255,0.3); border-color: rgba(255,255,255,0.6); color: #fff; backdrop-filter: blur(2px); }
.land .dp.on { background: rgba(255,255,255,0.9); color: #121a2b; }
.land.menu-open .dpad { display: none !important; }
.land .knob { background: rgba(255,255,255,0.85); box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
.land .btns { position: fixed; z-index: 5; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  grid-template-columns: repeat(2, 70px); gap: 8px; opacity: 0.9; }
.land .btns button { height: 52px; }
.land.menu-open .score, .land.menu-open .btns { display: none; }
.land .overlay { padding: 10px; }
.land .card { max-width: 860px; }
.land .card.narrow { max-width: 520px; }
.land .roster { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.land .ycal { grid-template-columns: repeat(4, 1fr); }
.land .bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
.land .bracket .round { margin-top: 0; }
/* Paneles divididos (creador y carrera) */
.split { display: block; }
.land .split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.land .split .pane { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; max-height: calc(100vh - 150px); overflow-y: auto; }
.land .split.hub { grid-template-columns: 1.15fr 1fr; }
.pane h3 { margin-top: 0; }
.split .pane + .pane { margin-top: 12px; }
.land .split .pane + .pane { margin-top: 0; }
.actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.actions-row button { margin-top: 0 !important; }
.toast { font-size: 0.8rem; color: var(--muted); text-align: center; margin-top: 6px; }
/* Menú de inicio */
.home { text-align: center; }
.logo { margin: 4px 0 2px; font-size: 2.3rem; font-weight: 800; letter-spacing: -0.03em; display: inline-flex; align-items: center; gap: 10px; }
.logo svg { width: 36px; height: 36px; }
.home .sub { margin: 0 0 16px; }
.hgrid { display: grid; gap: 10px; }
.land .hgrid { grid-template-columns: 1fr 1fr; }
.land .hbig, .land .hhelp, .land .tutcta { grid-column: 1 / -1; }
.land .hhelp { justify-self: center; width: 60%; }
.hbtn, .hhelp { font: inherit; font-weight: 700; font-size: 1rem; padding: 11px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--soft); color: var(--ink); cursor: pointer; }
.hhelp { font-weight: 600; font-size: 0.92rem; background: transparent; }
.hbig { font: inherit; cursor: pointer; border: 0; border-radius: 16px; padding: 18px 12px; background: var(--lime); color: #121a2b;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.15); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hbig b { font-size: 1.55rem; font-weight: 800; letter-spacing: 0.02em; }
.hbig small { font-size: 0.82rem; opacity: 0.75; }
.home .foot { margin: 12px 0 0; font-size: 0.82rem; }
.home .foot a { color: inherit; }
.cookiebar { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  width: calc(100% - 20px); max-width: 560px; background: var(--board); color: var(--board-ink); border-radius: 12px; padding: 12px 14px;
  display: flex; gap: 12px; align-items: center; font-size: 0.82rem; line-height: 1.35; box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.cookiebar p { margin: 0; flex: 1; }
.cookiebar a { color: var(--lime); }
.cookiebar button { font: inherit; font-weight: 800; border: 0; border-radius: 9px; padding: 9px 14px; background: var(--lime); color: #121a2b; cursor: pointer; flex: none; }
.chead { display: flex; gap: 10px; align-items: center; margin: 2px 0 10px; }
.chead canvas { width: 40px; height: 52px; flex: none; }
.cinfo { flex: 1; min-width: 0; }
.cinfo b { font-size: 1.05rem; }
.cinfo small, .elbl { display: block; color: var(--muted); font-size: 0.76rem; }
.ebar { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 5px; }
.ebar i { display: block; height: 100%; background: #4fc26a; }
.ebar i.low { background: #ff7a59; }
.cmsg { background: var(--soft); border-radius: 8px; padding: 8px 10px; color: var(--ink) !important; font-size: 0.85rem !important; }
.hint2 { font-size: 0.82rem !important; margin: 8px 0 !important; }
.mcard { border: 1.5px solid var(--line); border-radius: 12px; padding: 7px; background: var(--panel); }
.mcard.big { padding: 10px; border: 2px solid var(--ink); margin-bottom: 8px; }
.mcard.mini.cur { border-color: var(--ink); }
.mh { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.mh b { font-size: 0.86rem; } .mcard.big .mh b { font-size: 1.25rem; letter-spacing: -0.01em; }
.mh .sw { width: 24px; height: 15px; } .mh .sw i { width: 14px; height: 7px; }
.mt { display: block; color: var(--muted); font-size: 0.78rem; margin: 1px 0 8px; }
.slots { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 5px; }
.slot { position: relative; border: 2px solid var(--ink); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; text-align: left;
  padding: 6px 7px; min-height: 66px; display: flex; flex-direction: column; gap: 2px; cursor: default; }
button.slot { cursor: pointer; }
.num, .legend .num { font-weight: 800; font-size: 0.78rem; width: 20px; height: 20px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; color: #121a2b; flex: none; }
.slot.l1 .num, .num.n1 { background: #cfd4da; } .slot.l2 .num, .num.n2 { background: #e9c64a; }
.slot.l3 .num, .num.n3 { background: linear-gradient(90deg, #5b3d99, #2b1d4a); color: #f4d35e; }
.slot b { font-size: 0.84rem; line-height: 1.1; padding-right: 18px; } .slot small { font-size: 0.7rem; color: var(--muted); }
.slot em { font-style: normal; font-weight: 800; font-size: 0.75rem; }
.slot.past, .slot.fut { opacity: 0.42; } .slot.chosen { opacity: 1; }
.slot.sel { box-shadow: 0 0 0 3px var(--lime); }
.slot.exb { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); min-height: 0; width: 42px; height: 42px; padding: 0;
  align-items: center; justify-content: center; border-radius: 10px; font-weight: 800; background: var(--lime); color: #121a2b; z-index: 1; }
.slot.exb.done { opacity: 0.45; }
.mcard.mini .slots { gap: 5px; margin-top: 4px; }
.mcard.mini .slot { min-height: 30px; padding: 3px; align-items: center; justify-content: center; border-width: 1.5px; border-radius: 6px; flex-direction: row; gap: 3px; }
.mcard.mini .num { width: 17px; height: 17px; font-size: 0.68rem; }
.mcard.mini .exb { width: 22px; height: 22px; font-size: 0.58rem; border-radius: 6px; }
.mres { font-size: 0.7rem; color: var(--muted); margin-top: 4px; }
.ycal { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 0.74rem; color: var(--muted); margin-bottom: 8px; }
.crow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.crow .secondary small { display: block; font-size: 0.7rem; color: var(--muted); }
.route { text-align: left; } .route b { display: block; } .route small { display: block; font-size: 0.74rem; color: var(--muted); margin-top: 2px; }
.kv { font-size: 0.82rem; margin-top: 4px; }
.lvl { font-size: 0.72rem; font-weight: 800; padding: 2px 8px; border-radius: 20px; background: var(--lime); color: #121a2b; }
.lvl.l1 { background: #cfd4da; } .lvl.l2 { background: #e9c64a; } .lvl.l3 { background: linear-gradient(90deg, #5b3d99, #2b1d4a); color: #f4d35e; }
.rks { display: grid; gap: 2px; }
.rk { display: grid; grid-template-columns: 24px 1fr auto auto 46px; gap: 6px; align-items: center; font-size: 0.83rem; padding: 5px 6px; border-radius: 6px; }
.rk:nth-child(odd) { background: var(--soft); } .rk.me { box-shadow: inset 0 0 0 1.5px var(--ink); font-weight: 700; }
.rk em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; } .rk small { color: var(--muted); }
.rk.sep { display: block; text-align: center; background: none; color: var(--muted); }
/* Cruceta (flechas) */
.dpad { display: none; position: relative; width: 132px; height: 132px; flex: none; touch-action: none; user-select: none; -webkit-user-select: none; }
body.mov-dpad .dpad { display: block; }
.dp, .dc { position: absolute; width: 44px; height: 44px; background: var(--soft); border: 1.5px solid var(--line); color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-size: 0.9rem; pointer-events: none; }
.dp.up { left: 44px; top: 0; border-radius: 9px 9px 3px 3px; } .dp.down { left: 44px; bottom: 0; border-radius: 3px 3px 9px 9px; }
.dp.left { top: 44px; left: 0; border-radius: 9px 3px 3px 9px; } .dp.right { top: 44px; right: 0; border-radius: 3px 9px 9px 3px; }
.dc { left: 44px; top: 44px; border-radius: 4px; }
.dp.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.optseg { margin-top: 4px; }
/* Esquemas de control */
.btns2, .gpad { display: none; }
body.ctl-dos .btns, body.ctl-gestos .btns { display: none; }
body.ctl-dos .btns2 { display: grid; }
body.ctl-gestos .gpad { display: flex; }
.btns2 { grid-template-columns: 66px 66px; gap: 4px 12px; align-items: center; touch-action: none; }
.ab { width: 66px; height: 66px; border-radius: 50%; border: 0; font: inherit; font-weight: 800; font-size: 1.35rem; color: #121a2b; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; box-shadow: inset 0 -4px 0 rgba(0,0,0,0.18); touch-action: none; }
.ab small { font-size: 0.6rem; font-weight: 700; opacity: 0.7; margin-top: 2px; }
.ab-a { background: #d9ec4b; margin-top: 20px; } .ab-b { background: #ff9f5a; margin-bottom: 20px; }
.ab.held { transform: translateY(2px); box-shadow: none; }
.ab.armed { outline: 3px solid var(--ink); outline-offset: 2px; }
.abhint { grid-column: 1 / -1; margin: 0; font-size: 0.68rem; color: var(--muted); text-align: center; }
.gpad { width: 156px; height: 112px; border-radius: 22px; border: 2px dashed var(--line); background: var(--soft); position: relative;
  align-items: center; justify-content: center; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; flex: none; }
#gsvg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
#gline { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; transition: opacity 0.5s; }
#gtxt { font-size: 0.8rem; font-weight: 700; color: var(--muted); pointer-events: none; text-align: center; padding: 0 8px; }
.gpad.hold { background: #e6dcfb; } .gpad.armed { border-style: solid; border-color: var(--ink); }
.land .btns2, .land .gpad { position: fixed; z-index: 5; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.land .btns2 { opacity: 0.92; }
.land .gpad { width: 196px; height: 134px; background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.6); backdrop-filter: blur(2px); }
.land .gpad.hold { background: rgba(195,166,242,0.45); }
.land #gline { stroke: #ffffff; } .land #gtxt { color: rgba(255,255,255,0.92); text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.land .abhint { color: rgba(255,255,255,0.9); text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.land.menu-open .btns2, .land.menu-open .gpad { display: none !important; }
.ctls { display: grid; gap: 8px; }
.ctls button { font: inherit; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.ctls button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.ctls b { display: block; font-size: 0.95rem; } .ctls small { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.land .hload, .land #homeToast { grid-column: 1 / -1; justify-self: center; width: 80%; }
.vols { display: grid; gap: 6px; }
.vols label { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; font-size: 0.86rem; }
.vols input { width: 100%; accent-color: var(--ink); }
.hday { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 0.92rem; }
.hday small { font-weight: 600; font-size: 0.78rem; color: var(--muted); letter-spacing: 0.06em; }
.stars { color: #e8b923; letter-spacing: 0.08em; } .stars.big { font-size: 1.8rem; }
.stiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.stile { background: var(--soft); border-radius: 10px; padding: 8px 6px; text-align: center; }
.stile b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; } .stile small { display: block; font-size: 0.7rem; color: var(--muted); line-height: 1.2; }
.srow { display: grid; grid-template-columns: 26px 92px 1fr 44px; gap: 8px; align-items: center; font-size: 0.82rem; margin-top: 5px; }
.srow .sw { width: 24px; height: 15px; } .srow .sw i { width: 14px; height: 7px; }
.sbar { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; } .sbar i { display: block; height: 100%; background: #4fc26a; }
.srow em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.achs { display: grid; gap: 6px; }
.ach { display: flex; gap: 10px; align-items: center; padding: 7px 9px; border-radius: 10px; background: var(--soft); opacity: 0.55; }
.ach.on { opacity: 1; box-shadow: inset 0 0 0 1.5px #e8b923; }
.ach .ai { font-size: 1.3rem; width: 28px; text-align: center; flex: none; }
.ach b { display: block; font-size: 0.86rem; } .ach small { display: block; font-size: 0.74rem; color: var(--muted); line-height: 1.25; }
.achtoast { position: fixed; z-index: 40; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translate(-50%, 0); display: flex; gap: 10px; align-items: center;
  background: var(--board); color: var(--board-ink); border-radius: 14px; padding: 10px 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  border: 1.5px solid #e8b923; animation: achIn 0.35s ease-out; transition: opacity 0.35s, transform 0.35s; }
.achtoast.out { opacity: 0; transform: translate(-50%, -20px); }
.achtoast .ai { font-size: 1.6rem; } .achtoast small { display: block; font-size: 0.7rem; color: #e8b923; text-transform: uppercase; letter-spacing: 0.08em; } .achtoast b { display: block; }
@keyframes achIn { from { opacity: 0; transform: translate(-50%, -20px); } }
.hrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.land .hrow { grid-column: 1 / -1; width: 80%; justify-self: center; }
.land .hrow .hhelp { width: auto; }
/* Descanso entre sets */
.bigscore { background: var(--board); color: var(--board-ink); border-radius: 12px; padding: 8px 12px; margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
.bs-row { display: flex; align-items: center; gap: 10px; height: 40px; font-size: 1.25rem; font-weight: 800; }
.bs-row + .bs-row { border-top: 1px solid rgba(255,255,255,0.12); }
.bs-row canvas { width: 27px; height: 18px; border-radius: 2px; flex: none; }
.bs-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-row .g { width: 30px; text-align: center; opacity: 0.5; }
.bs-row .g.w { opacity: 1; color: var(--lime); }
.sstats { display: grid; grid-template-columns: 1fr auto auto; gap: 5px 16px; font-size: 0.86rem; align-items: center; }
.sstats b { text-align: center; font-variant-numeric: tabular-nums; } .sstats .span2 { grid-column: span 2; }
.adslot { min-height: 120px; border: 2px dashed var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; background: var(--soft); margin-top: 10px; }
.land .adslot { min-height: 160px; height: 100%; margin-top: 0; }
.land .card.setbreak h2 { font-size: 1.35rem; } .land .card.setbreak .bs-row { height: 34px; }
.land .split.brk { grid-template-columns: 1fr 1fr; }
.land .card.setbreak { max-width: 760px; }
.card.setbreak .primary:disabled { opacity: 0.55; cursor: default; }
.pausebtn { position: absolute; z-index: 4; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(18,26,43,0.72); display: flex; align-items: center; justify-content: center; gap: 5px; touch-action: none; }
.pausebtn span { width: 4px; height: 15px; border-radius: 2px; background: #ffffff; }
.pausebtn:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.menu-open .pausebtn { display: none; }
.skipbtn { display: none; position: absolute; z-index: 4; top: 12px; left: 50%; transform: translateX(-50%); font: inherit; font-size: 0.78rem; font-weight: 700;
  padding: 6px 12px; border-radius: 20px; border: 0; background: rgba(18,26,43,0.75); color: #fff; cursor: pointer; }
body.tut .skipbtn { display: block; }
body.tut .score { visibility: hidden; }
.menu-open .skipbtn { display: none !important; }
.tutcta { width: 100%; font: inherit; font-weight: 700; font-size: 0.92rem; padding: 10px; margin-bottom: 10px; border-radius: 12px; cursor: pointer;
  border: 2px dashed var(--ink); background: transparent; color: var(--ink); }
.fsbtn { position: absolute; z-index: 4; top: 8px; right: 56px; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(18,26,43,0.72); display: flex; align-items: center; justify-content: center; touch-action: none; padding: 0; }
.fsbtn[hidden] { display: none; }
.fsbtn svg { width: 20px; height: 20px; }
.menu-open .fsbtn { display: none; } /* en los menús se usa el botón «Pantalla completa» del menú u Opciones */
.land .fsbtn { top: calc(8px + env(safe-area-inset-top, 0px)); right: calc(62px + env(safe-area-inset-right, 0px)); width: 44px; height: 44px; }
.land .pausebtn { top: calc(8px + env(safe-area-inset-top, 0px)); right: calc(10px + env(safe-area-inset-right, 0px)); width: 44px; height: 44px; }
.ceremony { display: flex; gap: 12px; align-items: center; margin: 4px 0 8px; }
.ceremony canvas { width: 76px; height: 92px; flex: none; }
.ceremony p { margin: 0; }
.help { text-align: left; font-size: 0.86rem; line-height: 1.4; margin: 0 0 8px; padding-left: 18px; color: var(--ink); }
.help li { margin-bottom: 5px; }
