/* Contorno visible y abertura útil de cada estilo, medidos sobre sus PNG. */
:is(.game[data-skin="santuario"]:not([data-frame]), [data-frame="plantilla"]) {
  --frame-asset: url("../assets/santuario/estilos/guardian-alado/marco.png");
  --style-footer-art: url("../assets/santuario/estilos/guardian-alado/pie.png");
  --footer-decoration-position: center bottom;
  --footer-decoration-size: 100% 100%;
  --footer-decoration-height: 21.5cqw;
  --ink-left: 11; --ink-right: 1242;
  --ink-top: 11; --ink-bottom: 1245;
  --opening-left: 55; --opening-right: 1199;
  --opening-top: 65; --opening-bottom: 1178;
  --column-axis-size: round(nearest, calc(var(--axis-size) + 26.5 * var(--frame-unit)), 1px);
}

:is([data-frame="bastet"], [data-frame="bastet-color"]) {
  --hud-face: #141b32;
  --hud-stone: #719fea;
  --style-footer-art: url("../assets/santuario/estilos/bastet/pie.png");
  --footer-decoration-position: 50% 87.44%;
  --footer-decoration-size: 100.09% 144.51%;
  --footer-decoration-height: 23.09cqw;
  --footer-clearance: 6cqw;
  --frame-asset: url("../assets/santuario/estilos/bastet/marco.png");
  --ink-left: 49; --ink-right: 1204;
  --ink-top: 11; --ink-bottom: 1219;
  --opening-left: 174; --opening-right: 1079;
  --opening-top: 195; --opening-bottom: 1107;
  --frame-slice-bottom: 355;
}

:is([data-frame="lotos"], [data-frame="lotos-color"]) {
  --hud-face: #132821;
  --hud-stone: #87d7bc;
  --style-footer-art: url("../assets/santuario/estilos/lotos/pie.png");
  --footer-decoration-position: 50% 100%;
  --footer-decoration-size: 100% 180.55%;
  --footer-decoration-height: 18.46cqw;
  --footer-clearance: 8cqw;
  --frame-asset: url("../assets/santuario/estilos/lotos/marco.png");
  --ink-left: 17; --ink-right: 1237;
  --ink-top: 34; --ink-bottom: 1206;
  --opening-left: 210; --opening-right: 1044;
  --opening-top: 212; --opening-bottom: 1038;
}

:is([data-frame="obsidiana"], [data-frame="obsidiana-color"]) {
  --hud-face: #201d2b;
  --hud-stone: #c3b4e6;
  --style-footer-art: url("../assets/santuario/estilos/obsidiana/pie.png");
  --footer-decoration-position: 55.56% 90.57%;
  --footer-decoration-size: 100.42% 157.73%;
  --footer-decoration-height: 21.22cqw;
  --footer-clearance: 5.5cqw;
  --frame-asset: url("../assets/santuario/estilos/obsidiana/marco.png");
  --ink-left: 50; --ink-right: 1203;
  --ink-top: 46; --ink-bottom: 1209;
  --opening-left: 184; --opening-right: 1070;
  --opening-top: 188; --opening-bottom: 1069;
}

:is([data-frame="ambar"], [data-frame="ambar-color"]) {
  --hud-face: #2a1917;
  --hud-stone: #e68665;
  --style-footer-art: url("../assets/santuario/estilos/ambar/pie.png");
  --footer-decoration-position: 50% 96.31%;
  --footer-decoration-size: 100.56% 169.95%;
  --footer-decoration-height: 19.72cqw;
  --footer-clearance: 6.5cqw;
  --frame-asset: url("../assets/santuario/estilos/ambar/marco.png");
  --ink-left: 51; --ink-right: 1202;
  --ink-top: 52; --ink-bottom: 1201;
  --opening-left: 201; --opening-right: 1053;
  --opening-top: 200; --opening-bottom: 1044;
}

:is([data-frame="mosaico"], [data-frame="mosaico-color"]) {
  --hud-face: #222630;
  --hud-stone: #77abc8;
  --style-footer-art: url("../assets/santuario/estilos/mosaico/pie.png");
  --footer-decoration-position: 52.17% 94.55%;
  --footer-decoration-size: 101.07% 183.76%;
  --footer-decoration-height: 18.33cqw;
  --footer-clearance: 6.3cqw;
  --frame-asset: url("../assets/santuario/estilos/mosaico/marco.png");
  --ink-left: 31; --ink-right: 1223;
  --ink-top: 35; --ink-bottom: 1214;
  --opening-left: 191; --opening-right: 1062;
  --opening-top: 198; --opening-bottom: 1048;
}

[data-frame$="-color"] {
  --control-tone: saturate(.47) sepia(.12) brightness(.94);
  --control-shadow: drop-shadow(0 0 .23rem #c0a17d9c) drop-shadow(0 .12rem .34rem #444653b8);
  --hud-rim: color-mix(in srgb, var(--hud-stone) 64%, #bf9d70);
  --footer-decoration-position: center bottom;
  --footer-decoration-size: 100% 100%;
  --notice-surface:
    linear-gradient(90deg, color-mix(in srgb, var(--notice-trim) 25%, transparent),
      transparent 13% 87%, color-mix(in srgb, var(--notice-trim) 25%, transparent)),
    linear-gradient(color-mix(in srgb, var(--notice-paper) 78%, var(--notice-trim)),
      var(--notice-paper) 24% 76%, color-mix(in srgb, var(--notice-paper) 72%, var(--notice-trim)));
}

[data-frame="bastet-color"] {
  --frame-asset: url("../assets/santuario/estilos/bastet-color/marco.png");
  --style-footer-art: url("../assets/santuario/estilos/bastet-color/pie.png");
  --footer-decoration-height: 16.5cqw;
  --ink-left: 56; --ink-right: 1197;
  --ink-top: 16; --ink-bottom: 1212;
  --opening-left: 155; --opening-right: 1099;
  --opening-top: 156; --opening-bottom: 1135;
  --notice-paper: #e8edf7;
  --notice-trim: #3a407c;
  --notice-gem: #4a8edb;
  --outcome-tone: saturate(.84) hue-rotate(5deg);
}

[data-frame="lotos-color"] {
  --frame-asset: url("../assets/santuario/estilos/lotos-color/marco.png");
  --style-footer-art: url("../assets/santuario/estilos/lotos-color/pie.png");
  --footer-decoration-height: 12cqw;
  --ink-left: 23; --ink-right: 1231;
  --ink-top: 27; --ink-bottom: 1207;
  --opening-left: 162; --opening-right: 1092;
  --opening-top: 165; --opening-bottom: 1089;
  --notice-paper: #e4f1d7;
  --notice-trim: #40786b;
  --notice-gem: #87d7bc;
  --outcome-tone: saturate(.74) hue-rotate(13deg);
}

[data-frame="obsidiana-color"] {
  --frame-asset: url("../assets/santuario/estilos/obsidiana-color/marco.png");
  --style-footer-art: url("../assets/santuario/estilos/obsidiana-color/pie.png");
  --footer-decoration-height: 15cqw;
  --footer-clearance: 7cqw;
  --ink-left: 59; --ink-right: 1195;
  --ink-top: 59; --ink-bottom: 1198;
  --opening-left: 164; --opening-right: 1089;
  --opening-top: 172; --opening-bottom: 1093;
  --notice-paper: #e8e8e9;
  --notice-trim: #676572;
  --notice-gem: #e5e8fc;
  --outcome-tone: saturate(.35);
}

[data-frame="ambar-color"] {
  --frame-asset: url("../assets/santuario/estilos/ambar-color/marco.png");
  --style-footer-art: url("../assets/santuario/estilos/ambar-color/pie.png");
  --footer-decoration-height: 16cqw;
  --footer-clearance: 11cqw;
  --ink-left: 60; --ink-right: 1195;
  --ink-top: 63; --ink-bottom: 1193;
  --opening-left: 180; --opening-right: 1074;
  --opening-top: 181; --opening-bottom: 1073;
  --notice-paper: #f9dbab;
  --notice-trim: #9e4427;
  --notice-gem: #c64735;
  --outcome-tone: saturate(.9) hue-rotate(-10deg);
}

[data-frame="mosaico-color"] {
  --frame-asset: url("../assets/santuario/estilos/mosaico-color/marco.png");
  --style-footer-art: url("../assets/santuario/estilos/mosaico-color/pie.png");
  --footer-decoration-height: 14.5cqw;
  --footer-clearance: 8.6cqw;
  --ink-left: 53; --ink-right: 1201;
  --ink-top: 54; --ink-bottom: 1202;
  --opening-left: 164; --opening-right: 1090;
  --opening-top: 173; --opening-bottom: 1084;
  --notice-paper: #f5e8d0;
  --notice-trim: #a65f47;
  --notice-gem: #33599d;
  --outcome-tone: saturate(.67) sepia(.08);
}

.game[data-skin="santuario"] {
  --default-axis-size: clamp(.8rem, 4.2cqw, 1.4rem);
  --board-width: 100cqw;
  --frame-unit: calc(var(--board-width) / (var(--ink-right) - var(--ink-left)));
  --opening-width: calc((var(--opening-right) - var(--opening-left)) * var(--frame-unit));
  --opening-inset-top: calc((var(--opening-top) - var(--ink-top)) * var(--frame-unit));
  --opening-inset-bottom: calc((var(--ink-bottom) - var(--opening-bottom)) * var(--frame-unit));
  --frame-size: calc(var(--opening-inset-top) + var(--grid-side) +
    2 * var(--column-ruler-size) + var(--opening-inset-bottom));
}

.game[data-skin="santuario"] .board__frame {
  inline-size: var(--board-width);
  justify-self: center;
  isolation: isolate;
  overflow: clip;
  --grid-radius: .16rem;
}

.game[data-skin="santuario"] .board__frame::before {
  --shadow-feather: clamp(.45rem, 2.4cqw, 1.15rem);
  position: absolute;
  z-index: 0;
  inset: 0;
  background: #08091446;
  mask-image:
    linear-gradient(to right, transparent, #000 var(--shadow-feather), #000 calc(100% - var(--shadow-feather)), transparent),
    linear-gradient(to bottom, transparent, #000 var(--shadow-feather), #000 calc(100% - var(--shadow-feather)), transparent);
  mask-composite: intersect;
  pointer-events: none;
  content: "";
}

.game[data-skin="santuario"] .board__surface {
  position: absolute;
  z-index: 1;
  inset: var(--opening-inset-top)
    calc((var(--ink-right) - var(--opening-right)) * var(--frame-unit))
    var(--opening-inset-bottom)
    calc((var(--opening-left) - var(--ink-left)) * var(--frame-unit));
}

.game[data-skin="santuario"] .board__frame::after {
  --top-slice: 250;
  --bottom-slice: var(--frame-slice-bottom, 250);
  position: absolute;
  z-index: 2;
  inset: calc(-1 * var(--ink-top) * var(--frame-unit))
    calc((var(--ink-right) - 1254) * var(--frame-unit))
    calc((var(--ink-bottom) - 1254) * var(--frame-unit))
    calc(-1 * var(--ink-left) * var(--frame-unit));
  /* Las franjas superior e inferior conservan su escala; solo cambia la altura del centro. */
  border-image: var(--frame-asset) var(--top-slice) 0 var(--bottom-slice) fill /
    calc(var(--top-slice) * var(--frame-unit)) 0 calc(var(--bottom-slice) * var(--frame-unit)) / 0 stretch;
  pointer-events: none;
  content: "";
}
