/* ============================================================
   Archipiélago — mesa, mapa y paneles (templates/play_archipielago.html,
   archipielago_hub.html). El mapa es un SVG dibujado por
   static/js/archipielago-board.js con los símbolos de
   static/js/archipielago-art.js. Tokens propios:
     --ar-sea / --ar-sea-2   el mar alrededor de las islas
     --ar-hot                resaltado de los sitios válidos
     --ar-card               paneles laterales
   ============================================================ */

.ar-shell, .ar-hub, .ar-setup, .ar-trade-card, #ar-offer, #ar-discard, .ar-help {
  --ar-sea: #2F7489; --ar-sea-2: #3C8AA0; --ar-sea-ink: #E8F3F4;
  --ar-hot: #F4C35A; --ar-hot-ink: #3A2A12;
  --ar-card: var(--surface);
  --ar-token-ink: #2B2420;
}
:root[data-theme="dark"] .ar-shell, :root[data-theme="dark"] .ar-hub {
  --ar-sea: #183F4D; --ar-sea-2: #21566A; --ar-sea-ink: #CFE3E6;
}

/* ---------- íconos ---------- */
.ar-ico { width: 22px; height: 22px; flex: none; display: inline-block; vertical-align: middle; }
.ar-piece-ico { width: 22px; height: 22px; flex: none; color: var(--accent); }
.ar-piece-sendero { color: #8A5A33; }

/* ============================================================ mesa */
.ar-shell { max-width: 1240px; }
.ar-main { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 16px; align-items: start; }
.ar-stage { position: sticky; top: 10px; min-width: 0; }
.ar-board-box {
  position: relative; overflow: hidden; border-radius: 22px;
  height: clamp(420px, calc(100vh - 214px), 780px);
  background:
    radial-gradient(70% 60% at 50% 45%, var(--ar-sea-2), transparent 75%),
    var(--ar-sea);
  border: 1px solid color-mix(in srgb, var(--ar-sea) 70%, #000);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 30px 60px -30px rgba(0, 0, 0, .35), var(--shadow-md);
}
.ar-board-svg { display: block; width: 100%; height: 100%; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.ar-board-svg.is-zoomed { touch-action: none; cursor: grab; }
.ar-board-svg.is-zoomed:active { cursor: grabbing; }
.ar-ocean { fill: transparent; }
.ar-hub-map .ar-ocean { fill: var(--ar-sea); }

/* hexágonos */
.ar-hex-edge { fill: none; stroke: rgba(255, 248, 236, .82); stroke-width: 3; stroke-linejoin: round; }
.ar-hex.t-caladero .ar-hex-edge { stroke: rgba(220, 240, 244, .45); stroke-width: 2; stroke-dasharray: 6 6; }
.ar-hex.t-mar use { opacity: .72; }
.ar-hex { cursor: default; }
.ar-token-bg { fill: url(#ar-g-token); stroke: #9C7E55; stroke-width: 1.5; filter: drop-shadow(0 2px 2px rgba(40, 25, 10, .35)); }
.ar-token text { font-family: var(--font-display); font-weight: 700; font-size: 17px; fill: var(--ar-token-ink); }
.ar-token-pips { fill: var(--ar-token-ink); }
.ar-token.is-red text, .ar-token.is-red .ar-token-pips { fill: #B0271F; }
.ar-hex.is-hit .ar-token-bg { stroke: var(--ar-hot); stroke-width: 4; }
.ar-hex.is-hit .ar-token { animation: ar-hit 1.2s var(--ease) 2; transform-box: fill-box; transform-origin: center; }
@keyframes ar-hit { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.18); } }

/* muelles, islotes, olas */
.ar-pier { fill: none; stroke: #6E4B2C; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2 4; }
.ar-port-bg { fill: #FBF4E6; stroke: #6E4B2C; stroke-width: 2; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3)); }
.ar-port-txt { font: 700 11px var(--font-ui); fill: #4A3320; }
.ar-port-txt.sm { font-size: 8.5px; }
.ar-rock { fill: #6F6A61; stroke: rgba(0, 0, 0, .2); }
.ar-rock-hi { fill: none; stroke: #A39C8F; stroke-width: 2; stroke-linecap: round; }
.ar-wave { fill: none; stroke: rgba(255, 255, 255, .3); stroke-width: 2; stroke-linecap: round; }

/* piezas */
.ar-road-sh { stroke: rgba(20, 12, 6, .55); stroke-width: 12; stroke-linecap: round; }
.ar-road-c { stroke: currentColor; stroke-width: 7.5; stroke-linecap: round; }
.ar-build-sh { fill: rgba(20, 12, 6, .35); }
.ar-build use { filter: drop-shadow(0 1.5px 1px rgba(0, 0, 0, .35)); }
.ar-road.is-new, .ar-build.is-new > * { animation: ar-pop .5s cubic-bezier(.3, 1.6, .5, 1) both; transform-box: fill-box; transform-origin: center; }
@keyframes ar-pop { from { opacity: 0; transform: scale(.35); } }
.ar-light { pointer-events: none; mix-blend-mode: screen; animation: ar-breathe 4s ease-in-out infinite; }
@keyframes ar-breathe { 50% { opacity: .65; } }
.ar-tide { fill: #C8302A; fill-opacity: .28; stroke: #E2573E; stroke-width: 2; stroke-dasharray: 3 5; pointer-events: none; }
.ar-fog { pointer-events: none; }
.ar-fog-l { fill: none; stroke: #FFFFFF; stroke-opacity: .85; stroke-width: 3; stroke-linecap: round; animation: ar-drift 6s ease-in-out infinite; }
@keyframes ar-drift { 50% { transform: translateX(8px); } }

/* sitios válidos */
.ar-hot { cursor: pointer; outline: none; }
.ar-hot-hit { fill: transparent; stroke: transparent; }
.ar-hot-v .ar-hot-hit { r: 26px; }
.ar-hot-e .ar-hot-hit { stroke-width: 30; stroke-linecap: round; }
.ar-hot-ring { fill: rgba(255, 250, 238, .9); stroke: var(--ar-hot); stroke-width: 3.5; animation: ar-pulse 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.ar-hot-core { fill: var(--ar-hot-ink); }
.ar-hot-line { stroke: var(--ar-hot); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 2 12; opacity: .95; }
.ar-hot-dot { fill: rgba(255, 250, 238, .95); stroke: var(--ar-hot); stroke-width: 3; animation: ar-pulse 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.ar-hot-h polygon { fill: rgba(255, 250, 238, .14); stroke: var(--ar-hot); stroke-width: 4; stroke-dasharray: 10 8; }
@keyframes ar-pulse { 50% { stroke-width: 7; stroke-opacity: .55; } }
.ar-hot:hover .ar-hot-ring, .ar-hot:hover .ar-hot-dot, .ar-hot:focus-visible .ar-hot-ring, .ar-hot:focus-visible .ar-hot-dot,
.ar-hot.is-sel .ar-hot-ring, .ar-hot.is-sel .ar-hot-dot { fill: var(--ar-hot); stroke: #FFF8EA; stroke-width: 4; animation: none; }
.ar-hot:hover .ar-hot-line, .ar-hot:focus-visible .ar-hot-line, .ar-hot.is-sel .ar-hot-line { stroke-dasharray: none; stroke-width: 8; }
.ar-hot-h:hover polygon, .ar-hot-h:focus-visible polygon, .ar-hot-h.is-sel polygon { fill: rgba(255, 250, 238, .4); stroke-dasharray: none; }
.ar-hot:focus-visible .ar-hot-hit { stroke: #FFFFFF; stroke-width: 3; stroke-dasharray: 4 3; }
.ar-hot-e:focus-visible .ar-hot-hit { stroke: rgba(255, 255, 255, .35); stroke-width: 30; stroke-dasharray: none; }

/* controles sobre el mapa */
.ar-zoom { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.ar-zbtn {
  display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 12px; cursor: pointer;
  font: 500 1.3rem/1 var(--font-ui); color: var(--ink); background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.ar-zbtn svg { width: 18px; height: 18px; }
.ar-zbtn:hover { background: var(--surface); }
.ar-zbtn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ar-prompt {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 6;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 24px); padding: 6px 6px 6px 16px;
  border-radius: var(--r-pill); background: color-mix(in srgb, var(--ink) 90%, transparent); color: var(--on-ink);
  font-size: var(--t-sm); box-shadow: var(--shadow-md); animation: pop-in .18s var(--ease);
}
.ar-prompt[hidden] { display: none; }
.ar-prompt { pointer-events: none; }
.ar-prompt button { pointer-events: auto; }
.ar-prompt span { padding: 6px 0; }
.ar-prompt button {
  flex: none; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); cursor: pointer; font: inherit; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, .25); background: transparent; color: inherit;
}
.ar-prompt .ar-prompt-ok { background: var(--ar-hot); color: var(--ar-hot-ink); border-color: var(--ar-hot); }
.ar-prompt button[hidden] { display: none; }
.ar-prompt button:focus-visible { outline: 2px solid var(--ar-hot); outline-offset: 2px; }

/* carta de la bitácora del mar */
.ar-event { position: absolute; inset: 0; display: grid; place-items: center; z-index: 8; padding: 20px; pointer-events: none; }
.ar-event-card { pointer-events: auto; cursor: pointer; }
.ar-event[hidden] { display: none; }
.ar-event-card {
  display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center;
  width: min(100%, 330px); padding: 22px 24px; border-radius: 18px;
  background: linear-gradient(170deg, #FBF5E9, #F1E5CF); color: #2B2420;
  border: 1px solid #D9C6A2; box-shadow: 0 0 0 6px rgba(251, 245, 233, .25), var(--shadow-lg);
  opacity: 0; transform: translateY(14px) rotate(-1.5deg) scale(.96); transition: opacity .3s ease, transform .4s var(--ease);
}
.ar-event.is-on .ar-event-card { opacity: 1; transform: none; }
.ar-event-card small { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: #8A6F47; }
.ar-event-card b { font-family: var(--font-display); font-weight: 500; font-size: 1.7rem; line-height: 1.1; }
.ar-event-card span { font-size: var(--t-sm); color: #4B4036; line-height: 1.45; }
.ar-event[data-ev="niebla"] .ar-event-card, .ar-event[data-ev="temporal"] .ar-event-card { background: linear-gradient(170deg, #EEF1F2, #DCE3E6); }
.ar-event[data-ev="marea"] .ar-event-card { background: linear-gradient(170deg, #FBEDE9, #F2D7CF); }

/* resultado */
.ar-rank { list-style: none; margin: 10px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.ar-rank li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); }
.ar-rank li i { width: 12px; height: 12px; border-radius: 4px; background: var(--pc); flex: none; }
.ar-rank li span { flex: 1; min-width: 0; }
.ar-rank li small { color: var(--muted); }
.ar-rank li.is-winner { background: color-mix(in srgb, var(--pc) 14%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pc) 40%, transparent); }
.ar-rank b { font-family: var(--font-num); font-weight: 500; }

/* ============================================================ panel lateral */
.ar-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ar-side > section { background: var(--ar-card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.ar-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 10px;
  font: 600 .72rem/1.2 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ar-h small { font-weight: 500; letter-spacing: .02em; text-transform: none; }

.ar-turn-top { display: flex; align-items: center; gap: 12px; }
.ar-status { flex: 1; display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: var(--t-sm); color: var(--ink); line-height: 1.4; min-height: 2.8em; }
.ar-dot { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 0%, var(--surface-2)); }
.ar-turn-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.ar-main-btn { min-height: 44px; }
#ar-roll.is-ready { animation: ar-ready 1.8s ease-in-out infinite; }
@keyframes ar-ready { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent); } }

/* dados */
.ar-dice { display: flex; gap: 6px; flex: none; }
.ar-die {
  position: relative; width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(150deg, #FFFDF8, #EDE3D1); border: 1px solid #CDBFA6;
  box-shadow: inset 0 -2px 0 rgba(120, 95, 60, .18), 0 2px 4px rgba(60, 40, 20, .18);
}
.ar-die::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%;
  background: transparent; color: #2B2420;
}
.ar-die[data-n="1"]::before, .ar-die[data-n="3"]::before, .ar-die[data-n="5"]::before { background: #2B2420; }
.ar-die[data-n="2"]::before { box-shadow: -9px -9px 0 currentColor, 9px 9px 0 currentColor; }
.ar-die[data-n="3"]::before { box-shadow: -9px -9px 0 currentColor, 9px 9px 0 currentColor; }
.ar-die[data-n="4"]::before { box-shadow: -9px -9px 0 currentColor, 9px -9px 0 currentColor, -9px 9px 0 currentColor, 9px 9px 0 currentColor; }
.ar-die[data-n="5"]::before { box-shadow: -9px -9px 0 currentColor, 9px -9px 0 currentColor, -9px 9px 0 currentColor, 9px 9px 0 currentColor; }
.ar-die[data-n="6"]::before { box-shadow: -9px -9px 0 currentColor, 9px -9px 0 currentColor, -9px 9px 0 currentColor, 9px 9px 0 currentColor, -9px 0 0 currentColor, 9px 0 0 currentColor; }
.ar-dice[data-sum="7"] .ar-die { border-color: #C8302A; }
.ar-dice.is-rolling .ar-die { animation: ar-roll .22s linear infinite; }
.ar-dice.is-rolling .ar-die + .ar-die { animation-direction: reverse; animation-duration: .26s; }
@keyframes ar-roll { 0% { transform: rotate(0) translateY(0); } 50% { transform: rotate(18deg) translateY(-4px); } 100% { transform: rotate(0) translateY(0); } }

/* mano */
.ar-hand-n { font-weight: 500; letter-spacing: .02em; text-transform: none; }
.ar-hand-n.is-warn { color: var(--danger); font-weight: 600; }
.ar-hand { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ar-res {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 2px 6px;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
}
.ar-res .ar-ico { width: 26px; height: 26px; }
.ar-res b { font: 500 1.15rem/1.1 var(--font-num); color: var(--ink); }
.ar-res span { font-size: .66rem; color: var(--muted); }
.ar-res.is-zero .ar-ico { opacity: .45; }
.ar-res.is-zero b { color: var(--muted); }
.ar-res.is-bump b { animation: ar-bump .4s var(--ease); }
@keyframes ar-bump { 40% { transform: scale(1.35); color: var(--success); } }
.ar-ratio { position: absolute; top: -7px; right: -3px; font: 600 .6rem/1 var(--font-num); font-style: normal; padding: 3px 5px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--muted); }
.ar-ratio.is-good { background: var(--success); border-color: var(--success); color: #fff; }

/* construir */
.ar-builds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ar-bbtn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 64px; padding: 9px 10px; cursor: pointer;
  font: inherit; text-align: left; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
  transition: border-color var(--dur), background var(--dur), box-shadow var(--dur);
}
.ar-bbtn:hover:not([disabled]) { border-color: var(--ink-2); background: var(--surface-2); }
.ar-bbtn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ar-bbtn[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-weak); }
.ar-bbtn[disabled] { cursor: default; color: var(--muted); background: transparent; }
.ar-bbtn[disabled] .ar-piece-ico { opacity: .5; }
.ar-bname { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; width: 100%; font-weight: 600; font-size: var(--t-sm); }
.ar-left { margin-left: auto; font-weight: 400; font-size: .68rem; color: var(--muted); white-space: nowrap; }
.ar-bbtn.is-free .ar-left { color: var(--success); font-weight: 600; }
.ar-bcost { display: flex; gap: 1px; flex-wrap: wrap; }
.ar-bcost .ar-ico { width: 19px; height: 19px; }
.ar-bcost .ar-ico.is-short { opacity: .28; filter: grayscale(1); }
.ar-trade-btn { margin-top: 10px; min-height: 44px; gap: 8px; }
.ar-trade-btn svg { width: 17px; height: 17px; }

/* participantes */
.ar-players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ar-pl {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; grid-template-areas: "b n c v" "b p p p" "bar bar bar bar";
  align-items: center; column-gap: 8px; row-gap: 2px; padding: 8px 10px 0; border-radius: 12px; overflow: hidden;
  background: var(--surface-2); border: 1px solid transparent; transition: border-color var(--dur), background var(--dur);
}
.ar-pl.is-turn { border-color: color-mix(in srgb, var(--pc) 60%, transparent); background: color-mix(in srgb, var(--pc) 8%, var(--surface)); }
.ar-pl-badge { grid-area: b; color: var(--pc); width: 28px; height: 28px; }
.ar-pl-badge svg { width: 28px; height: 28px; }
.ar-pl-name { grid-area: n; display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ar-pl-name b { font-size: var(--t-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-pl-name small { display: flex; align-items: center; gap: 6px; font-size: .7rem; color: var(--muted); }
.ar-pl-cards { grid-area: c; display: inline-flex; align-items: center; gap: 3px; font-size: var(--t-sm); color: var(--ink-2); padding: 2px 6px; border-radius: 8px; }
.ar-pl-cards.is-bump { animation: ar-cardbump .45s var(--ease); }
@keyframes ar-cardbump { 40% { background: color-mix(in srgb, var(--success) 22%, transparent); transform: scale(1.12); } }
.ar-cards-ico { width: 17px; height: 17px; color: var(--muted); }
.ar-pl-vp { grid-area: v; display: flex; align-items: baseline; gap: 2px; }
.ar-pl-vp b { font: 500 1.35rem/1 var(--font-num); color: var(--ink); }
.ar-pl-vp small { font-size: .62rem; color: var(--muted); }
.ar-pl-pieces { grid-area: p; font-size: .7rem; color: var(--muted); }
.ar-pl-bar { grid-area: bar; height: 3px; margin: 6px -10px 0; background: color-mix(in srgb, var(--pc) 14%, transparent); }
.ar-pl-bar i { display: block; height: 100%; background: var(--pc); transition: width .5s var(--ease); }
.ar-think { display: inline-flex; gap: 2px; }
.ar-think i { width: 4px; height: 4px; border-radius: 50%; background: var(--pc); animation: ar-think 1s infinite ease-in-out; }
.ar-think i:nth-child(2) { animation-delay: .15s; } .ar-think i:nth-child(3) { animation-delay: .3s; }
@keyframes ar-think { 50% { opacity: .25; transform: translateY(-2px); } }

/* objetivos */
.ar-objs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ar-obj { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.ar-obj b { font-size: var(--t-sm); }
.ar-obj span { grid-column: 1; font-size: .72rem; color: var(--muted); line-height: 1.35; }
.ar-obj em { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: normal; font-size: .7rem; font-weight: 600; padding: 4px 8px; border-radius: 999px;
  background: var(--surface); border: 1px dashed var(--line-2); color: var(--muted); }
.ar-obj.is-taken em { background: var(--pc); border: 1px solid var(--pc); color: #fff; }

/* bitácora */
.ar-log { list-style: none; margin: 0; padding: 0 4px 0 0; max-height: 210px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
  font-size: .78rem; color: var(--ink-2); line-height: 1.4; }
.ar-log:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.ar-log li { padding: 4px 0 4px 10px; border-left: 3px solid var(--pc, var(--line-2)); }
.ar-log li.k-event { color: var(--ink); font-weight: 500; }
.ar-log li.k-win, .ar-log li.k-objective { color: var(--ink); font-weight: 600; }
.ar-log li.k-dice { color: var(--muted); }

/* recursos que vuelan */
.ar-fly { position: fixed; z-index: 70; width: 28px; height: 28px; pointer-events: none; display: grid; place-items: center;
  border-radius: 50%; background: #FFFCF5; box-shadow: 0 3px 8px rgba(0, 0, 0, .3);
  transition: transform .72s cubic-bezier(.45, .05, .25, 1), opacity .72s ease-in; }
.ar-fly .ar-ico { width: 22px; height: 22px; }

/* sonido */
.ar-sound-pop { min-width: 240px; }
.ar-snd-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink); font: inherit; font-size: var(--t-sm); cursor: pointer; text-align: left; }
.ar-snd-btn svg { width: 17px; height: 17px; color: var(--muted); }
.ar-snd-btn:hover, .ar-snd-btn:focus-visible { background: var(--surface-2); outline: none; }
.ar-snd-btn[aria-pressed="false"] svg { opacity: .4; }
.ar-vol { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px 10px; font-size: var(--t-sm); color: var(--ink-2); }
.ar-vol input { width: 100%; accent-color: var(--accent); min-height: 32px; }

/* ============================================================ diálogos */
.ar-setup fieldset { border: 0; margin: 0 0 14px; padding: 0; min-width: 0; }
.ar-setup .seg { display: flex; gap: 6px; flex-wrap: wrap; }
.ar-level-desc { margin-top: 6px !important; min-height: 1.2em; }
.ar-seed-row { display: flex; gap: 8px; }
.ar-seed-input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font: 500 1rem var(--font-num); letter-spacing: .12em; text-transform: uppercase;
}
.ar-seed-input::placeholder { letter-spacing: .02em; text-transform: none; color: var(--muted); font-family: var(--font-ui); }
.ar-seed-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.ar-seed-row .btn { min-width: 44px; min-height: 44px; padding: 0 12px; }
.ar-seed-row .btn svg { width: 18px; height: 18px; }

.ar-trade-card { max-width: 520px; }
.ar-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); margin: 6px 0 12px; }
.ar-tabs [role="tab"] { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font: inherit; font-size: var(--t-sm); font-weight: 500; color: var(--ink-2); }
.ar-tabs [aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.ar-tabs [role="tab"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.ar-tlabel { margin: 10px 0 6px; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ar-pickrow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ar-pick {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 64px; padding: 6px 2px; cursor: pointer;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); font: inherit; color: var(--ink);
}
.ar-pick span { font-size: .7rem; }
.ar-pick small { font-size: .6rem; color: var(--muted); text-align: center; line-height: 1.2; }
.ar-pick[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-weak); }
.ar-pick[disabled] { opacity: .4; cursor: default; }
.ar-pick:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ar-tnote { min-height: 1.3em; margin: 10px 0 0; font-size: var(--t-sm); color: var(--ink-2); }
.ar-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ar-step { display: grid; grid-template-columns: 1fr; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; background: var(--surface-2); }
.ar-step b { font: 500 1.05rem/1 var(--font-num); order: 2; }
.ar-step .ar-ico { order: 0; }
.ar-step .ar-sbtn[data-d="1"] { order: 1; }
.ar-step .ar-sbtn[data-d="-1"] { order: 3; }
.ar-sbtn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 500 1.15rem/1 var(--font-ui); cursor: pointer; }
.ar-sbtn[disabled] { opacity: .35; cursor: default; }
.ar-sbtn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.ar-to { display: flex; flex-wrap: wrap; gap: 6px; }
.ar-tobtn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink-2); font: inherit; font-size: var(--t-sm); cursor: pointer; }
.ar-tobtn i { width: 10px; height: 10px; border-radius: 3px; background: var(--pc); }
.ar-tobtn small { color: var(--muted); }
.ar-tobtn[aria-pressed="true"] { border-color: var(--pc); box-shadow: 0 0 0 1px var(--pc); color: var(--ink); background: color-mix(in srgb, var(--pc) 8%, var(--surface)); }
.ar-tobtn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ar-answers { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ar-answers li { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px;
  background: var(--surface-2); border-left: 3px solid var(--pc, var(--line-2)); font-size: var(--t-sm); }
.ar-answers li.is-done { border-left-color: var(--success); }
.ar-cardrow { display: inline-flex; gap: 1px; vertical-align: middle; flex-wrap: wrap; }
.ar-cardrow .ar-ico { width: 20px; height: 20px; }
.ar-trade-close { margin-top: 8px !important; }
.ar-offer-body { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; }
.ar-offer-line { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.ar-offer-line span:first-child { min-width: 4.5em; font-size: var(--t-sm); color: var(--muted); }
.ar-offer-line .ar-ico { width: 26px; height: 26px; }
.ar-stat-table { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: var(--t-sm); }
.ar-stat-table th, .ar-stat-table td { padding: 7px 6px; border-top: 1px solid var(--line); text-align: right; }
.ar-stat-table th:first-child, .ar-stat-table thead th:first-child { text-align: left; }
.ar-stat-table thead th { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; border-top: 0; }
.ar-help { max-width: 620px; }
.ar-help-h3 { margin: 18px 0 8px; font-size: var(--t-md); }
.ar-help-list { margin: 0; padding-left: 18px; font-size: var(--t-sm); color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }

/* ============================================================ portada */
.ar-jump { display: none; }
@media (max-width: 860px) { .ar-jump { display: inline-flex; margin-bottom: var(--s-4); } #ar-start { scroll-margin-top: 90px; } }
.ar-hub-map { margin: 0 0 14px; }
.ar-hub-map svg { display: block; width: 100%; height: auto; aspect-ratio: 1 / .92; border-radius: 16px;
  background: radial-gradient(70% 60% at 50% 45%, var(--ar-sea-2), transparent 75%), var(--ar-sea); }
.ar-hub-map figcaption { margin-top: 6px; font-size: var(--t-xs); color: var(--muted); text-align: center; font-family: var(--font-num); letter-spacing: .02em; }
.ar-costs { display: flex; flex-direction: column; margin-top: var(--s-4); max-width: 60ch; }
.ar-cost-row { display: grid; grid-template-columns: 120px auto minmax(0, 1fr); gap: 6px 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.ar-cost-name { display: flex; align-items: center; gap: 8px; font-size: var(--t-sm); }
.ar-cost-res { display: flex; gap: 6px; flex-wrap: wrap; }
.ar-chip { display: inline-flex; gap: 1px; padding: 3px 5px; border-radius: 8px; background: var(--surface-2); }
.ar-chip .ar-ico { width: 20px; height: 20px; }
.ar-cost-desc { font-size: var(--t-xs); color: var(--muted); line-height: 1.4; }
.ar-costs.compact .ar-cost-row { grid-template-columns: 70px auto minmax(0, 1fr); }
.ar-res-list { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-width: 60ch; }
.ar-res-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); font-size: var(--t-sm); }
.ar-res-list li span { margin-left: auto; color: var(--muted); font-size: var(--t-xs); }
.ar-small { font-size: var(--t-sm); margin-top: 10px; max-width: 60ch; }
.ar-dl li { display: block; }
.ar-dl li::before { content: none; }

/* ============================================================ pantallas medianas y móviles */
@media (max-width: 980px) {
  .ar-main { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 860px) {
  .ar-main { grid-template-columns: minmax(0, 1fr); }
  .ar-stage { position: relative; top: 0; }
  .ar-board-box { height: min(68vh, 600px); min-height: 0; border-radius: 18px; }
  .ar-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .ar-side > .ar-turn, .ar-side > .ar-hand-box, .ar-side > .ar-build-box { grid-column: 1 / -1; }
  .ar-builds { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .ar-board-box { height: min(62vh, 520px); border-radius: 16px; }
  .ar-side { display: flex; align-items: stretch; }
  .ar-builds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ar-side > section { padding: 10px 12px; }
  /* en el teléfono nada tapa el mapa: zoom y Confirmar/Cancelar van en una
     bandeja bajo el mar (la indicación ya está bajo el mapa) */
  .ar-board-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) 54px; }
  .ar-board-svg { grid-column: 1 / -1; grid-row: 1; height: 100%; min-height: 0; }
  .ar-prompt { position: static; grid-column: 1; grid-row: 2; transform: none; align-self: center; justify-self: start;
    margin-left: 8px; padding: 0; background: transparent; box-shadow: none; gap: 6px; animation: none; }
  .ar-prompt span { display: none; }
  .ar-prompt:not(:has(button:not([hidden]))) { display: none; }
  .ar-prompt button { background: var(--ink); color: var(--on-ink); border-color: transparent; min-height: 40px; }
  .ar-zoom { position: static; grid-column: 2; grid-row: 2; flex-direction: row; align-self: center; margin-right: 8px; }
  .ar-board-box::after { content: ""; grid-column: 1 / -1; grid-row: 2; background: rgba(0, 0, 0, .18); border-top: 1px solid rgba(255, 255, 255, .08); z-index: 0; }
  .ar-prompt, .ar-zoom { z-index: 1; }
  .ar-zbtn { width: 40px; height: 40px; }
  .ar-res span { font-size: .6rem; }
  .ar-cost-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ar-cost-desc { grid-column: 1 / -1; }
  .ar-prompt { top: 8px; font-size: var(--t-xs); padding-left: 12px; }
  .ar-event-card b { font-size: 1.4rem; }
  .ar-pickrow, .ar-steps { gap: 4px; }
  .ar-sbtn { width: 40px; height: 40px; }
}
@media (max-width: 360px) {
  .ar-hand { gap: 4px; }
  .ar-res { padding: 7px 0 5px; }
  .ar-res .ar-ico { width: 22px; height: 22px; }
  .ar-ratio { right: -2px; padding: 2px 3px; }
  .ar-dice .ar-die { width: 32px; height: 32px; }
  .ar-step { padding: 4px 0; }
  .ar-sbtn { width: 40px; height: 40px; }
  .ar-pick span { font-size: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ar-hot-ring, .ar-hot-dot, .ar-light, .ar-fog-l, #ar-roll.is-ready, .ar-think i, .ar-hex.is-hit .ar-token { animation: none !important; }
  .ar-road.is-new, .ar-build.is-new > *, .ar-event-card, .ar-dice.is-rolling .ar-die { animation: none !important; transition: none !important; }
}
