/* Fonts bundled locally (offline play): Manrope, Cormorant Garamond — SIL OFL, see fonts/ */
@font-face{font-family:'Manrope';font-style:normal;font-display:swap;font-weight:400;src:url(fonts/manrope-cyrillic-400-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Manrope';font-style:normal;font-display:swap;font-weight:400;src:url(fonts/manrope-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Manrope';font-style:normal;font-display:swap;font-weight:500;src:url(fonts/manrope-cyrillic-500-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Manrope';font-style:normal;font-display:swap;font-weight:500;src:url(fonts/manrope-latin-500-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Manrope';font-style:normal;font-display:swap;font-weight:600;src:url(fonts/manrope-cyrillic-600-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Manrope';font-style:normal;font-display:swap;font-weight:600;src:url(fonts/manrope-latin-600-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Manrope';font-style:normal;font-display:swap;font-weight:700;src:url(fonts/manrope-cyrillic-700-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Manrope';font-style:normal;font-display:swap;font-weight:700;src:url(fonts/manrope-latin-700-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Manrope';font-style:normal;font-display:swap;font-weight:800;src:url(fonts/manrope-cyrillic-800-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Manrope';font-style:normal;font-display:swap;font-weight:800;src:url(fonts/manrope-latin-800-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-display:swap;font-weight:400;src:url(fonts/cormorant-garamond-cyrillic-400-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-display:swap;font-weight:400;src:url(fonts/cormorant-garamond-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-display:swap;font-weight:500;src:url(fonts/cormorant-garamond-cyrillic-500-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-display:swap;font-weight:500;src:url(fonts/cormorant-garamond-latin-500-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-display:swap;font-weight:600;src:url(fonts/cormorant-garamond-cyrillic-600-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-display:swap;font-weight:600;src:url(fonts/cormorant-garamond-latin-600-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-display:swap;font-weight:700;src:url(fonts/cormorant-garamond-cyrillic-700-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-display:swap;font-weight:700;src:url(fonts/cormorant-garamond-latin-700-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
:root {
  color-scheme: dark;
  --gold: #c7a66c;
  --muted: #777d78;
  --line: #292e29;
}
* {
  box-sizing: border-box;
}
/* 18.11: the page has a real size (every game element is position:fixed, so the body was 0 px tall);
   portal players that size their frame from the page (GamePix preview) showed the game at 300x150 */
html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
}
body {
  margin: 0;
  background: #111612;
  color: #e7e8dd;
  font-family: Manrope, Arial, sans-serif;
  font-size: 12px;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px 14px;
}
button:hover {
  border-color: var(--gold);
  color: var(--gold);
}
header {
  height: 88px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
  border-bottom: 1px solid var(--line);
}
a {
  color: inherit;
  text-decoration: none;
}
.brand {
  font-size: 22px;
  letter-spacing: 5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 14px;
}
.crest {
  font-size: 32px;
  color: var(--gold);
  letter-spacing: 0;
}
.brand small {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 2px;
  border-left: 1px solid #3c4137;
  padding-left: 18px;
  margin-left: 7px;
  max-width: 125px;
  line-height: 1.9;
}
.header-right {
  display: flex;
  gap: 12px;
  align-items: center;
}
.edition {
  font-size: 9px;
  letter-spacing: 2px;
  color: #71796e;
  margin-right: 20px;
}
main {
  max-width: 1500px;
  margin: auto;
  padding: 38px 5% 0;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 2.5px;
  color: var(--gold);
  font-weight: 700;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 7px 0 27px;
}
h1 {
  font:
    500 60px/1.15 "Cormorant Garamond",
    Georgia,
    serif;
  margin: 0;
  letter-spacing: -1px;
}
em {
  color: var(--gold);
  font-weight: 400;
}
.heading p {
  color: #90958b;
  line-height: 1.9;
  font-size: 11px;
}
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
}
.label {
  font-size: 9px;
  letter-spacing: 1.6px;
  color: #9a9e91;
  display: flex;
  justify-content: space-between;
  padding: 7px 0 18px;
}
.label span {
  color: #5b6558;
}
.world {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 16px 14px;
  background: #151b16;
}
.world.active {
  border-color: #6b6246;
  background: linear-gradient(120deg, #26291d, #192019);
}
.world-head {
  display: flex;
  gap: 11px;
  align-items: center;
}
.world-icon {
  font-size: 25px;
  color: #a0ac83;
}
.world:nth-child(2) .world-icon {
  color: #af936d;
}
.world:nth-child(3) .world-icon {
  color: #9aabc2;
}
.world h3 {
  font-size: 12px;
  margin: 0 0 5px;
  font-weight: 600;
}
.world small {
  font-size: 8px;
  color: #81897a;
  letter-spacing: 1px;
}
.world-levels {
  display: flex;
  gap: 7px;
  margin-top: 17px;
}
.world-levels button {
  flex: 1;
  padding: 8px 0;
  color: #6e786b;
  font-size: 10px;
  border-color: #323a30;
}
.world-levels button.selected {
  background: var(--gold);
  border-color: var(--gold);
  color: #25271c;
  font-weight: 800;
}
.world-levels button:disabled {
  cursor: default;
  opacity: 0.5;
}
.progress {
  padding: 22px 2px 20px;
}
.progress > span {
  font-size: 8px;
  color: #89907e;
  letter-spacing: 1.5px;
}
.progress strong {
  display: block;
  font-size: 27px;
  font-weight: 500;
  margin: 8px 0;
}
.progress i {
  font-style: normal;
  font-size: 14px;
  color: #5e695b;
}
.track {
  height: 3px;
  background: #2b3327;
}
.track div {
  height: 3px;
  background: var(--gold);
}
.tip {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.tip > span {
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 1.2px;
}
.tip p {
  color: #7e8978;
  line-height: 1.9;
  font-size: 11px;
}
.tip b {
  font-weight: 500;
  color: #c1c6b3;
}
.arena-wrap {
  min-width: 0;
  border: 1px solid #3b4031;
  border-radius: 8px;
  overflow: hidden;
  background: #161c16;
}
.arena-top {
  height: 46px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  font-size: 9px;
  letter-spacing: 1.4px;
  border-bottom: 1px solid #323a2b;
}
.arena-top > span {
  font-size: 8px;
  color: #7d8875;
}
.live-dot {
  display: inline-block;
  background: #bda370;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin: 0 9px 1px 0;
}
.arena {
  position: relative;
  overflow: hidden;
  background: #111b17;
  aspect-ratio: 1000/680;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.hud {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 4%;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.hud small {
  font-size: 7px;
  letter-spacing: 2px;
  color: #85937b;
  display: block;
  margin-bottom: 5px;
}
.hud strong {
  font-size: 18px;
  letter-spacing: 2px;
  font-weight: 500;
}
.hud-mid {
  text-align: center;
}
.lives {
  text-align: right;
}
.lives strong {
  color: var(--gold);
  font-size: 15px;
}
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: linear-gradient(#0b140f33, #0d180fba 35%, #0d180f9c);
  text-align: center;
}
.overlay.hidden {
  display: none;
}
.over-icon {
  color: var(--gold);
  font-size: 49px;
  margin-bottom: 16px;
  text-shadow: 0 0 40px #d0b17d55;
}
.overlay h2 {
  font:
    500 43px "Cormorant Garamond",
    Georgia,
    serif;
  margin: 12px 0 5px;
}
.overlay p {
  font-size: 11px;
  color: #b1b6a4;
  line-height: 1.9;
  margin: 0 0 23px;
}
.primary {
  background: #c7a66c;
  color: #202719;
  border: 1px solid #ddc08b;
  min-width: 190px;
  padding: 15px 22px;
  font-weight: 800;
  box-shadow: 0 0 30px #b3985720;
}
.primary:hover {
  background: #e1c18a;
  color: #171e15;
}
.primary span {
  margin-left: 28px;
}
.overlay > small {
  font-size: 7px;
  letter-spacing: 1.5px;
  color: #7d8c71;
  margin-top: 17px;
}
.arena-bottom {
  position: absolute;
  bottom: 15px;
  left: 22px;
  right: 22px;
  display: flex;
  justify-content: space-between;
  font-size: 7px;
  letter-spacing: 1.6px;
  color: #7f906e;
  pointer-events: none;
}
.controls {
  height: 48px;
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 0 17px;
  border-top: 1px solid #2b3528;
  color: #7e8975;
  font-size: 9px;
}
.controls > div {
  flex: 1;
  display: flex;
  gap: 5px;
  align-items: center;
}
.controls button {
  border: 0;
  font-size: 10px;
  padding: 5px;
}
kbd {
  border: 1px solid #414b37;
  border-radius: 3px;
  min-width: 18px;
  text-align: center;
  padding: 2px 4px;
  font:
    8px Manrope,
    Arial;
}
.divider {
  height: 12px;
  border-left: 1px solid #37402f;
  margin: 0 8px;
}
.arsenal {
  display: flex;
  gap: 28px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}
.arsenal-title {
  width: 240px;
  flex-shrink: 0;
}
.arsenal-title .eyebrow {
  font-size: 7px;
  letter-spacing: 1.8px;
}
.arsenal h3 {
  font:
    500 22px/1.2 "Cormorant Garamond",
    Georgia,
    serif;
  margin: 9px 0;
}
.arsenal h3 em {
  display: block;
}
.materials {
  display: flex;
  justify-content: space-between;
  flex: 1;
  gap: 7px;
}
.material {
  text-align: center;
  flex: 1;
}
.brick {
  width: 42px;
  height: 24px;
  position: relative;
  margin: 3px auto 14px;
  background: var(--c);
  border: 1px solid #ffffff25;
  box-shadow: 4px 5px 0 color-mix(in srgb, var(--c), #000 50%);
  transform: skewY(-6deg);
}
.brick:after {
  content: "";
  position: absolute;
  inset: 4px;
  border-top: 1px solid #ffffff30;
  border-bottom: 1px solid #0003;
}
.material strong {
  font-size: 9px;
  font-weight: 500;
  display: block;
}
.material small {
  font-size: 7px;
  letter-spacing: 1px;
  color: #76816c;
  display: block;
  margin-top: 5px;
}
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0;
  color: #5e6c58;
  font-size: 8px;
  letter-spacing: 1px;
}
footer > span:first-child {
  font-weight: 800;
  letter-spacing: 2px;
}
footer b {
  margin: 0 8px;
  color: #a78d58;
}
#toast {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translateX(-50%);
  color: #ffe0a1;
  font-size: 19px;
  letter-spacing: 2px;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 2px 10px #000;
  transition: opacity 0.4s;
  opacity: 0;
}
dialog {
  max-width: 480px;
  background: #1a241c;
  color: #dfe4d3;
  border: 1px solid #776848;
  padding: 35px;
  border-radius: 10px;
}
dialog::backdrop {
  background: #050b08ce;
}
dialog h2 {
  font: 32px Georgia;
}
dialog p {
  line-height: 1.9;
  color: #a7b39c;
}
.close {
  position: absolute;
  right: 10px;
  top: 8px;
  font-size: 22px;
  border: 0;
}
.close-help {
  margin-top: 12px;
}
@media (min-width: 1500px) {
  main {
    padding-top: 44px;
  }
  .layout {
    grid-template-columns: 255px 1fr;
  }
  .arsenal-title {
    width: 255px;
  }
}
@media (max-width: 900px) {
  header {
    padding: 0 4%;
    height: 70px;
  }
  .edition,
  .brand small {
    display: none;
  }
  main {
    padding: 25px 4% 0;
  }
  .layout {
    grid-template-columns: 180px 1fr;
    gap: 16px;
  }
  h1 {
    font-size: 48px;
  }
  .arsenal-title {
    width: 180px;
  }
  .arena-top {
    padding: 0 12px;
    letter-spacing: 0.5px;
  }
  .arena-top > span {
    display: none;
  }
  .controls {
    gap: 3px;
    padding: 0 8px;
  }
  .controls .divider {
    margin: 0 3px;
  }
  .controls button span {
    display: none;
  }
  .arsenal {
    gap: 16px;
  }
  .material strong {
    font-size: 8px;
  }
}
@media (max-width: 640px) {
  header {
    height: 65px;
  }
  .brand {
    font-size: 18px;
    gap: 8px;
  }
  .header-right button {
    padding: 7px 9px;
    font-size: 10px;
  }
  .header-right #help span {
    display: none;
  }
  .heading {
    margin-bottom: 20px;
  }
  .heading p {
    display: none;
  }
  h1 {
    font-size: 44px;
  }
  .eyebrow {
    font-size: 7px;
  }
  .layout {
    display: flex;
    flex-direction: column-reverse;
    gap: 18px;
  }
  .arena {
    aspect-ratio: 1000/850;
  }
  .arena canvas {
    height: 100%;
  }
  .overlay h2 {
    font-size: 35px;
  }
  .overlay .over-icon {
    font-size: 34px;
    margin-bottom: 8px;
  }
  .overlay p {
    margin-bottom: 15px;
  }
  .overlay > small {
    font-size: 6px;
  }
  .hud strong {
    font-size: 14px;
  }
  aside {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
  }
  .label {
    grid-column: 1/-1;
    padding: 0;
  }
  .world {
    padding: 12px 8px;
    margin: 0;
  }
  .world-head {
    gap: 5px;
  }
  .world-icon {
    font-size: 18px;
  }
  .world h3 {
    font-size: 9px;
  }
  .world small {
    font-size: 6px;
  }
  .world-levels {
    gap: 4px;
    margin-top: 12px;
  }
  .world-levels button {
    font-size: 8px;
  }
  .progress,
  .tip {
    display: none;
  }
  .arsenal {
    display: block;
    padding: 25px 0;
  }
  .arsenal-title {
    width: auto;
    margin-bottom: 20px;
  }
  .arsenal h3 em {
    display: inline;
  }
  .arsenal h3 {
    font-size: 24px;
  }
  .materials {
    gap: 3px;
  }
  .brick {
    width: 34px;
    height: 20px;
  }
  .material strong {
    font-size: 8px;
  }
  .material small {
    font-size: 6px;
  }
  footer {
    font-size: 7px;
  }
  footer > span:last-child {
    display: none;
  }
  .controls {
    font-size: 8px;
  }
  .arena-bottom {
    font-size: 6px;
    left: 14px;
    right: 14px;
    bottom: 10px;
  }
}
/* Vivid siege edition */
:root {
  --gold: #ffd078;
  --muted: #a1b7b1;
  --line: #36564c;
}
body {
  background:
    radial-gradient(ellipse at 80% 15%, #153c48 0, transparent 45%),
    radial-gradient(ellipse at 0 55%, #184c38 0, transparent 50%), #0d2026;
  color: #f1f5e6;
}
header {
  background: #102c30b3;
  border-bottom-color: #365e59;
}
.crest {
  color: #ffd078;
  text-shadow: 0 0 24px #ffd07855;
}
.eyebrow {
  color: #ffd078;
}
.heading p {
  color: #9dbeb4;
}
.world {
  background: linear-gradient(120deg, #193c3b, #153033);
  border-color: #365851;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.world:hover {
  transform: translateX(3px);
}
.world.active {
  background: linear-gradient(120deg, #3e5332, #1b4440);
  border-color: #d2b66e;
  box-shadow: 0 0 25px #e6c96b12;
}
.world-icon {
  color: #a4eea9;
}
.world:nth-child(2) .world-icon {
  color: #ffc478;
}
.world:nth-child(3) .world-icon {
  color: #88e5ff;
}
.world small {
  color: #a4beb2;
}
.world-levels button {
  color: #a3c4b6;
  border-color: #476a5b;
  transition:
    background 0.2s,
    transform 0.2s;
}
.world-levels button:enabled:hover {
  transform: translateY(-2px);
  background: #47725d;
}
.world-levels button.selected {
  color: #263b32;
  background: #ffce78;
}
.arena-wrap {
  background: #143a40;
  border-color: #62877b;
  box-shadow:
    0 18px 70px #0005,
    0 0 35px #6ce3c817;
}
.arena-top {
  background: #15393f;
  border-color: #3e655e;
}
.arena-top > span {
  color: #a1c8bf;
}
.live-dot {
  background: #83f2ac;
  box-shadow: 0 0 9px #83f2ac;
}
.hud small {
  color: #c2e3ce;
  text-shadow: 0 1px 4px #000;
}
.hud strong {
  color: #fff6ce;
  text-shadow: 0 2px 8px #000;
}
.overlay {
  background: linear-gradient(#0b243414, #0b2434a6 40%, #0b243475);
  backdrop-filter: blur(1px);
}
.overlay h2 {
  text-shadow: 0 3px 16px #0005;
}
.overlay p {
  color: #e0ead4;
}
.overlay > small {
  color: #c0d6b9;
}
.primary {
  background: linear-gradient(120deg, #ffe095, #ffb865);
  color: #25352c;
  border-color: #ffdfa2;
  box-shadow: 0 8px 26px #ffb55830;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 35px #ffb55855;
}
.over-icon {
  color: #ffda80;
  filter: drop-shadow(0 0 16px #ffd38355);
}
.arena-bottom {
  color: #d3e9ba;
  text-shadow: 0 1px 4px #06160b;
}
.controls {
  background: #14363c;
  color: #b5cfc3;
  border-color: #43665c;
  height: 52px;
}
.controls button {
  color: #c3ddd1;
}
kbd {
  border-color: #6a8d7c;
  color: #e3edce;
}
.tip p {
  color: #acc2ae;
}
.tip b {
  color: #e9e7b9;
}
.label {
  color: #bad6c6;
}
.label span {
  color: #7da99b;
}
.progress > span {
  color: #a2c4af;
}
.progress i {
  color: #90b19f;
}
.track {
  background: #2c4f42;
}
#toast {
  top: 68%;
  width: 90%;
  font-size: 14px;
  color: #fff2b1;
  font-weight: 800;
  letter-spacing: 1px;
  background: #153344d9;
  padding: 13px 18px;
  border-radius: 8px;
  border: 1px solid #ffdc8e75;
  box-shadow: 0 5px 25px #0004;
  z-index: 2;
}
.siege-track {
  height: 3px;
  background: #244744;
}
.siege-track > div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #70e2b7, #ffe08c);
  box-shadow: 0 0 12px #b8ed9c;
  transition: width 0.2s;
}
.bonus-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  min-height: 42px;
  padding: 8px 14px;
  background: #112e34;
  border-top: 1px solid #39635a;
}
.buff-empty {
  font-size: 9px;
  color: #9bbbaf;
  letter-spacing: 0.4px;
}
.buff {
  color: var(--buff);
  border: 1px solid color-mix(in srgb, var(--buff), transparent 65%);
  background: color-mix(in srgb, var(--buff), transparent 93%);
  padding: 5px 7px;
  border-radius: 5px;
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 9px;
}
.buff b {
  background: var(--buff);
  color: #162738;
  border-radius: 3px;
  padding: 0 3px;
}
.buff strong {
  font-size: 8px;
}
#fire {
  border: 1px solid #5f7380;
  padding: 7px 10px;
  touch-action: none;
}
#fire:disabled {
  opacity: 0.3;
  cursor: default;
}
#fire.armed {
  color: #ffccd7;
  border-color: #ff7b9c;
  background: #7c334a;
  animation: armedPulse 1.3s infinite;
}
.loot-section {
  padding: 35px 0 25px;
  border-bottom: 1px solid #36564c;
}
.loot-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 19px;
}
.loot-heading h3 {
  font:
    500 30px "Cormorant Garamond",
    Georgia,
    serif;
  margin: 8px 0;
}
.loot-heading p {
  font-size: 10px;
  line-height: 1.8;
  color: #a2bfb3;
}
.loot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.loot-card {
  display: flex;
  align-items: center;
  gap: 13px;
  background: linear-gradient(130deg, color-mix(in srgb, var(--loot), transparent 91%), #112d32);
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--loot), transparent 75%);
  border-radius: 7px;
  transition:
    transform 0.2s,
    border-color 0.2s;
}
.loot-card:hover {
  transform: translateY(-3px);
  border-color: var(--loot);
}
.capsule {
  flex-shrink: 0;
  background: var(--loot);
  box-shadow: 0 0 17px color-mix(in srgb, var(--loot), transparent 75%);
  border: 2px solid #ffffff44;
  border-radius: 20px;
  width: 40px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #102638;
  font-weight: 800;
  font-size: 15px;
}
.loot-card strong {
  display: block;
  color: #e7f0e5;
  font-size: 11px;
}
.loot-card small {
  display: block;
  color: #98b7ac;
  font-size: 8px;
  margin-top: 5px;
}
.material strong {
  color: #d9e7d4;
}
.material small {
  color: #96b6a2;
}
footer {
  color: #87aa9a;
}
.brick {
  transition: transform 0.2s;
}
.material:hover .brick {
  transform: skewY(-6deg) translateY(-4px);
}
body[data-world="1"] {
  background: radial-gradient(ellipse at 80% 15%, #653b50 0, transparent 55%), #28252e;
}
body[data-world="2"] {
  background: radial-gradient(ellipse at 80% 15%, #2a4773 0, transparent 55%), #142338;
}
@keyframes armedPulse {
  50% {
    box-shadow: 0 0 18px #ff64836b;
  }
}
@media (max-width: 900px) {
  .loot-card {
    padding: 12px 10px;
    gap: 9px;
  }
  .loot-card strong {
    font-size: 10px;
  }
  .controls .divider {
    margin: 0 2px;
  }
  .controls > div {
    font-size: 8px;
  }
}
@media (max-width: 640px) {
  .loot-heading {
    display: block;
  }
  .loot-heading h3 {
    font-size: 27px;
  }
  .loot-heading p {
    display: none;
  }
  .loot-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .loot-card {
    padding: 12px 9px;
  }
  .loot-card small {
    font-size: 7px;
  }
  .controls {
    gap: 5px;
    flex-wrap: wrap;
    height: auto;
    min-height: 50px;
    padding: 10px;
  }
  .controls > div {
    flex-basis: 100%;
    justify-content: center;
    margin-bottom: 5px;
  }
  .controls button {
    flex: 1;
  }
  .controls button span {
    display: inline;
  }
  .bonus-bar {
    min-height: 35px;
    padding: 6px 9px;
  }
  .buff {
    font-size: 8px;
  }
  .buff-empty {
    font-size: 8px;
  }
  .heading {
    margin-bottom: 17px;
  }
  #toast {
    font-size: 10px;
    padding: 9px;
    top: 67%;
  }
  .loot-section {
    padding-top: 24px;
  }
  .arena-top {
    height: 38px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.overlay p {
  max-width: 78%;
}
.overlay .eyebrow {
  max-width: 90%;
  line-height: 1.8;
}

.three-preview {
  border: 1px solid #96d3bd80;
  border-radius: 5px;
  padding: 10px 12px;
  color: #bcf2db;
  font-size: 10px;
  background: #305c5255;
  transition: background 0.2s;
}
.three-preview:hover {
  background: #3c796a;
}
@media (max-width: 640px) {
  .three-preview {
    font-size: 8px;
    padding: 8px;
  }
  .header-right {
    gap: 6px;
  }
  #sound {
    display: none;
  }
}

.platform-picker {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  background: #112e34;
  padding: 9px 15px;
  border-top: 1px solid #39635a;
}
.platform-picker > span {
  font-size: 8px;
  letter-spacing: 1.3px;
  color: #b6cfc0;
}
.platform-picker > small {
  margin-left: auto;
  font-size: 8px;
  color: #ffcd96;
}
#platformColors {
  display: flex;
  gap: 9px;
}
.platform-swatch {
  width: 24px;
  height: 24px;
  min-width: 24px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #7d9b8d;
  background: var(--swatch);
  box-shadow: 0 0 9px color-mix(in srgb, var(--edge), transparent 65%);
  position: relative;
}
.platform-swatch[aria-pressed="true"] {
  outline: 2px solid var(--edge);
  outline-offset: 3px;
  border-color: #fff4cf;
}
.platform-swatch[aria-pressed="true"]:after {
  content: "✓";
  font-size: 12px;
  color: var(--edge);
  position: absolute;
  right: -6px;
  top: -8px;
  text-shadow: 0 1px 3px #000;
  background: #17343e;
  border-radius: 50%;
  width: 13px;
  height: 13px;
}
.platform-swatch:focus-visible {
  outline: 3px solid #ffcd96;
  outline-offset: 4px;
}
@media (max-width: 640px) {
  .platform-picker {
    padding: 10px;
    gap: 12px;
  }
  .platform-picker > small {
    width: 100%;
    margin: 0;
    font-size: 7px;
  }
  .platform-picker > span {
    font-size: 7px;
  }
}

.platform-swatch:hover {
  background: var(--swatch);
  border-color: var(--edge);
  box-shadow: 0 0 15px color-mix(in srgb, var(--edge), transparent 40%);
}

/* The playable 3D scene occupies the same arena and shares all game controls. */
#game3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hud,
.arena-bottom {
  z-index: 2;
}
.hud {
  pointer-events: none;
}
.overlay {
  z-index: 4;
  backdrop-filter: none;
  background: linear-gradient(#0b243419, #0b243498 45%, #0b24344d);
}
.mode-badge {
  font-size: 8px;
  color: #baffd1;
  border: 1px solid #8fe4b250;
  border-radius: 3px;
  padding: 4px 7px;
  white-space: nowrap;
}
.arena-top {
  gap: 10px;
}
.arena-top > div {
  flex: 1;
}
.view-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #112d37;
  padding: 8px 13px;
  border-bottom: 1px solid #476d65;
}
.view-controls > span {
  font-size: 7px;
  letter-spacing: 1.5px;
  color: #a3c2b4;
  margin-right: 5px;
}
.view-controls button {
  font-size: 8px;
  padding: 7px 9px;
  color: #bad6c8;
  border-color: #47655d;
}
.view-controls button[aria-pressed="true"] {
  color: #ffda8e;
  background: #6c62322b;
  border-color: #b5a263;
}
.view-controls #fullScreen {
  margin-left: auto;
}
.arena-wrap:fullscreen {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100dvh;
  border-radius: 0;
}
.arena-wrap:fullscreen .arena {
  flex: 1;
  aspect-ratio: auto;
  min-height: 0;
}
.arena-wrap:fullscreen .arena canvas {
  height: 100%;
  width: 100%;
}
.arena-wrap:fullscreen .platform-picker {
  justify-content: center;
}
.arena-wrap:fullscreen .platform-picker > small {
  margin-left: 20px;
}
.arena-wrap:fullscreen .controls {
  justify-content: center;
}
.arena-wrap:fullscreen .controls > div {
  flex: initial;
}
.arena-wrap:fullscreen .bonus-bar {
  justify-content: center;
}
#toast {
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  border-radius: 0;
  padding: 0 !important;
  color: #ffd781;
  text-decoration: none !important;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.5px;
  top: 72%;
  width: auto;
  max-width: 85%;
  white-space: nowrap;
  text-shadow: 0 1px 7px #56371680;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.22s;
}
#toast::before,
#toast::after {
  content: none !important;
}
.arena.orbit #game {
  cursor: grab;
}
.arena.orbit #game:active {
  cursor: grabbing;
}
@media (max-width: 640px) {
  .view-controls {
    padding: 7px;
    gap: 5px;
  }
  .view-controls > span {
    display: none;
  }
  .view-controls button {
    font-size: 7px;
    padding: 7px 6px;
  }
  .view-controls #fullScreen {
    font-size: 0;
  }
  .view-controls #fullScreen:after {
    content: "⛶";
    font-size: 15px;
  }
  .mode-badge {
    font-size: 6px;
    padding: 3px 4px;
  }
  .arena-top > span#difficulty {
    display: none;
  }
  #toast {
    font-size: 13px;
    top: 74%;
  }
  .arena {
    aspect-ratio: 1000/850;
  }
  .arena-wrap:fullscreen .view-controls {
    flex-shrink: 0;
  }
  .arena-wrap:fullscreen .platform-picker > small {
    display: none;
  }
}
.arena.orbit .overlay {
  pointer-events: none;
  background: transparent;
}
.arena.orbit .overlay > * {
  display: none;
}
.arena.orbit .overlay #start {
  display: block;
  pointer-events: auto;
  position: absolute;
  bottom: 45px;
  right: 20px;
  min-width: 150px;
  font-size: 10px;
  padding: 11px 17px;
}
.arena.orbit .hud {
  opacity: 0.65;
}
.arena.orbit .arena-bottom {
  opacity: 0.6;
}

.arena-wrap.expanded {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100dvh;
  border-radius: 0;
}
.arena-wrap.expanded .arena {
  flex: 1;
  aspect-ratio: auto;
  min-height: 0;
}
.arena-wrap.expanded .arena canvas {
  height: 100%;
  width: 100%;
}
.arena-wrap.expanded .controls {
  flex-shrink: 0;
}
.arena-wrap.expanded .platform-picker > small {
  margin-left: 20px;
}
.arena-wrap.expanded .bonus-bar {
  justify-content: center;
}
@media (max-width: 640px) {
  .arena-wrap.expanded .platform-picker > small {
    display: none;
  }
}

.game-versions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  margin: 0 0 22px;
  border: 1px solid #47776a;
  border-radius: 8px;
  background: linear-gradient(110deg, #163d3e, #12343d);
}
.game-versions > span {
  font-size: 8px;
  color: #9fc0b2;
  letter-spacing: 1.5px;
  margin-right: 5px;
}
.game-versions a {
  font-size: 11px;
  font-weight: 600;
  color: #b6d4c6;
  border: 1px solid #42695c;
  border-radius: 5px;
  padding: 10px 13px;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.game-versions a:hover {
  background: #315746;
  border-color: #b9c68e;
}
.game-versions a[aria-current="page"] {
  color: #20372d;
  background: linear-gradient(120deg, #ffe09a, #e6b46f);
  border-color: #ffdfa0;
  box-shadow: 0 0 18px #eac77518;
}
.game-versions a:focus-visible {
  outline: 3px solid #ffdf9a;
  outline-offset: 3px;
}
.game-versions > small {
  margin-left: auto;
  color: #9ab9a8;
  font-size: 8px;
}
@media (max-width: 900px) {
  .game-versions > small {
    display: none;
  }
}
@media (max-width: 640px) {
  .game-versions {
    gap: 8px;
    padding: 11px;
    margin-bottom: 17px;
    flex-wrap: wrap;
  }
  .game-versions > span {
    width: 100%;
    font-size: 7px;
    margin-bottom: 2px;
  }
  .game-versions a {
    flex: 1;
    text-align: center;
    font-size: 10px;
    padding: 10px 7px;
  }
}

.upgrade-shop {
  padding: 12px 15px;
  background: #102f34;
  border-top: 1px solid #3b6559;
}
.upgrade-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 10px;
}
.upgrade-heading > span {
  font-size: 8px;
  letter-spacing: 1.5px;
  color: #c9d9b7;
}
.upgrade-heading > strong {
  font-size: 10px;
  color: #ffd486;
  font-weight: 500;
}
.upgrade-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.upgrade-options button {
  padding: 10px 11px;
  text-align: left;
  background: #24483d;
  border-color: #79936d;
}
.upgrade-options button b {
  font-size: 9px;
  display: block;
  font-weight: 600;
  color: #e7edca;
}
.upgrade-options button i {
  font-size: 8px;
  font-style: normal;
  color: #a7c5a6;
  float: right;
}
.upgrade-options button small {
  font-size: 8px;
  color: #ffd28c;
  display: block;
  margin-top: 5px;
}
.upgrade-options button:disabled {
  opacity: 0.55;
  cursor: default;
}
.upgrade-shop > small {
  display: block;
  color: #91b4a4;
  font-size: 7px;
  margin-top: 9px;
}
.arena.pastoral {
  aspect-ratio: 1440/840;
}
.pastoral .hud {
  left: 20%;
  right: 20%;
  top: 5%;
}
.pastoral .arena-bottom {
  left: 20%;
  right: 20%;
  bottom: 5%;
}
.pastoral .overlay {
  background: linear-gradient(#15322811, #15322888, #15322822);
}
@media (max-width: 640px) {
  .arena.pastoral {
    aspect-ratio: 1100/840;
  }
  .pastoral .hud {
    left: 12%;
    right: 12%;
  }
  .pastoral .arena-bottom {
    left: 10%;
    right: 10%;
  }
  .upgrade-shop {
    padding: 10px;
  }
  .upgrade-options {
    gap: 5px;
  }
  .upgrade-options button {
    padding: 9px 7px;
  }
  .upgrade-options button b {
    font-size: 8px;
  }
  .upgrade-heading > span {
    font-size: 7px;
  }
}

.upgrade-heading {
  cursor: pointer;
  list-style: none;
}
.upgrade-heading::-webkit-details-marker {
  display: none;
}
.upgrade-heading:after {
  content: "⌄";
  color: #dfc286;
}
.upgrade-shop[open] .upgrade-heading:after {
  content: "⌃";
}
.upgrade-shop:not([open]) .upgrade-heading {
  margin-bottom: 0;
}
.upgrade-heading > strong {
  margin-left: auto;
}
.building-legend {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 7px;
  padding: 9px 12px;
  background: #193c36;
  border-top: 1px solid #416050;
  color: #c5d4ac;
  font-size: 8px;
}
.arena-wrap:fullscreen .building-legend,
.arena-wrap.expanded .building-legend {
  flex-shrink: 0;
}
.arena-wrap:fullscreen .upgrade-shop,
.arena-wrap.expanded .upgrade-shop {
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .building-legend {
    font-size: 6px;
    padding: 7px;
    gap: 4px;
  }
  .building-legend > span {
    white-space: nowrap;
  }
}

/* Classic mode: the castle, ball and paddle fill the frame; scenery is a narrow border. */
body[data-mode="classic"] .arena.pastoral {
  aspect-ratio: 1040/710;
}
body[data-mode="classic"] .pastoral .hud {
  left: 8%;
  right: 8%;
  top: 3.5%;
}
body[data-mode="classic"] .pastoral .arena-bottom {
  left: 8%;
  right: 8%;
  bottom: 3%;
}
@media (max-width: 640px) {
  body[data-mode="classic"] .arena.pastoral {
    aspect-ratio: 1000/710;
  }
  body[data-mode="classic"] .pastoral .hud {
    left: 7%;
    right: 7%;
  }
  body[data-mode="classic"] .pastoral .arena-bottom {
    left: 7%;
    right: 7%;
  }
}

/* Round view: the viewport belongs to the game; preparation lives outside the round. */
.between-round-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px;
  background: #163c37;
  border-top: 1px solid #3f6857;
}
.between-round-actions p {
  color: #b9c9a8;
  font-size: 10px;
  line-height: 1.6;
  margin: 0;
}
.between-round-actions .primary {
  padding: 12px 17px;
  font-size: 11px;
}
.leave-round {
  display: none;
  margin-top: 12px;
  font-size: 11px;
  color: #f4d2ac;
  border-color: #b39b6b55;
}
#launchPrompt {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 16%;
  transform: translateX(-50%);
  font-size: 17px;
  color: #ffe1a0;
  text-align: center;
  width: 85%;
  pointer-events: none;
  z-index: 3;
  text-shadow: 0 1px 5px #22332a;
}
body.round-view {
  overflow: hidden;
  overscroll-behavior: none;
  background: #0d201f;
}
body.round-view > header,
body.round-view main > .eyebrow,
body.round-view .heading,
body.round-view .game-versions,
body.round-view .layout > aside,
body.round-view .loot-section,
body.round-view .arsenal,
body.round-view footer {
  display: none !important;
}
body.round-view main,
body.round-view .layout {
  margin: 0;
  padding: 0;
  max-width: none;
  display: block;
}
body.round-view .arena-wrap {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000;
  display: block !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 100%;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none;
  background: #0c1e21;
  overflow: hidden;
}
body.round-view .arena-wrap > .arena-top,
body.round-view .arena-wrap > .view-controls,
body.round-view .siege-track,
body.round-view .platform-picker,
body.round-view .upgrade-shop,
body.round-view .building-legend,
body.round-view .between-round-actions {
  display: none !important;
}
body.round-view .arena-wrap > .arena {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: auto !important;
  min-height: 0;
  background: #0c1e21;
}
body.round-view #game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
body.round-view #game3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
body.round-view .hud {
  left: max(18px, env(safe-area-inset-left));
  right: max(86px, calc(env(safe-area-inset-right) + 70px));
  top: max(14px, env(safe-area-inset-top));
  opacity: 1;
}
.round-view .hud-mid {
  display: none;
}
.round-view .hud small {
  font-size: 9px;
}
.round-view .hud strong {
  font-size: clamp(16px, 2.2vw, 25px);
  font-weight: 600;
}
.round-view .lives strong {
  font-size: clamp(14px, 1.9vw, 21px);
}
body.round-view .arena-bottom {
  display: none;
}
body.round-view .controls {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  padding: 0;
  background: none;
  border: 0;
  pointer-events: none;
}
.round-view .controls > div,
.round-view #restart {
  display: none !important;
}
.round-view .controls button {
  position: absolute;
  pointer-events: auto;
  display: grid;
  place-items: center;
  border: 1px solid #d5cd9b66;
  background: #17352966;
  backdrop-filter: blur(3px);
  color: #fff1c7;
  border-radius: 50%;
  font-size: 24px;
  min-width: 48px;
  min-height: 48px;
  padding: 8px;
}
.round-view #pause {
  top: max(10px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
}
.round-view #pause span,
.round-view #fire span {
  display: none;
}
.round-view #fire {
  bottom: max(24px, env(safe-area-inset-bottom));
  right: max(20px, env(safe-area-inset-right));
  width: 64px;
  height: 64px;
  background: #74412f66;
  border-color: #ffd58c88;
  font-size: 30px;
}
.round-view #fire:disabled {
  display: none;
}
.round-view #activeBonuses {
  position: absolute;
  z-index: 3;
  left: max(15px, env(safe-area-inset-left));
  bottom: max(15px, env(safe-area-inset-bottom));
  padding: 0;
  background: none;
  border: 0;
  min-height: 0;
  max-width: calc(100% - 115px);
  gap: 8px;
  pointer-events: none;
}
.round-view .buff-empty {
  display: none;
}
.round-view .buff {
  background: none;
  border: 0;
  font-size: clamp(10px, 1.2vw, 14px);
  padding: 2px;
  text-shadow: 0 1px 5px #143323;
}
.round-view .buff strong {
  font-size: inherit;
}
.round-view .buff b {
  font-size: 10px;
}
.round-view .overlay {
  background: linear-gradient(#0b1b2b66, #0b1b2bba);
  z-index: 5;
}
.round-view[data-round-state="paused"] .leave-round {
  display: block;
}
.round-view[data-round-state="ready"] #launchPrompt {
  display: block;
}
.round-view #toast {
  top: auto;
  bottom: 23%;
  font-size: clamp(15px, 2vw, 23px);
}
.round-view .over-icon {
  font-size: 44px;
}
.round-view .overlay h2 {
  font-size: clamp(32px, 5vw, 60px);
}
.round-view .overlay p {
  font-size: 13px;
}
.round-view .overlay > small {
  font-size: 9px;
}
@media (max-width: 640px) {
  .between-round-actions {
    flex-direction: column;
    gap: 10px;
  }
  .between-round-actions .primary {
    width: 100%;
  }
  body.round-view .hud {
    right: 76px;
    left: 12px;
  }
  .round-view .controls button {
    min-width: 44px;
    min-height: 44px;
  }
  .round-view #launchPrompt {
    font-size: 14px;
  }
  .round-view .buff {
    font-size: 10px;
  }
  .round-view .overlay p {
    font-size: 11px;
  }
}

body.round-view[data-mode="classic"] .pastoral .hud {
  left: max(18px, env(safe-area-inset-left));
  right: max(86px, calc(env(safe-area-inset-right) + 70px));
  top: max(14px, env(safe-area-inset-top));
}
.round-view[data-round-state="paused"] #fire {
  display: none;
}
@media (max-width: 640px) {
  body.round-view[data-mode="classic"] .pastoral .hud {
    left: 12px;
    right: 76px;
    top: 12px;
  }
}

/* Leave the lower classic flight lane free for the lowered paddle. */
body.round-view[data-mode="classic"] #activeBonuses {
  bottom: auto;
  top: max(61px, calc(env(safe-area-inset-top) + 50px));
  max-width: calc(100% - 100px);
}
body.round-view[data-mode="classic"] .buff {
  font-size: 0;
  gap: 4px;
}
body.round-view[data-mode="classic"] .buff b,
body.round-view[data-mode="classic"] .buff strong {
  font-size: 11px;
}

.starter-shop {
  padding: 15px;
  border-top: 1px solid #617e66;
  background: #183a33;
}
.starter-shop p {
  font-size: 12px;
  color: #edcf8a;
  margin: 0 0 10px;
}
.starter-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 7px;
}
.starter-options button {
  font-size: 11px;
  text-align: left;
  color: #ffe1a0;
  border: 1px solid #697b5c;
  padding: 11px;
  background: #26483b;
}
.starter-options button:disabled {
  opacity: 0.45;
  cursor: default;
}
.starter-shop > small {
  display: block;
  font-size: 10px;
  line-height: 1.6;
  color: #b1c6a5;
  margin-top: 10px;
}
.boss-status {
  position: absolute;
  z-index: 5;
  top: 13%;
  left: 12%;
  right: 12%;
  pointer-events: none;
  text-align: center;
  color: #ffdf95;
  font-size: clamp(11px, 1.5vw, 17px);
  font-weight: 700;
  text-shadow: 0 2px 3px #15251c;
}
.boss-status[hidden] {
  display: none;
}
.round-view .starter-shop {
  display: none !important;
}
.upgrade-options {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

/* ===== Portal / game-only page (data-portal="1"): no landing, camp between rounds ===== */
body[data-portal="1"] .arena::after {
  content: "ЗАГРУЗКА…";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffe2a0;
  letter-spacing: 0.25em;
  font-size: 13px;
  font-weight: 700;
  background: #0c1e21;
  z-index: 30;
  pointer-events: none;
}
body[data-portal="1"][data-booted="1"] .arena::after {
  display: none;
}
body[data-portal="1"]:not([data-booted="1"]) #camp {
  display: none !important;
}
body[data-portal="1"] #camp {
  display: none;
}
body[data-portal="1"][data-session="between"] #camp {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 40;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(#071514e6, #0b1d1cf2);
  backdrop-filter: blur(4px);
}
body[data-portal="1"][data-session="between"] #overlay,
body[data-portal="1"][data-session="between"] .controls,
body[data-portal="1"][data-session="between"] #launchPrompt,
body[data-portal="1"][data-session="between"] #activeBonuses {
  display: none !important;
}
.camp-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 28px
    max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.camp-head {
  text-align: center;
  padding: 8px 0 2px;
}
.camp-head .eyebrow {
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 700;
}
.camp-head h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(32px, 7vw, 54px);
  margin: 6px 0 4px;
  color: #fff4d6;
}
.camp-head p {
  margin: 0;
  color: #cfd6c4;
  font-size: 13px;
  line-height: 1.5;
}
body[data-portal="1"] #camp .between-round-actions {
  display: flex !important;
  position: sticky;
  top: 0;
  z-index: 2;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #c7a66c66;
  border-radius: 10px;
  background: #102a26f2;
}
body[data-portal="1"] #camp .between-round-actions p {
  margin: 0;
  color: #d9dfcf;
  font-size: 12px;
}
body[data-portal="1"] #camp #startRound {
  font-size: 17px;
  padding: 14px 26px;
  min-height: 52px;
}
body[data-portal="1"] #camp .platform-picker,
body[data-portal="1"] #camp .upgrade-shop,
body[data-portal="1"] #camp .starter-shop,
body[data-portal="1"] #camp .view-controls {
  display: block !important;
}
body[data-portal="1"] #camp .upgrade-shop,
body[data-portal="1"] #camp .starter-shop,
body[data-portal="1"] #camp .platform-picker,
body[data-portal="1"] #camp .camp-block,
body[data-portal="1"] #camp .camp-settings {
  border: 1px solid #3c5b4c;
  border-radius: 10px;
  overflow: hidden;
}
body[data-portal="1"] #camp .camp-block {
  padding: 12px;
  background: #13302a;
}
.camp-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 8px;
}
body[data-portal="1"] #camp #worlds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
body[data-portal="1"] #camp .world {
  margin: 0;
  padding: 10px;
}
body[data-portal="1"] #camp .world-levels button {
  min-height: 40px;
}
body[data-portal="1"] #camp .progress {
  margin-top: 10px;
}
.camp-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #13302a;
}
.camp-settings > button {
  min-height: 44px;
}
body[data-portal="1"] #camp .view-controls {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  width: 100%;
}
body[data-portal="1"] #camp #fullScreen,
body[data-portal="1"] #camp #viewOrbit {
  display: none;
}
.camp-version {
  font-size: 11px;
  color: #b1c6a5;
}
.camp-version a {
  color: #ffe1a0;
}
@media (max-width: 640px) {
  body[data-portal="1"] #camp #worlds {
    grid-template-columns: 1fr;
  }
  body[data-portal="1"] #camp .world-head small {
    display: none;
  }
  body[data-portal="1"] #camp .between-round-actions {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}
/* Mouse/keyboard computers: no phone-only fire button (Space fires). */
@media (hover: hover) and (pointer: fine) {
  .round-view #fire {
    display: none !important;
  }
}
body[data-portal="1"][data-lang="en"] .arena::after {
  content: "LOADING…";
}
.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.lang-switch > span {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--gold);
  font-weight: 700;
  margin-right: 4px;
}
.lang-switch button[aria-pressed="true"],
.view-controls button[aria-pressed="true"] {
  border-color: var(--gold);
  color: #ffe1a0;
  background: #2b4a3c;
}
body[data-portal="1"] #camp #sound {
  display: inline-block;
}
body[data-portal="1"] #camp .view-controls button,
body[data-portal="1"] #camp .lang-switch button {
  min-height: 40px;
  min-width: 64px;
  font-size: 12px;
}
body[data-portal="1"] #camp .platform-picker {
  padding: 12px;
}
body[data-portal="1"] #camp .platform-picker > span {
  display: block;
  margin-bottom: 12px;
}
/* ===== Juice & help layers (both versions) ===== */
.move-hint {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 25;
}
.move-hint span {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: clamp(34px, 7vw, 58px);
  line-height: 1;
  color: #ffd23a;
  text-shadow: 0 0 14px #ffb300, 0 3px 0 #7a4b00, 0 0 2px #000;
  -webkit-text-stroke: 2px #6b4200;
}
.move-hint .mh-l {
  animation: mh-left 0.8s ease-in-out infinite;
}
.move-hint .mh-r {
  animation: mh-right 0.8s ease-in-out infinite;
}
@keyframes mh-left {
  50% {
    transform: translate(calc(-50% - 14px), -50%);
  }
}
@keyframes mh-right {
  50% {
    transform: translate(calc(-50% + 14px), -50%);
  }
}
.combo-pop {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%) scale(0.4);
  opacity: 0;
  pointer-events: none;
  z-index: 24;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: clamp(30px, 6.5vw, 60px);
  letter-spacing: 0.04em;
  color: #ffe08a;
  text-shadow: 0 0 18px #ff9d00, 0 4px 0 #6b3c00;
  white-space: nowrap;
}
.combo-pop.go {
  animation: combo-pop 0.9s cubic-bezier(0.2, 1.6, 0.4, 1) forwards;
}
@keyframes combo-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -60%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -75%) scale(0.95);
  }
}
.flash {
  position: absolute;
  inset: 0;
  background: #fff6d8;
  opacity: 0;
  pointer-events: none;
  z-index: 26;
}
.flash.go {
  animation: flash 0.7s ease-out forwards;
}
@keyframes flash {
  0% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
  }
}
/* The camp waits until the victory slow-motion finishes. */
body[data-portal="1"][data-finale="1"] #camp {
  display: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .move-hint span,
  .combo-pop.go,
  .flash.go {
    animation: none;
  }
}
.home-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  color: #ffe1a0;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}
.home-link[hidden] {
  display: none;
}
.assist-marks {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 23;
}
.assist-marks span {
  position: absolute;
  transform: translate(-50%, -100%);
  font-size: clamp(18px, 3.4vw, 28px);
  line-height: 1;
  color: #ffd23a;
  text-shadow: 0 0 10px #ffb300, 0 2px 0 #6b4200;
  animation: mark-bob 0.7s ease-in-out infinite;
}
@keyframes mark-bob {
  50% {
    transform: translate(-50%, calc(-100% - 8px));
  }
}
@media (prefers-reduced-motion: reduce) {
  .assist-marks span {
    animation: none;
  }
}
/* Phones: holding a finger on the game must not open text selection, the magnifier or "Copy". */
body[data-portal="1"] .arena,
body[data-portal="1"] .arena * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
body[data-portal="1"] #game,
body[data-portal="1"] #game3d {
  touch-action: none;
}
body[data-portal="1"].round-view {
  overscroll-behavior: none;
}
body[data-portal="1"][data-session="between"] #camp,
body[data-portal="1"][data-session="between"] #camp * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Phones: nothing on the page can be selected, magnified or zoomed while playing. */
body[data-portal="1"] {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}
html:has(body[data-portal="1"]),
body[data-portal="1"] {
  overscroll-behavior: none;
}
body[data-portal="1"]:not([data-session="between"]),
body[data-portal="1"]:not([data-session="between"]) * {
  touch-action: none;
}

/* Phone/portal round view: one readable top panel — score, world and fortress, progress bar, lives. */
.hud-stage {
  display: none;
}
body.round-view .hud,
body.round-view[data-mode="classic"] .pastoral .hud {
  align-items: center;
  gap: 12px;
  padding: 7px 14px 8px;
  border-radius: 14px;
  background: linear-gradient(#13232ce6, #0c171dd6);
  border: 1px solid #ffd77a66;
  box-shadow: 0 4px 14px #0007;
}
.round-view .hud small {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #f1dca6;
  margin-bottom: 2px;
}
.round-view .hud strong {
  font-size: clamp(19px, 2.6vw, 27px);
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
}
.round-view .lives strong {
  font-size: clamp(17px, 2.2vw, 23px);
  color: #ffd54a;
}
.round-view .hud-stage {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.round-view .hud-stage small {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.hud-bar {
  width: 100%;
  max-width: 230px;
  height: 9px;
  border-radius: 5px;
  background: #ffffff24;
  border: 1px solid #ffffff30;
  overflow: hidden;
}
.hud-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ffe07a, #ff9a3a);
  transition: width 0.25s;
}

/* Defeat: big banner over the field before the round closes. */
.defeat-banner {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  z-index: 30;
  pointer-events: none;
  text-align: center;
  padding: 18px 26px;
  border-radius: 18px;
  background: #1a0d0dde;
  border: 2px solid #ff6a5a;
  box-shadow: 0 8px 30px #000a;
  width: min(88%, 520px);
  font-family: "Manrope", sans-serif;
}
.defeat-banner b {
  display: block;
  font-size: clamp(30px, 8vw, 54px);
  font-weight: 800;
  color: #ff6a5a;
  letter-spacing: 0.04em;
  text-shadow: 0 3px 0 #4a0d06;
}
.defeat-banner span {
  display: block;
  margin-top: 8px;
  font-size: clamp(14px, 3.6vw, 19px);
  color: #ffe2c4;
  line-height: 1.35;
}
.defeat-banner.go {
  animation: defeat-in 0.45s cubic-bezier(0.2, 1.5, 0.4, 1) forwards;
}
@keyframes defeat-in {
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* ===== Portal camp: adventure map ===== */
body[data-portal="1"][data-session="between"] #camp {
  background: #1b2a33;
  backdrop-filter: none;
}
body[data-portal="1"] #camp .camp-inner {
  max-width: 600px;
  padding: 0 0 110px;
  gap: 0;
}
body[data-portal="1"] #camp .camp-map,
body[data-portal="1"] #camp #roundSummary {
  display: none !important;
}
.adv-top {
  display: none;
}
body[data-portal="1"] #camp .adv-top {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 12;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  background: linear-gradient(#0e1a22f2, #0e1a22c8);
  border-bottom: 1px solid #ffd77a44;
  box-shadow: 0 4px 14px #0006;
}
.adv-logo {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 3px;
  color: #ffe7a8;
  text-shadow: 0 2px 0 #6b4a12, 0 0 14px #ffb84a66;
}
.adv-chips {
  display: flex;
  gap: 8px;
  align-items: center;
}
.adv-chip {
  padding: 6px 12px;
  border-radius: 16px;
  background: #ffffff14;
  border: 1px solid #ffd77a55;
  color: #fff;
  font-weight: 700;
}
.adv-chip b {
  color: #ffd54a;
}
.adv-shop {
  min-height: 38px;
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid #ffd77a;
  background: linear-gradient(#ffd77a, #e0a43a);
  color: #3a2406;
  font-weight: 800;
  cursor: pointer;
}
body[data-portal="1"] #camp .camp-head {
  margin: 10px 12px 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: #0e1a22d9;
  border: 1px solid #ffd77a44;
}
body[data-portal="1"] #camp .camp-head:has(#campTitle:empty) {
  display: none;
}
body[data-portal="1"] #camp .camp-head h2 {
  font-size: clamp(26px, 6vw, 38px);
  margin: 2px 0;
}
.adv-map {
  display: none;
}
body[data-portal="1"] #camp .adv-map {
  display: block;
  position: relative;
  margin-top: 10px;
  overflow: hidden;
}
.adv-zone {
  position: absolute;
  left: 0;
  right: 0;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 18px 24px -12px #0008;
}
.adv-name {
  position: absolute;
  left: 10px;
  bottom: 12px;
  z-index: 6;
  padding: 6px 12px;
  border-radius: 12px;
  background: #0e1a22d0;
  border: 1px solid #ffd77a66;
  color: #fff4d6;
  font-weight: 800;
  font-size: 16px;
}
.adv-name small {
  display: block;
  font-size: 10px;
  letter-spacing: 1px;
  color: #ffd77a;
  font-weight: 700;
}
.adv-road {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.adv-node {
  position: absolute;
  z-index: 5;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  border: 3px solid #ffe7a8;
  background: radial-gradient(circle at 35% 30%, #fff8e6, #e8d3a6);
  color: #3a2406;
  font: 900 21px/1 "Manrope", system-ui, sans-serif;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 5px 0 #5a3a12, 0 8px 14px #0007;
}
.adv-node.boss {
  width: 70px;
  height: 70px;
  margin: -35px 0 0 -35px;
  font-size: 30px;
  background: radial-gradient(circle at 35% 30%, #ffe9a0, #d99a2a);
  border-color: #fff1c4;
}
.adv-node.lock {
  background: radial-gradient(circle at 35% 30%, #8a96a0, #4b555e);
  border-color: #b9c3cb88;
  cursor: default;
  box-shadow: 0 4px 0 #2a3138, 0 6px 10px #0006;
}
.adv-node.cur {
  background: radial-gradient(circle at 35% 30%, #c9f3ff, #2b8cff);
  color: #fff;
  border-color: #fff;
  animation: adv-bob 1.1s ease-in-out infinite;
}
.adv-node.cur::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 3px solid #fff;
  animation: adv-ring 1.6s ease-out infinite;
}
@keyframes adv-bob {
  50% {
    transform: translateY(-7px);
  }
}
@keyframes adv-ring {
  from {
    opacity: 1;
    transform: scale(0.8);
  }
  to {
    opacity: 0;
    transform: scale(1.4);
  }
}
.adv-ok {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2ec27e;
  color: #fff;
  font-size: 13px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}
.adv-padlock {
  width: 16px;
  height: 13px;
  border-radius: 3px;
  background: #e6ecf0;
  position: relative;
  margin-top: 6px;
}
.adv-padlock::before {
  content: "";
  position: absolute;
  left: 3px;
  top: -9px;
  width: 10px;
  height: 10px;
  border: 3px solid #e6ecf0;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  box-sizing: border-box;
}
.adv-flag {
  position: absolute;
  z-index: 6;
  margin: -84px 0 0 -2px;
  width: 3px;
  height: 40px;
  background: #ddd;
  animation: adv-bob 1.1s ease-in-out infinite;
}
.adv-flag i {
  position: absolute;
  left: 3px;
  top: 0;
  width: 26px;
  height: 17px;
  background: linear-gradient(#ff5a4a, #c4231a);
  clip-path: polygon(0 0, 100% 0, 78% 50%, 100% 100%, 0 100%);
}
.adv-fort {
  position: absolute;
  z-index: 4;
  width: 0;
  height: 0;
}
.adv-fort-img {
  position: absolute;
  width: 140px;
  left: -70px;
  bottom: -30px;
  filter: drop-shadow(0 6px 6px #0008);
}
.adv-castle-in {
  position: absolute;
  transform-style: preserve-3d;
  transform: rotateX(-20deg) rotateY(-24deg);
}
.adv-cube {
  position: absolute;
  width: 14px;
  height: 14px;
  transform-style: preserve-3d;
}
.adv-cube i {
  position: absolute;
  inset: 0;
  border-radius: 2px;
}
.adv-cube i:nth-child(1) {
  transform: translateZ(7px);
}
.adv-cube i:nth-child(2) {
  transform: rotateY(90deg) translateZ(7px);
  filter: brightness(0.78);
}
.adv-cube i:nth-child(3) {
  transform: rotateX(90deg) translateZ(7px);
  filter: brightness(1.25);
}
.adv-cube i:nth-child(4) {
  transform: rotateY(-90deg) translateZ(7px);
  filter: brightness(0.78);
}
.adv-miniboss {
  position: absolute;
  left: -42px;
  top: -140px;
  width: 84px;
  height: 84px;
  background: url(assets/bosses-painted.webp?v=w10) 0 0 / 1000% 100% no-repeat;
  filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 10px #ffe7a8cc) drop-shadow(0 5px 4px #000a);
  animation: adv-turn 3.2s ease-in-out infinite alternate;
}
.adv-fort.beaten .adv-miniboss {
  filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 10px #ffe7a8cc) drop-shadow(0 5px 4px #000a);
}
/* a beaten boss leaves the fortress: a gold victory banner flies on top */
.adv-fort.beaten::after {
  content: "";
  position: absolute;
  left: 40px;
  top: -112px;
  width: 4px;
  height: 52px;
  background: linear-gradient(#fff3c4, #b88a2a);
  z-index: 2;
}
.adv-fort.beaten::before {
  content: "";
  position: absolute;
  left: 44px;
  top: -112px;
  width: 34px;
  height: 22px;
  z-index: 2;
  background: linear-gradient(#ffe07a, #d99a2a);
  clip-path: polygon(0 0, 100% 0, 80% 50%, 100% 100%, 0 100%);
  filter: drop-shadow(0 2px 2px #0008);
  animation: adv-wave 1.4s ease-in-out infinite alternate;
  transform-origin: left center;
}
@keyframes adv-wave {
  to {
    transform: skewY(-8deg) scaleX(0.9);
  }
}
@keyframes adv-turn {
  from {
    transform: perspective(200px) rotateY(-35deg) translateY(0);
  }
  to {
    transform: perspective(200px) rotateY(35deg) translateY(-4px);
  }
}
.adv-reward {
  position: absolute;
  left: 34px;
  top: -26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d9dee2, #6b747c);
  border: 2px solid #ffffff66;
  opacity: 0.6;
}
.adv-reward.got {
  opacity: 1;
  background: radial-gradient(circle at 35% 30%, #fff, #7ad8ff 40%, #2b6cff);
  border-color: #fff;
  box-shadow: 0 0 14px #6cc8ff, 0 0 30px #2b8cff88;
  animation: adv-bob 1.4s ease-in-out infinite;
}
body[data-portal="1"] #camp .between-round-actions {
  position: fixed;
  top: auto;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 14;
  border: 0;
  background: none;
  padding: 0;
  justify-content: center;
}
body[data-portal="1"] #camp #startRound {
  white-space: nowrap;
  border-radius: 22px;
  padding: 14px 34px;
  font-size: 19px;
  font-weight: 900;
  color: #fff;
  border: 0;
  background: linear-gradient(#5be36b, #21a83b);
  box-shadow: 0 6px 0 #137a27, 0 10px 24px #0007;
}
/* Workshop: a sheet that slides up over the map */
body[data-portal="1"] #camp .workshop-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: min(600px, 100%);
  max-height: 86%;
  overflow-y: auto;
  z-index: 30;
  transform: translate(-50%, 105%);
  transition: transform 0.3s ease;
  padding: 0 12px 24px;
  border-radius: 18px 18px 0 0;
  background: #0f2420f7;
  border-top: 2px solid #ffd77a88;
  box-shadow: 0 -10px 30px #000a;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body[data-portal="1"] #camp .workshop-sheet.open {
  transform: translate(-50%, 0);
}
.ws-head {
  display: none;
}
body[data-portal="1"] #camp .ws-head {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 2;
  justify-content: space-between;
  align-items: center;
  padding: 14px 2px 8px;
  background: #0f2420;
  color: #ffe7a8;
  font-size: 18px;
}
.ws-head button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #ffd77a66;
  background: #ffffff10;
  color: #fff;
  font-size: 18px;
}

/* Super strike button (bottom-right, over the field) */
.super-btn {
  display: none;
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 26;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  min-height: 48px;
  border-radius: 24px;
  border: 1px solid #7ff0ff66;
  background: #0c1a24d9;
  color: #fff;
  font-weight: 800;
  pointer-events: auto;
  box-shadow: 0 4px 14px #0007;
}
.super-btn b {
  font-size: 20px;
  filter: grayscale(1) opacity(0.6);
}
.super-btn .sp-pips {
  display: flex;
  gap: 4px;
}
.super-btn .sp-pips i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #7ff0ff88;
}
.super-btn .sp-pips i.on {
  background: #7ff0ff;
  box-shadow: 0 0 8px #7ff0ff;
}
.super-btn .sp-bar {
  width: 96px; /* 17.11: longer — it fills slower now */
  height: 9px;
  border-radius: 4px;
  background: #ffffff22;
  overflow: hidden;
}
.super-btn .sp-bar u {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7ff0ff, #3a9bff);
}
.super-btn.ready {
  border-color: #7ff0ff;
  animation: super-ready 1s ease-in-out infinite;
}
.super-btn.ready b {
  filter: none;
}
.super-btn.active {
  background: #0f4a5ad9;
}
@keyframes super-ready {
  50% {
    box-shadow: 0 0 22px #7ff0ffaa, 0 4px 14px #0007;
  }
}

.adv-mini {
  position: absolute;
  z-index: 4;
  width: 110px;
  height: 90px;
  pointer-events: none;
  filter: drop-shadow(0 3px 3px #0006);
}

/* Super Ball button (above the ⚡ button) */
.superball-btn {
  display: none;
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 58px);
  z-index: 26;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #7ff0ff66;
  background: radial-gradient(circle at 35% 30%, #2a4a5a, #0c1a24);
  color: #9ff4ff;
  font-size: 24px;
  pointer-events: auto;
  filter: grayscale(0.8);
  box-shadow: 0 4px 14px #0007;
}
.superball-btn.ready {
  filter: none;
  border-color: #c8f6ff;
  animation: super-ready 1s ease-in-out infinite;
}
.superball-btn.active {
  background: radial-gradient(circle at 35% 30%, #fff, #7ff0ff 45%, #2b8cff);
  color: #fff;
}
/* reward orb states on the map */
.adv-reward.ball {
  background: radial-gradient(circle at 35% 30%, #d9dee2, #6b747c);
}
button.adv-reward.got {
  width: auto;
  height: 30px;
  left: -50px;
  top: 26px;
  z-index: 6;
  padding: 0 12px 0 30px;
  border-radius: 16px;
  font: 800 13px/1 "Manrope", system-ui, sans-serif;
  color: #fff;
  cursor: pointer;
  text-shadow: 0 1px 2px #0008;
  background: radial-gradient(circle at 15px 15px, #fff 0 3px, #7ad8ff 7px, #2b6cff 13px, #1a3f8a 14px);
}
button.adv-reward.got.plat {
  background: radial-gradient(circle at 15px 15px, #fff 0 3px, #ffe07a 7px, #e08a1f 13px, #7a4a0a 14px);
  box-shadow: 0 0 14px #ffc24a, 0 0 30px #ff9a2a88;
}
.adv-reward.taken {
  width: 18px;
  height: 18px;
  left: 36px;
  top: -20px;
  opacity: 1;
  background: radial-gradient(circle at 35% 30%, #fff, #7ad8ff 45%, #2b6cff);
  border-color: #fff;
}
.adv-reward.taken.plat {
  background: radial-gradient(circle at 35% 30%, #fff, #ffe07a 45%, #e08a1f);
}
/* shard collected popup */
.shard-pop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  place-items: center;
  background: #0009;
}
.shard-pop.open {
  display: grid;
  overflow-y: auto; /* 18.11 audit: on a landscape phone the gift card was taller than the screen and "Collect!" was off-screen */
  padding: 8px 0;
}
@media (max-height: 520px) {
  .sp-card .sp-stage {
    height: 84px;
    margin-bottom: 2px;
  }
  .sp-card .sp-stage img:not(.sp-orb),
  .sp-card .sp-stage svg {
    max-height: 84px;
  }
  .sp-card {
    padding: 10px 14px 12px;
  }
  .sp-card p,
  .sp-card .daily-freeze {
    margin: 4px 0;
  }
}
.sp-card {
  width: min(86vw, 360px);
  padding: 22px 18px 18px;
  border-radius: 20px;
  text-align: center;
  color: #fff;
  background: linear-gradient(#173040, #0c1a24);
  border: 2px solid #7ff0ff88;
  box-shadow: 0 0 40px #2b8cff66, 0 14px 40px #000c;
  animation: sp-in 0.4s cubic-bezier(0.2, 1.5, 0.4, 1);
}
@keyframes sp-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}
.sp-card.plat {
  border-color: #ffd77a99;
  box-shadow: 0 0 40px #ff9a2a66, 0 14px 40px #000c;
}
.sp-orb {
  width: 74px;
  height: 74px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #7ad8ff 40%, #2b6cff);
  box-shadow: 0 0 30px #6cc8ff;
  animation: adv-bob 1.4s ease-in-out infinite;
}
.sp-card.plat .sp-orb {
  background: radial-gradient(circle at 35% 30%, #fff, #ffe07a 40%, #e08a1f);
  box-shadow: 0 0 30px #ffc24a;
}
.sp-card small {
  letter-spacing: 2px;
  color: #9ff4ff;
  font-weight: 800;
  font-size: 11px;
}
.sp-card h3 {
  font-size: 26px;
  margin: 4px 0 8px;
}
.sp-pips3 {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
}
.sp-pips3 i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #ffffff66;
}
.sp-pips3 i.on {
  background: #9ff4ff;
  box-shadow: 0 0 10px #7ff0ff;
}
.sp-card.plat .sp-pips3 i.on {
  background: #ffd77a;
  box-shadow: 0 0 10px #ffb84a;
}
.sp-card p {
  color: #dbe8ee;
  line-height: 1.4;
  margin: 0 0 14px;
}
.sp-card button {
  border: 0;
  border-radius: 16px;
  padding: 12px 30px;
  font-weight: 900;
  font-size: 17px;
  color: #fff;
  background: linear-gradient(#5be36b, #21a83b);
  box-shadow: 0 5px 0 #137a27;
}

/* Victory banner: gold */
.defeat-banner.win {
  background: #1d1606e6;
  border-color: #ffd77a;
  box-shadow: 0 0 40px #ffc24a88, 0 8px 30px #000a;
}
.defeat-banner.win b {
  color: #ffd54a;
  text-shadow: 0 3px 0 #6b4a06, 0 0 18px #ffb84a;
}

/* stars */
.adv-stars {
  position: absolute;
  left: 50%;
  bottom: -17px;
  transform: translateX(-50%);
  font-size: 13px;
  letter-spacing: -1px;
  color: #ffd54a;
  white-space: nowrap;
  text-shadow: 0 1px 0 #5a3a06, 0 0 4px #000;
}
.adv-node.boss .adv-stars {
  bottom: -18px;
  font-size: 14px;
}
.win-stars {
  display: block;
  font-style: normal;
  font-size: clamp(34px, 9vw, 52px);
  letter-spacing: 4px;
  color: #ffd54a;
  text-shadow: 0 3px 0 #6b4a06, 0 0 16px #ffb84a;
  margin: 4px 0 6px;
  animation: star-pop 0.6s 0.25s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.defeat-banner small {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: #ffe7a8;
}
@keyframes star-pop {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
}
.win-stars-line {
  color: #ffd54a;
  font-size: 22px;
  letter-spacing: 3px;
}
/* boss leaves when its shard is taken */
.adv-fort.claimed .adv-miniboss {
  display: block;
}
.adv-fort.poof .adv-miniboss {
  animation: boss-poof 0.65s ease-in forwards;
}
@keyframes boss-poof {
  45% {
    transform: scale(1.3);
    filter: brightness(3) drop-shadow(0 0 18px #fff);
  }
}
/* chest opening */
.sp-stage {
  position: relative;
  height: 150px;
  margin-bottom: 6px;
}
.sp-chest {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 140px;
  transform: translateX(-50%);
  overflow: visible;
  animation: chest-shake 0.7s ease-in-out;
}
.sp-lid {
  transform-origin: 14px 46px;
  animation: lid-open 0.5s 0.7s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
@keyframes chest-shake {
  0%, 100% { transform: translateX(-50%); }
  20% { transform: translateX(-54%) rotate(-4deg); }
  40% { transform: translateX(-46%) rotate(4deg); }
  60% { transform: translateX(-53%) rotate(-3deg); }
  80% { transform: translateX(-47%) rotate(3deg); }
}
@keyframes lid-open {
  to {
    transform: rotate(-38deg) translate(-6px, -10px);
  }
}
.sp-rays {
  position: absolute;
  left: 50%;
  top: 70px;
  width: 260px;
  height: 260px;
  margin: -130px 0 0 -130px;
  background: repeating-conic-gradient(from 0deg, #fff6 0 8deg, #fff0 8deg 22deg);
  border-radius: 50%;
  mask: radial-gradient(circle, #000 20%, #0000 70%);
  -webkit-mask: radial-gradient(circle, #000 20%, #0000 70%);
  opacity: 0;
  animation: rays-in 0.6s 0.85s ease-out forwards, rays-spin 8s 0.85s linear infinite;
}
.sp-card.plat .sp-rays {
  background: repeating-conic-gradient(from 0deg, #ffe7a866 0 8deg, #fff0 8deg 22deg);
}
@keyframes rays-in {
  to {
    opacity: 1;
  }
}
@keyframes rays-spin {
  to {
    transform: rotate(360deg);
  }
}
.sp-stage .sp-orb {
  position: absolute;
  left: 50%;
  top: 60px;
  margin: 0 0 0 -34px;
  width: 68px;
  height: 68px;
  opacity: 0;
  animation: orb-rise 0.7s 0.95s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}
@keyframes orb-rise {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.3);
  }
  to {
    opacity: 1;
    transform: translateY(-48px) scale(1);
  }
}
.sp-text {
  opacity: 0;
  animation: rays-in 0.4s 1.4s forwards;
}
/* top bar fits a phone: no wrapping */
body[data-portal="1"] #camp .adv-top {
  padding-left: 10px;
  padding-right: 10px;
}
.adv-logo {
  font-size: 22px;
  letter-spacing: 2px;
}
.adv-chips {
  gap: 5px;
}
.adv-chip,
.adv-shop {
  white-space: nowrap;
  font-size: 13px;
  padding: 6px 9px;
}
@media (max-width: 400px) {
  .adv-logo {
    font-size: 18px;
    letter-spacing: 1px;
  }
  .adv-shop span {
    display: none;
  }
  .adv-shop {
    font-size: 17px;
    padding: 4px 11px;
  }
}

.win-coins {
  display: table !important;
  margin: 0 auto 8px;
  padding: 3px 12px;
  border-radius: 12px;
  background: #ffd77a22;
  border: 1px solid #ffd77a88;
  color: #ffe7a8 !important;
  font-weight: 800;
}

/* map: levels start on tap, no bottom play button; stars on a dark pill under every open level */
body[data-portal="1"][data-session="between"] #camp .between-round-actions {
  display: none !important;
}
body[data-portal="1"] #camp .camp-inner {
  padding-bottom: 30px;
}
.adv-stars {
  bottom: -24px;
  padding: 1px 7px 2px;
  border-radius: 10px;
  background: #0e1a22d9;
  border: 1px solid #ffd77a66;
  font-size: 15px;
  letter-spacing: 0;
  line-height: 1.2;
  color: #ffd54a;
  text-shadow: none;
}
.adv-stars.s0 {
  color: #ffffff80;
}
.adv-node.boss .adv-stars {
  bottom: -26px;
  font-size: 16px;
}

/* ===== Workshop: scrolls by itself, colourful cards with pictures ===== */
body[data-portal="1"] #camp.ws-lock {
  overflow: hidden !important;
}
body[data-portal="1"] #camp .workshop-sheet {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background: radial-gradient(120% 60% at 50% 0%, #3a2a5a, #142430 55%, #0c1820);
  border-top: 2px solid #ffd77a;
}
body[data-portal="1"] #camp .ws-head {
  background: linear-gradient(#3a2a5a, #2a2448);
  margin: 0 -12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid #ffd77a55;
}
.ws-head b {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 24px;
  letter-spacing: 1px;
  color: #ffe7a8;
  text-shadow: 0 2px 0 #4a2a06;
}
body[data-portal="1"] #camp .workshop-sheet .upgrade-shop,
body[data-portal="1"] #camp .workshop-sheet .starter-shop,
body[data-portal="1"] #camp .workshop-sheet .platform-picker,
body[data-portal="1"] #camp .workshop-sheet .camp-settings {
  background: #ffffff0a;
  border: 1px solid #ffffff1c;
  border-radius: 16px;
  padding: 12px;
}
body[data-portal="1"] #camp .workshop-sheet .upgrade-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
body[data-portal="1"] #camp .workshop-sheet .upgrade-heading > span {
  font-weight: 900;
  letter-spacing: 1.5px;
  font-size: 13px;
  color: #ffd77a;
}
body[data-portal="1"] #camp .workshop-sheet .upgrade-heading > strong {
  color: #fff;
  font-size: 15px;
}
body[data-portal="1"] #camp .workshop-sheet .upgrade-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
body[data-portal="1"] #camp .workshop-sheet .upgrade-options button,
body[data-portal="1"] #camp .workshop-sheet .starter-options button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-height: 0;
  padding: 10px 8px 10px;
  border-radius: 16px;
  border: 1px solid #ffffff33;
  background: linear-gradient(#2c3f55, #172636);
  box-shadow: 0 4px 0 #0a1219, inset 0 1px 0 #ffffff22;
  color: #fff;
  text-align: center;
  cursor: pointer;
  opacity: 1;
}
body[data-portal="1"] #camp .workshop-sheet .upgrade-options button:nth-child(1) { background: linear-gradient(#5a3d1f, #2a1d10); }
body[data-portal="1"] #camp .workshop-sheet .upgrade-options button:nth-child(2) { background: linear-gradient(#5a2a1f, #2a120c); }
body[data-portal="1"] #camp .workshop-sheet .upgrade-options button:nth-child(3) { background: linear-gradient(#1f3a5a, #0e1c2e); }
body[data-portal="1"] #camp .workshop-sheet .upgrade-options button:nth-child(4) { background: linear-gradient(#24502a, #102414); }
body[data-portal="1"] #camp .workshop-sheet .upgrade-options button:nth-child(5) { background: linear-gradient(#4a3d1f, #241c0e); }
body[data-portal="1"] #camp .workshop-sheet .upgrade-options button:disabled,
body[data-portal="1"] #camp .workshop-sheet .starter-options button:disabled {
  filter: saturate(0.7);
  cursor: default;
}
.ws-icon {
  display: block;
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 4px 4px #0008);
}
.ws-icon svg {
  width: 100%;
  height: 100%;
}
.upgrade-options button > b,
.starter-options button > b {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
}
.ws-pips {
  display: flex;
  gap: 4px;
}
.ws-pips i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #ffffff22;
  border: 1px solid #ffffff44;
}
.ws-pips i.on {
  background: #ffd54a;
  border-color: #fff3c4;
  box-shadow: 0 0 6px #ffb84a;
}
.ws-price {
  margin-top: 2px;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 14px;
  color: #3a2406;
  background: linear-gradient(#ffe07a, #e0a43a);
  box-shadow: 0 2px 0 #7a4a0a;
}
.ws-price.poor {
  color: #ffffffaa;
  background: #ffffff1c;
  box-shadow: none;
}
.ws-price.max {
  color: #fff;
  background: linear-gradient(#5be36b, #21a83b);
  box-shadow: 0 2px 0 #137a27;
}
body[data-portal="1"] #camp .workshop-sheet .starter-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
  gap: 8px;
}
.ws-cap {
  display: grid;
  place-items: center;
  width: 58px;
  height: 30px;
  border-radius: 15px;
  background: linear-gradient(#ffffffaa, var(--cap, #888) 35%, var(--cap, #888) 65%, #0006);
  border: 2px solid #fff8;
  box-shadow: 0 0 12px var(--cap, #888), 0 3px 0 #0006;
}
.ws-cap i {
  font-style: normal;
  font-weight: 900;
  font-size: 17px;
  color: #fff;
  text-shadow: 0 1px 2px #000a;
}
.starter-options button > b {
  font-size: 12px;
}
/* sections keep their full height so the sheet itself scrolls */
body[data-portal="1"] #camp .workshop-sheet > * {
  flex-shrink: 0;
  max-height: none;
  overflow: visible;
}
body[data-portal="1"] #camp .workshop-sheet {
  max-height: 86vh;
  max-height: 86dvh;
  overflow-y: auto;
}

.ws-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.upgrade-options .ws-icon {
  width: 76px;
  height: 76px;
}

/* map: soft, misty blend between worlds instead of a hard edge */
.adv-zone {
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 150px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 150px), transparent 100%);
  box-shadow: none;
}
.adv-zone::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40px;
  height: 120px;
  background: radial-gradient(60% 50% at 30% 60%, #ffffff30, transparent 70%), radial-gradient(50% 45% at 75% 40%, #ffffff28, transparent 70%);
  pointer-events: none;
}
.adv-lava {
  animation: lava-glow 1.4s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 4px #ff6a1a);
}
@keyframes lava-glow {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}
@keyframes lava-flow {
  to {
    stroke-dashoffset: -36;
  }
}

.adv-zone.first {
  -webkit-mask-image: none;
  mask-image: none;
}
.adv-zone.first::after {
  display: none;
}

.adv-map > .adv-name,
.adv-map > .adv-zones > .adv-name {
  position: absolute;
  bottom: auto;
  z-index: 7;
}

/* trail shop */
.trail-shop {
  display: none;
}
body[data-portal="1"] #camp .workshop-sheet .trail-shop {
  display: block;
}
.trail-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
  gap: 8px;
}
.trail-options button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  border-radius: 14px;
  border: 1px solid #ffffff2a;
  background: linear-gradient(#24324a, #121c2a);
  box-shadow: 0 3px 0 #0a1219;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}
.trail-options button.sel {
  border-color: #7ff0ff;
  box-shadow: 0 0 12px #7ff0ff66, 0 3px 0 #0a1219;
}
.tr-swatch {
  position: relative;
  display: block;
  width: 78px;
  height: 18px;
  border-radius: 9px;
}
.tr-swatch i {
  position: absolute;
  right: -2px;
  top: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffde3, #f1db94 50%, #c9bd7a);
  box-shadow: 0 0 8px #fff8;
}

.tr-pic {
  position: relative;
  display: flex;
  align-items: center;
  width: 92px;
  height: 34px;
}
.tr-pic .tr-art {
  width: 84px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px #fff6);
  animation: tr-live 1.2s ease-in-out infinite alternate;
  transform-origin: right center;
}
.tr-pic .tr-swatch {
  width: 84px;
  height: 14px;
  border-radius: 7px;
}
.tr-pic i {
  position: absolute;
  right: 0;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffde3, #f1db94 50%, #c9bd7a);
  box-shadow: 0 0 8px #fff8;
}
@keyframes tr-live {
  to {
    transform: scaleX(1.08) scaleY(0.9);
    filter: drop-shadow(0 0 10px #fff9) brightness(1.15);
  }
}

.adv-view {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 10px;
  border-radius: 16px;
  border: 1px solid #7ff0ff88;
  background: #0f3a4ad9;
  color: #c8f6ff;
  text-decoration: none;
}

/* painted coin, shards, chest, ability buttons */
.coin-ic {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  background: url(assets/coin.webp) center / contain no-repeat;
  filter: drop-shadow(0 1px 1px #0008);
}
.sp-stage .sp-orb {
  border-radius: 0;
  background: none;
  box-shadow: none;
  width: 92px;
  height: 92px;
  margin-left: -46px;
  top: 40px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px #fff9);
}
.sp-chest-img {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 150px;
  margin-left: -75px;
  filter: drop-shadow(0 8px 10px #000a);
}
.sp-chest-img.closed {
  animation: chest-shake 0.7s ease-in-out, chest-hide 0.01s 0.72s forwards;
}
.sp-chest-img.open {
  opacity: 0;
  animation: chest-pop 0.45s 0.72s cubic-bezier(0.2, 1.6, 0.4, 1) forwards;
}
@keyframes chest-shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-5px) rotate(-4deg); }
  40% { transform: translateX(5px) rotate(4deg); }
  60% { transform: translateX(-4px) rotate(-3deg); }
  80% { transform: translateX(4px) rotate(3deg); }
}
@keyframes chest-hide {
  to { opacity: 0; }
}
@keyframes chest-pop {
  from { opacity: 1; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}
.adv-reward.ball,
.adv-reward.plat {
  background: url(assets/shard-ball.webp) center / contain no-repeat;
  border: 0;
  border-radius: 0;
  width: 30px;
  height: 30px;
  filter: grayscale(1) brightness(0.7);
}
.adv-reward.plat {
  background-image: url(assets/shard-plat.webp);
}
.adv-reward.taken {
  filter: drop-shadow(0 0 6px #fff);
}
button.adv-reward.got {
  background: linear-gradient(#1f3c6a, #0e1c34) !important;
  border: 2px solid #9ff4ff !important;
  padding: 0 12px 0 34px !important;
  filter: none;
}
button.adv-reward.got.plat {
  background: linear-gradient(#6a3c10, #341c06) !important;
  border-color: #ffd77a !important;
}
button.adv-reward.got img {
  position: absolute;
  left: -2px;
  top: -10px;
  width: 38px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px #fff9);
  animation: adv-bob 1.2s ease-in-out infinite;
}
.super-btn b img {
  width: 38px;
  height: 38px;
  display: block;
}
.super-btn b {
  font-size: 0;
}
.superball-btn img {
  width: 100%;
  height: 100%;
}
.superball-btn {
  padding: 0;
  background: none !important;
  border: 0 !important;
  width: 58px;
  height: 58px;
}

/* laser button sits above the super-strike buttons (they used to cover it) */
.round-view #fire {
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 128px) !important;
  right: max(12px, env(safe-area-inset-right)) !important;
  z-index: 27;
}
/* towers fire the laser by themselves — no fire button */
#fire,
.round-view #fire {
  display: none !important;
}

/* Storm (endless mode) card on the map */
.storm-card {
  display: none;
}
body[data-portal="1"] #camp .storm-card {
  display: flex;
  position: sticky;
  top: 62px;
  z-index: 11;
  align-items: center;
  gap: 10px;
  margin: 8px 10px 0;
  padding: 10px 14px;
  border-radius: 16px;
  border: 2px solid #ffd77a;
  background: linear-gradient(100deg, #6a1414, #a3341a 55%, #e0782a);
  color: #fff;
  text-align: left;
  box-shadow: 0 5px 0 #3a0a06, 0 8px 18px #0008;
  cursor: pointer;
}
.storm-card b {
  font-size: 18px;
  letter-spacing: 1px;
  white-space: nowrap;
  text-shadow: 0 2px 0 #3a0a06;
}
.storm-card span {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: #ffe7c4;
}
.storm-card i {
  font-style: normal;
  font-size: 20px;
}
.storm-card.locked {
  filter: grayscale(0.8) brightness(0.75);
  cursor: default;
}
/* Storm: CASTLE letters and the three targets under the wave bar */
.storm-pins { display: flex; gap: 1px; justify-content: center; align-items: center; margin-top: 3px; }
.storm-pins[hidden] { display: none; }
.storm-pins i { width: 15px; height: 15px; background: url(assets/pin-tile.webp) center/contain no-repeat; font: 900 9px/15px Georgia, serif; font-style: normal; text-align: center; color: #ffffff38; filter: saturate(.35) brightness(.75); }
.storm-pins i.on { color: #ffd95a; text-shadow: 0 0 6px #ffb800, 0 1px 1px #3a2400; filter: none; animation: pin-on .4s ease-out; }
.storm-pins b { width: 6px; }
.storm-pins u { width: 14px; height: 14px; background: url(assets/pin-target.webp) center/contain no-repeat; opacity: .3; filter: grayscale(.7); }
.storm-pins u.on { opacity: 1; filter: drop-shadow(0 0 4px #ff5040); }
@keyframes pin-on { from { transform: scale(1.8); } to { transform: scale(1); } }
.storm-pins em { width: 54px; height: 7px; margin-left: 5px; border-radius: 4px; background: #0008; box-shadow: inset 0 0 0 1px #ff8a6a66; overflow: hidden; display: block; }
.storm-pins em s { display: block; height: 100%; background: linear-gradient(90deg, #ff3b2f, #ffb14a); text-decoration: none; }
/* Daily gift (7-day chain + freezes) */
.sp-card.daily { border-color: #ffd77a99; box-shadow: 0 0 40px #ffb84a66, 0 14px 40px #000c; }
.sp-card.daily .sp-orb { background: none; box-shadow: none; border-radius: 0; filter: drop-shadow(0 0 14px #ffc24a); }
.sp-card.daily h3 { font-size: 22px; }
.daily-chain { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 4px 0 10px; }
.daily-chain i { font-style: normal; font-size: 12px; font-weight: 800; padding: 4px 0; border-radius: 8px; background: #ffffff12; border: 1px solid #ffffff22; color: #cfdbe2; }
.daily-chain i b { display: block; font-size: 9px; opacity: .7; }
.daily-chain i.got { background: #2f9a3a55; border-color: #6fe08a77; color: #b6f5c4; }
.daily-chain i.now { background: linear-gradient(#ffd77a, #e0961f); color: #3a2400; border-color: #fff3c4; transform: scale(1.12); box-shadow: 0 0 12px #ffc24a; }
.daily-chain i:last-child { border-color: #ffd77a88; }
.daily-freeze { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: #bfe9ff; margin-bottom: 8px; }
.daily-freeze u { text-decoration: none; font-size: 20px; opacity: .25; filter: grayscale(1); }
.daily-freeze u.on { opacity: 1; filter: drop-shadow(0 0 6px #7ff0ff); }
.daily-freeze span { flex-basis: 100%; opacity: .85; }
.sp-card .daily-buy { padding: 5px 12px; font-size: 13px; }
.sp-card .daily-buy:disabled { opacity: .45; }
.daily-note { font-size: 13px; color: #9ff4ff !important; }
.storm-card .storm-new { font-style: normal; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 10px; background: #0006; border: 1px solid #ffffff44; color: #ffd77a; }
/* 2.5D: the super-strike widgets were too big and sat over the platform (13.11) — smaller, low in the corner,
   see-through until a charge is ready */
body[data-mode="classic"] .super-btn {
  bottom: max(4px, env(safe-area-inset-bottom));
  right: max(4px, env(safe-area-inset-right));
  min-height: 30px;
  padding: 3px 8px;
  gap: 4px;
  opacity: 0.7;
}
body[data-mode="classic"] .super-btn.ready,
body[data-mode="classic"] .super-btn.active { opacity: 1; }
body[data-mode="classic"] .super-btn b img { width: 24px; height: 24px; }
body[data-mode="classic"] .super-btn .sp-pips i { width: 8px; height: 8px; border-width: 1.5px; }
body[data-mode="classic"] .super-btn .sp-bar { width: 72px; height: 7px; }
body[data-mode="classic"] .superball-btn {
  width: 40px;
  height: 40px;
  right: max(6px, env(safe-area-inset-right));
  bottom: calc(max(4px, env(safe-area-inset-bottom)) + 36px);
}
/* the zones layer sits under everything else on the map */
.adv-zones { position: absolute; inset: 0; pointer-events: none; }
.adv-zones > .adv-name { z-index: 7; }

/* aim arrow over the ball resting on the platform (14.11) */
.aim-arrow{position:absolute;height:22px;transform-origin:0 50%;pointer-events:none;z-index:6;opacity:.7;filter:drop-shadow(0 0 4px rgba(255,255,255,.9)) drop-shadow(0 1px 2px rgba(0,0,0,.6));display:none}
.aim-arrow svg{width:100%;height:100%;display:block}

/* defeat banner: Try again right here; victory banner: tomorrow's gift (14.11) */
.defeat-banner .banner-retry{pointer-events:auto;display:inline-block;margin-top:12px;padding:11px 26px;border-radius:12px;border:0;background:linear-gradient(#ffd25a,#f0a020);color:#3a1a00;font:800 clamp(16px,4.4vw,20px) "Manrope",sans-serif;box-shadow:0 3px 0 #8a4a06,0 6px 16px #0008;cursor:pointer}
.defeat-banner .win-tomorrow{display:inline-block;margin-top:6px;color:#ffe9a8;font-weight:700}

/* missions (14.11) */
.adv-missions{position:relative}
.adv-missions.ready::after{content:"";position:absolute;top:-3px;right:-3px;width:11px;height:11px;border-radius:50%;background:#ff3b30;box-shadow:0 0 0 2px #1d1606}
.missions-pop{position:fixed;inset:0;z-index:9000;display:none;align-items:center;justify-content:center;background:#0009;padding:14px}
.missions-pop.show{display:flex}
.ms-card{width:min(440px,100%);max-height:88vh;overflow:auto;background:linear-gradient(#22303f,#141c26);border:2px solid #ffd77a;border-radius:18px;padding:14px;color:#fff;font-family:"Manrope",sans-serif;box-shadow:0 10px 40px #000a}
.ms-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;font-size:20px;color:#ffd54a}
.ms-close{background:none;border:0;color:#fff;font-size:20px;cursor:pointer}
.ms-row{display:grid;grid-template-columns:1fr auto;gap:6px 10px;align-items:center;padding:10px;margin-bottom:8px;border-radius:12px;background:#ffffff10}
.ms-row.done{background:#3a5a2a66;box-shadow:inset 0 0 0 1px #8fe36a}
.ms-t{grid-column:1/-1;font-weight:700;font-size:14px}
.ms-bar{position:relative;height:16px;border-radius:8px;background:#0006;overflow:hidden}
.ms-bar i{position:absolute;inset:0 auto 0 0;background:linear-gradient(90deg,#f0a020,#ffd54a)}
.ms-bar span{position:relative;display:block;text-align:center;font-size:11px;line-height:16px;font-weight:700;text-shadow:0 1px 2px #000}
.ms-take{border:0;border-radius:10px;padding:7px 12px;background:linear-gradient(#5be36a,#2a9a3a);color:#fff;font-weight:800;cursor:pointer;animation:ms-pulse 1s infinite alternate}
@keyframes ms-pulse{to{transform:scale(1.08)}}
.ms-c,.ms-got{font-weight:700;color:#ffe9a8;font-size:13px}
.ms-daily{margin-bottom:10px;padding-bottom:6px;border-bottom:1px dashed #ffd77a66}
.ms-daily .ms-row{background:#ffcf3a22;box-shadow:inset 0 0 0 1px #ffcf3a88}
.ms-daily small{display:block;text-align:center;color:#c9d4e0;font-size:11px}
.defeat-banner .win-mission{display:inline-block;margin-top:4px;color:#d8f0ff;font-size:.92em}
.defeat-banner .win-mission strong{color:#ffd54a}
.adv-missions span{display:none}
@media (min-width:560px){.adv-missions span{display:inline}}
.adv-missions{padding:6px 9px}
@media (max-width:480px){.adv-chips{gap:5px}.adv-chip{padding:6px 8px}.adv-shop{padding:6px 10px}.adv-missions{padding:6px 8px}}
@media (max-width:480px){#openWorkshop span{display:none}}

/* Storm card: a living card — the little fortress is smashed and rebuilt, fiery title, pulsing play (14.11) */
body[data-portal="1"] #camp .storm-card{padding:6px 14px 6px 6px;gap:8px;min-height:96px;background:radial-gradient(120% 140% at 15% 100%,#ff7a2a 0%,#a3221a 38%,#3a0a0a 100%);overflow:hidden;animation:storm-glow 2.4s ease-in-out infinite}
@keyframes storm-glow{50%{box-shadow:0 5px 0 #3a0a06,0 8px 26px #ff6a2a99}}
.storm-card .storm-anim{width:144px;height:96px;flex:none;filter:drop-shadow(0 3px 4px #0008)}
.storm-card .storm-txt{flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0}
.storm-card .storm-txt b{font-size:30px;letter-spacing:3px;color:#ffd54a;text-shadow:0 2px 0 #6a1a06,0 3px 0 #3a0a06,0 0 14px #ff8a2a,0 0 26px #ff5a1a}
.storm-card .storm-txt span{font-size:13px;color:#ffe7c4;flex:none}
.storm-card .storm-txt small{font-size:12px;font-weight:800;color:#ffd77a}
.storm-card .storm-play{display:grid;place-items:center;width:46px;height:46px;flex:none;border-radius:50%;background:linear-gradient(#ffe07a,#f0a020);color:#5a1a00;font-size:20px;box-shadow:0 3px 0 #8a3a06,0 0 16px #ffb84a;animation:storm-pulse 1s ease-in-out infinite alternate}
@keyframes storm-pulse{to{transform:scale(1.12)}}
.storm-card.locked{animation:none}
.storm-card .storm-txt .storm-new{margin-top:3px}
/* 11 languages (14.11): the switch wraps; Hebrew and Arabic text in panels reads right to left */
.lang-switch{flex-wrap:wrap;justify-content:center}
body[data-rtl="1"] .defeat-banner,body[data-rtl="1"] .ms-card,body[data-rtl="1"] .sp-card,body[data-rtl="1"] .overlay-card,body[data-rtl="1"] #overlay,body[data-rtl="1"] .workshop,body[data-rtl="1"] .storm-txt,body[data-rtl="1"] .rules,body[data-rtl="1"] .toast{direction:rtl}

/* fast start: the map's pictures wait until the late art loads (lazy-art.js) */
body:not(.late-art) .adv-map *,body:not(.late-art) .adv-miniboss{background-image:none!important}

/* our site: leaderboard and friend's challenge (online.js) */
.adv-board{padding:6px 9px}
.defeat-banner .ol-row{pointer-events:auto;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:10px}
.defeat-banner .ol-place,.defeat-banner .ol-beat{flex-basis:100%;text-align:center;color:#ffe9a8;font-weight:800;font-size:.95em}
.defeat-banner .ol-beat{color:#8fe36a}
.defeat-banner .ol-btn{pointer-events:auto;border:0;border-radius:11px;padding:9px 14px;font:800 15px "Manrope",sans-serif;cursor:pointer;background:linear-gradient(#ffd25a,#f0a020);color:#3a1a00;box-shadow:0 3px 0 #8a4a06}
.defeat-banner .ol-lb{background:linear-gradient(#7ac8ff,#2a7ad0);color:#fff;box-shadow:0 3px 0 #123a6a}
.ol-pop{position:fixed;inset:0;z-index:9000;display:none;align-items:center;justify-content:center;background:#0009;padding:14px}
.ol-pop.show{display:flex}
.ol-card{width:min(440px,100%);max-height:88vh;overflow:auto;background:linear-gradient(#22303f,#141c26);border:2px solid #ffd77a;border-radius:18px;padding:14px;color:#fff;font-family:"Manrope",sans-serif;box-shadow:0 10px 40px #000a}
.ol-head{display:flex;justify-content:space-between;align-items:center;font-size:20px;color:#ffd54a;margin-bottom:8px}
.ol-x{background:none;border:0;color:#fff;font-size:20px;cursor:pointer}
.ol-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:6px}
.ol-tabs button{flex:1;border:0;border-radius:10px;padding:7px 6px;background:#ffffff14;color:#dfe8f2;font:700 12px "Manrope",sans-serif;cursor:pointer}
.ol-tabs button.on{background:#ffcf3a;color:#3a1a00}
.ol-sub{font-size:11px;color:#b8c6d4;text-align:center;margin-bottom:6px}
.ol-r{display:grid;grid-template-columns:32px 1fr auto;gap:8px;padding:7px 9px;border-radius:9px;background:#ffffff0d;margin-bottom:4px;font-size:14px}
.ol-r b{color:#ffd54a}.ol-r i{font-style:normal;font-weight:800}
.ol-r.me{background:#ffcf3a33;box-shadow:inset 0 0 0 1px #ffcf3a}
.ol-r.empty{display:block;text-align:center;color:#c9d4e0}
.ol-name{margin-top:10px;display:flex;gap:6px;align-items:center;font-size:13px}
.ol-name input{flex:1;min-width:0;border-radius:8px;border:1px solid #ffd77a88;background:#0006;color:#fff;padding:6px 8px;font:600 14px "Manrope",sans-serif}
.ol-save{border:0;border-radius:8px;padding:7px 12px;background:#2a9a3a;color:#fff;font-weight:800;cursor:pointer}

/* audit 15.11: the Try again button sits on its own line under the text */
.defeat-banner .banner-retry{display:block;margin:12px auto 0;width:max-content}

/* 16.11 map: the logo, stars and coins stay in the top bar (bigger); workshop, tasks, records and the 2.5D/3D
   switch are big square tiles fixed on the right edge while the map scrolls under them */
body[data-portal="1"] #camp .adv-top { padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: 12px; }
body[data-portal="1"] #camp .adv-logo { font-size: clamp(28px, 8vw, 38px); }
body[data-portal="1"] #camp .adv-chips { gap: 8px; }
body[data-portal="1"] #camp .adv-chip { font-size: 17px; padding: 7px 13px; border-radius: 18px; }
.adv-side { display: none; }
body[data-portal="1"] #camp .adv-side { display: block; position: sticky; top: 74px; height: 0; z-index: 11; }
.adv-side-in { position: absolute; right: 2px; top: 6px; display: flex; flex-direction: column; gap: 10px; }
.adv-side .adv-tile {
  position: relative; width: 70px; height: 70px; min-height: 0; padding: 0; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 16px; border: 2px solid #fff3c4; text-decoration: none; overflow: visible;
  background: linear-gradient(#ffdf8a, #e39b2c); color: #3a2406;
  box-shadow: 0 5px 0 #8a5412, 0 8px 16px #0008; cursor: pointer;
  animation: advTileGlow 2.8s ease-in-out infinite;
}
.adv-side .adv-tile:active { transform: translateY(3px); box-shadow: 0 2px 0 #8a5412, 0 4px 10px #0008; }
.adv-side .adv-tile i { font-style: normal; font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 0 #fff6); }
.adv-side .adv-tile span { display: block !important; font-size: 11px; font-weight: 900; line-height: 1.05; text-align: center; max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adv-side #openWorkshop { order: 1; }
.adv-side #openMissions { order: 2; background: linear-gradient(#bff0a0, #4fb24a); box-shadow: 0 5px 0 #23662a, 0 8px 16px #0008; }
.adv-side #openBoard { order: 3; background: linear-gradient(#ffe9ff, #c77dff); box-shadow: 0 5px 0 #6a2f9a, 0 8px 16px #0008; }
.adv-side .adv-view { order: 4; background: #0f3a4a; border-color: #9ff4ff; box-shadow: 0 5px 0 #06222c, 0 8px 16px #0008; color: #fff; overflow: hidden; justify-content: flex-end; animation: none; }
.adv-side .adv-view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.adv-side .adv-view span { position: relative; width: 100%; max-width: none; padding: 2px 0 3px; background: #000a; font-size: 13px; border-radius: 0 0 14px 14px; }
.adv-side .adv-missions.ready::after { top: -5px; right: -5px; width: 15px; height: 15px; }
@keyframes advTileGlow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }
@media (min-width: 700px) { .adv-side .adv-tile { width: 84px; height: 84px; } .adv-side .adv-tile i { font-size: 36px; } .adv-side .adv-tile span { font-size: 12px; max-width: 80px; } }
body[data-portal="1"] #camp #stormCard { margin-right: 82px; }
@media (min-width: 700px) { body[data-portal="1"] #camp #stormCard { margin-right: 96px; } }
.adv-side .adv-tile span { font-size: 10px; letter-spacing: -0.2px; max-width: 68px; }
body[data-portal="1"] #camp #stormCard .storm-txt b { font-size: clamp(20px, 6.2vw, 30px); letter-spacing: 2px; }
body[data-portal="1"] #camp #stormCard .storm-anim { max-width: 34%; }

/* 16.11 phones: no live blur behind the map (the field under it is frozen anyway) — the blur over a canvas was the
   heaviest thing on the screen while scrolling the map and the workshop */
body[data-portal="1"][data-session="between"] #camp { backdrop-filter: none; -webkit-backdrop-filter: none; background: linear-gradient(#071514f2, #0b1d1cfa); }


/* 16.11 Storm-only workshop items: a dark locked picture with "🔒 STORM · wave N" until the wave is reached */
.upgrade-options button.storm-locked, .trail-options button.storm-locked { position: relative; opacity: 1; filter: none; }
.upgrade-options button.storm-locked .ws-icon, .trail-options button.storm-locked .tr-pic { filter: grayscale(0.85) brightness(0.45); }
.upgrade-options button.storm-locked::after, .trail-options button.storm-locked::after {
  content: "⚔"; position: absolute; top: 6px; right: 8px; font-size: 18px; color: #ffd54a; text-shadow: 0 0 8px #ff8a2a;
}
.ws-price.storm { background: linear-gradient(#5a1a1a, #2a0a0a) !important; color: #ffd54a !important; border-color: #ff8a2a88 !important; font-size: 11px !important; white-space: nowrap; }
.ws-pips i.storm { font-style: normal; font-size: 9px; line-height: 10px; text-align: center; color: #ffd54a; background: #3a1a0a; border-color: #ff8a2a; }
.ws-pips i.storm.on { background: #ff8a2a; color: #fff; }

/* 16.11 Storm gear: same cards as the start gear, with the painted Storm objects */
.storm-kit-shop { background: linear-gradient(#3a1a14, #241310); border-top-color: #ff8a2a88; }
.storm-kit-shop .upgrade-heading span { color: #ffd54a; }
.storm-kit-options button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; background: #4a2418; border-color: #b0562a; }
.storm-kit-options .kit-pic { display: grid; place-items: center; width: 54px; height: 54px; }
.storm-kit-options .kit-pic img { max-width: 54px; max-height: 54px; object-fit: contain; filter: drop-shadow(0 3px 4px #0008); }
.storm-kit-options button.kit-have { opacity: 1; border-color: #6cd46a; background: #24401f; }
.storm-kit-options button.storm-locked .kit-pic { filter: grayscale(0.85) brightness(0.45); }

/* 16.11 Storm cards on the field: tap = use; with none left the button shows the price and buys one */
.storm-kit-bar { position: absolute; left: max(10px, env(safe-area-inset-left)); bottom: max(80px, calc(env(safe-area-inset-bottom) + 70px)); z-index: 27; display: flex; flex-direction: column; gap: 8px; }
.storm-kit-bar[hidden] { display: none; }
.storm-kit-bar button { position: relative; width: 52px; height: 52px; padding: 0; border-radius: 14px; border: 2px solid #ffd77a; background: radial-gradient(#5a2a14, #2a120a); box-shadow: 0 3px 0 #6a2a06, 0 6px 12px #0008; touch-action: manipulation; }
.storm-kit-bar button img { width: 40px; height: 40px; object-fit: contain; pointer-events: none; }
.storm-kit-bar button em { position: absolute; right: -6px; bottom: -6px; min-width: 22px; padding: 1px 5px; border-radius: 10px; background: #ffd54a; color: #3a1a00; font: 900 12px/16px system-ui, sans-serif; font-style: normal; pointer-events: none; white-space: nowrap; }
.storm-kit-bar button.empty { border-color: #8a6a3a; }
.storm-kit-bar button.empty img { filter: grayscale(0.6) brightness(0.7); }
.storm-kit-bar button.empty em { background: #2a1a0a; color: #ffd54a; border: 1px solid #ffd54a; }
.storm-kit-bar button:active { transform: translateY(2px); }
.storm-kit-options .kit-pic { position: relative; }
.storm-kit-options .kit-pic em { position: absolute; right: -8px; bottom: -4px; padding: 0 5px; border-radius: 9px; background: #6cd46a; color: #062a06; font: 900 12px/16px system-ui, sans-serif; font-style: normal; }
/* 17.11: a Storm card you can still buy is not dark — gold glow says "you can buy it here" */
.storm-kit-bar button.empty { border-color: #ffd77a; background: radial-gradient(#7a4a1a, #3a1e0a); animation: kitBuy 1.6s ease-in-out infinite; }
.storm-kit-bar button.empty img { filter: none; }
.storm-kit-bar button.empty em { background: linear-gradient(#ffe48a, #e7a52c); color: #3a1a00; border: 1px solid #fff3c4; }
@keyframes kitBuy { 0%, 100% { box-shadow: 0 3px 0 #6a2a06, 0 0 6px #ffd54a66; } 50% { box-shadow: 0 3px 0 #6a2a06, 0 0 16px #ffd54acc; } }
.storm-kit-bar button:focus { outline: none; }

/* 17.11 campaign finale */
.finale { position: fixed; inset: 0; z-index: 2147483000; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: inherit; animation: finIn 0.5s ease-out; }
.fin-sky { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 35%, #3a2a6a 0%, #1a1238 45%, #07060f 100%); }
.fin-sky::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 38%, #ffd66a55, transparent 45%); opacity: 0; animation: finDawn 2s 3s forwards; }
.fin-stage { position: relative; width: min(92vw, 520px); height: min(60vh, 460px); }
.fin-dragon { position: absolute; left: 50%; top: 50%; width: min(78vw, 400px); aspect-ratio: 1; transform: translate(-50%, -50%); animation: finDragon 3.4s cubic-bezier(.5,0,.6,1) forwards; }
.fin-dragon img { width: 100%; height: 100%; object-fit: contain; animation: finHit 0.5s 1.15s; }
.fin-sword { display: none; position: absolute; left: 50%; top: 50%; width: 70px; height: 340px; margin: -170px 0 0 -35px; opacity: 0; filter: drop-shadow(0 0 14px #fff); animation: finSword 0.75s 0.75s ease-in forwards; }
.fin-slash { position: absolute; left: 8%; top: 48%; width: 84%; height: 10px; border-radius: 6px; background: linear-gradient(90deg, transparent, #fff, #ffe9a0, transparent); transform: rotate(-32deg) scaleX(0); opacity: 0; box-shadow: 0 0 22px #fff; animation: finSlash 0.5s 1.1s ease-out forwards; }
.fin-flash { position: absolute; inset: -40vh -40vw; background: #fff; opacity: 0; animation: finFlash 0.45s 1.15s ease-out; }
.fin-shards i { position: absolute; left: 50%; top: 50%; width: 14px; height: 22px; background: var(--c); clip-path: polygon(50% 0, 100% 40%, 60% 100%, 0 60%); opacity: 0; animation: finShard 1.1s 1.2s ease-out forwards; }
.fin-rain b { position: absolute; top: -30px; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3b0, #f2b81f 55%, #a86a08); box-shadow: 0 0 6px #ffd54a; opacity: 0; animation: finCoin var(--d) var(--t) linear infinite; animation-delay: calc(3.2s + var(--t)); }
.fin-text { position: relative; text-align: center; color: #fff; opacity: 0; transform: translateY(20px); animation: finText 0.7s 3.1s ease-out forwards; padding: 0 16px; }
.fin-text h1 { margin: 0; font-size: clamp(44px, 13vw, 84px); letter-spacing: 4px; color: #ffd54a; text-shadow: 0 4px 0 #8a5412, 0 0 30px #ffb02a; }
.fin-text p { margin: 8px 0; font-size: clamp(15px, 4.2vw, 20px); font-weight: 700; text-shadow: 0 2px 4px #000; }
.fin-stats { color: #ffe9a0; font-size: 20px !important; }
.fin-btns { display: flex; gap: 12px; justify-content: center; margin-top: 14px; }
.fin-btns button { font: inherit; font-weight: 900; font-size: 18px; padding: 12px 22px; border-radius: 16px; border: 2px solid #fff3c4; cursor: pointer; }
.fin-storm { background: linear-gradient(#ff9a4a, #c2410c); color: #fff; box-shadow: 0 5px 0 #7a2406; }
.fin-map { background: linear-gradient(#ffdf8a, #e39b2c); color: #3a2406; box-shadow: 0 5px 0 #8a5412; }
@keyframes finIn { from { opacity: 0; } }
@keyframes finDawn { to { opacity: 1; } }
@keyframes finSword { 0% { opacity: 0; transform: translate(-190px, -230px) rotate(-70deg); } 25% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(150px, 140px) rotate(35deg); } }
@keyframes finSlash { 0% { opacity: 1; transform: rotate(-32deg) scaleX(0); } 60% { opacity: 1; transform: rotate(-32deg) scaleX(1); } 100% { opacity: 0; transform: rotate(-32deg) scaleX(1.1); } }
@keyframes finFlash { 0% { opacity: 0.85; } 100% { opacity: 0; } }
@keyframes finHit { 0%, 100% { transform: none; filter: drop-shadow(0 0 24px #9f6bff); } 20% { transform: translate(-14px, 6px) rotate(-6deg); filter: brightness(2.2) drop-shadow(0 0 30px #fff); } 50% { transform: translate(10px, -4px) rotate(4deg); } }
@keyframes finDragon { 0% { transform: translate(-50%, -50%) scale(0.85); } 30% { transform: translate(-50%, -52%) scale(1); } 40% { transform: translate(-50%, -50%) scale(1); } 100% { transform: translate(60%, -190%) scale(0.08) rotate(40deg); opacity: 0.2; } }
@keyframes finShard { 0% { opacity: 1; transform: translate(-50%, -50%) rotate(0); } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx) * 1.8), calc(-50% + var(--dy) * 1.8 + 80px)) rotate(var(--r)); } }
@keyframes finCoin { 0% { opacity: 1; transform: translateY(0) rotateY(0); } 100% { opacity: 1; transform: translateY(110vh) rotateY(720deg); } }
@keyframes finText { to { opacity: 1; transform: none; } }

/* 18.11 audit: no keyboard hint on phones */
@media (hover: none) and (pointer: coarse) {
  #overHint {
    display: none;
  }
}

/* 18.11 audit: sound toggle on the pause screen */
.over-sound {
  margin-left: 8px;
  min-width: 46px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #ffffff44;
  background: #ffffff14;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}

/* 28.11: a visible way back to all Tagshim games on the map (site only — portal builds drop #homeLink) */
.adv-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.adv-home {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: #ffffff1a; border: 1px solid #ffd77a88; color: #ffd77a; font-size: 26px; line-height: 1; text-decoration: none;
}
.adv-home:active { transform: scale(0.94); }
/* 28.11: iPhone Safari drops pictures that have a CSS filter inside the scrolling workshop sheet (the cards came out empty).
   No filters on workshop pictures: a soft shadow is painted behind them instead, and locked cards are simply dimmed. */
#camp .ws-icon,
#camp .ws-icon img,
#camp .kit-pic,
#camp .kit-pic img,
#camp .tr-pic,
#camp .tr-pic .tr-art,
#camp .upgrade-options button.storm-locked .ws-icon,
#camp .trail-options button.storm-locked .tr-pic,
#camp .storm-kit-options button.storm-locked .kit-pic { filter: none !important; }
#camp .ws-icon,
#camp .kit-pic { background: radial-gradient(ellipse 46% 16% at 50% 88%, #0000006b, transparent 100%); }
#camp button.storm-locked .ws-icon img,
#camp button.storm-locked .kit-pic img,
#camp button.storm-locked .tr-pic { opacity: 0.4; }
