.sg-app {
  --sg-accent: #ff6b35;
  --sg-secondary: #72f5cf;
  --sg-ink: #eef6ff;
  --sg-muted: #91a4bd;
  font:
    15px/1.5 Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--sg-ink);
  width: 100%;
  isolation: isolate;
}
.sg-app * {
  box-sizing: border-box;
}
.sg-app [hidden] {
  display: none !important;
}
.sg-app button,
.sg-app input,
.sg-app select {
  font: inherit;
}
.sg-app button {
  cursor: pointer;
  line-height: 1.3;
  transition:
    background 0.18s,
    transform 0.18s,
    color 0.18s;
  border: 0;
}
.sg-app button:disabled {
  opacity: 0.45;
  cursor: default;
}
.sg-app button:focus-visible,
.sg-app a:focus-visible,
.sg-app input:focus-visible,
.sg-app canvas:focus-visible,
.sg-app [data-cards-track]:focus-visible,
.sg-app select:focus-visible {
  outline: 3px solid var(--sg-secondary);
  outline-offset: 3px;
}
.sg-app button:hover:not(:disabled) {
  filter: brightness(1.12);
}
.sg-shell {
  overflow: hidden;
  border: 1px solid #2b3c55;
  border-radius: 20px;
  background: #0b1424;
  box-shadow: 0 24px 80px #00112635;
}
.sg-top {
  height: 74px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #213149;
  background: #101b2d;
}
.sg-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.sg-brand img {
  max-height: 46px;
  max-width: 200px;
  object-fit: contain;
}
.sg-brand-mark {
  font-size: 21px;
  font-weight: 900;
  color: #081423;
  background: var(--sg-secondary);
  padding: 5px 9px;
  transform: skew(-8deg);
  border-radius: 5px;
}
.sg-brand-mark span {
  color: #183d42;
}
.sg-top-actions {
  display: flex;
  gap: 8px;
}
.sg-top-actions button {
  color: #aabbd0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
}
.sg-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background:
    radial-gradient(ellipse at 85% 30%, #2b3d5a, transparent 60%),
    radial-gradient(ellipse at 20% 100%, #153843, transparent 50%), #111c30;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  container-type: inline-size;
}
.sg-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}
.sg-stage canvas:not(:focus-visible) {
  outline: none;
}
.sg-screen {
  position: absolute;
  inset: 0;
  background: #0d1629f5;
  padding: 4cqw;
  overflow-y: auto;
  z-index: 4;
}
.sg-home-screen {
  display: flex;
  background: linear-gradient(
    90deg,
    #101a2efc 0%,
    #101a2ef5 40%,
    #101a2e90 100%
  );
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  align-items: center;
}
.sg-home {
  width: 59%;
  z-index: 2;
  position: relative;
}
.sg-eyebrow {
  font-size: clamp(9px, 1.05cqw, 13px);
  letter-spacing: 0.16em;
  color: var(--sg-secondary);
  font-weight: 700;
  text-transform: uppercase;
  display: block;
}
.sg-eyebrow i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sg-accent);
  margin-right: 7px;
  box-shadow: 0 0 15px var(--sg-accent);
}
.sg-app h1 {
  font-size: clamp(28px, 6.3cqw, 78px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.065em;
  color: #fff;
  margin: 20px 0;
}
.sg-tagline {
  font-size: clamp(13px, 2cqw, 24px);
  font-weight: 650;
  color: #d9e6f5;
  margin: 0 0 12px;
}
.sg-intro {
  font-size: clamp(10px, 1.35cqw, 16px);
  color: var(--sg-muted);
  max-width: 410px;
}
.sg-home-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 24px;
}
.sg-app .sg-btn {
  border-radius: 10px;
  padding: 13px 20px;
  font-weight: 750;
  font-size: clamp(11px, 1.3cqw, 15px);
  color: #eaf2ff;
  background: #25344c;
  display: inline-flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  text-decoration: none;
}
.sg-app .sg-primary {
  background: var(--sg-accent);
  color: #101825;
  box-shadow: 0 6px 25px color-mix(in srgb, var(--sg-accent), transparent 80%);
}
.sg-app .sg-primary:active {
  transform: translateY(2px);
}
.sg-app .sg-ghost {
  background: #ffffff09;
  border: 1px solid #ffffff22;
}
.sg-note {
  font-size: 11px;
  color: var(--sg-muted);
  margin-top: 14px;
}
.sg-home-art {
  position: absolute;
  width: 43%;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sg-home-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  z-index: 1;
}
.sg-home-art img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.sg-orbit {
  position: absolute;
  width: 75%;
  aspect-ratio: 1;
  border: 1px solid #72f5cf30;
  border-radius: 50%;
  box-shadow:
    0 0 0 28px #72f5cf05,
    0 0 0 65px #72f5cf03;
  animation: sg-breathe 5s infinite ease-in-out;
}
.sg-art-caption {
  position: absolute;
  bottom: 11%;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: #8ea6bf;
  z-index: 2;
}
.sg-ticket {
  font-size: 11px;
  color: var(--sg-secondary);
  background: transparent;
  padding: 0;
  margin-top: 6px;
}
.sg-selection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--sg-muted);
  letter-spacing: 0.15em;
}
.sg-back {
  background: transparent;
  color: #cedbf0;
  padding: 0;
  font-size: 12px;
}
.sg-select-tabs {
  display: flex;
  gap: 24px;
  margin: 18px 0;
}
.sg-select-tabs button {
  background: transparent;
  color: var(--sg-muted);
  padding: 9px 0;
  border-bottom: 2px solid transparent;
}
.sg-select-tabs button.active {
  color: #fff;
  border-color: var(--sg-accent);
}
.sg-select-tabs b {
  font-size: 10px;
  color: var(--sg-secondary);
  margin-right: 7px;
}
.sg-cards {
  position: relative;
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #526980 #122033;
  padding: 4px 2px 10px;
  scroll-snap-type: x mandatory;
}
.sg-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  position: relative;
  flex: 0 0 24%;
  max-width: 260px;
  min-width: 180px;
  scroll-snap-align: start;
  text-align: left;
  color: #fff;
  background: #17243a;
  border: 1px solid #34465e !important;
  border-radius: 12px;
  overflow: hidden;
  padding: 0 !important;
}
.sg-card.selected {
  border-color: var(--sg-secondary) !important;
  box-shadow: 0 0 0 1px var(--sg-secondary);
}
.sg-card-image {
  flex: 0 0 auto;
  width: 100%;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: radial-gradient(circle, #2e4961, #172137);
}
.sg-card-image img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
/* Space around transparent weapon art, independent of the source proportions. */
.sg-card-image-weapon img {
  inset: 12%;
  width: 76%;
  height: 76%;
}
.sg-cards-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 8px;
}
.sg-cards-toolbar > span {
  font-size: 10px;
  color: var(--sg-muted);
}
.sg-cards-navigation {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sg-app .sg-cards-arrow {
  display: grid;
  place-items: center;
  min-width: 40px;
  padding: 0 10px;
  height: 40px;
  border-radius: 50%;
  background: #21354e;
  color: #e7f6ff;
  font-size: 20px;
  border: 1px solid #4a6580;
}
.sg-app .sg-cards-arrow:disabled {
  opacity: 0.3;
}
.sg-cards-range {
  min-width: 68px;
  text-align: center;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #b6cce2;
}
.sg-card > div:last-of-type {
  padding: 12px;
}
.sg-card strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.35;
  min-height: 2.7em;
  font-size: 13px;
}
.sg-card span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.5;
  min-height: 3em;
  color: var(--sg-muted);
  font-size: 10px;
  margin-top: 5px;
}
.sg-card i {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--sg-secondary);
  color: #122539;
  border-radius: 50%;
  width: 23px;
  height: 23px;
  font-style: normal;
  text-align: center;
  line-height: 23px;
}
.sg-select-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.sg-select-foot p {
  font-size: 11px;
  color: var(--sg-muted);
}
.sg-select-foot strong {
  color: #bccce0;
}
.sg-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 30px;
  background: linear-gradient(#071222c9, transparent);
  z-index: 3;
  pointer-events: none;
}
.sg-hud small {
  display: block;
  font-size: 8px;
  letter-spacing: 0.16em;
  color: #91abc6;
}
.sg-hud strong {
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: 23px;
  letter-spacing: -0.02em;
}
.sg-hud [data-hud="score"] {
  color: var(--sg-secondary);
}
.sg-hud [data-hud="lives"] {
  color: #ff7c92;
  font-size: 19px;
}
.sg-play-actions button {
  color: #fff;
  background: #ffffff12;
  border: 1px solid #ffffff22;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  pointer-events: auto;
}
.sg-touch {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  display: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.sg-touch-left,
.sg-touch-right {
  position: absolute;
  bottom: 13px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.sg-touch-left {
  left: 18px;
}
.sg-touch-right {
  right: 18px;
}
.sg-touch button {
  pointer-events: auto;
  touch-action: none;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: #132339c9;
  border: 1px solid #b9d2e54d;
  color: #e8f4ff;
  font-size: 22px;
  box-shadow: 0 3px 15px #0003;
}
.sg-touch .sg-fire {
  width: 64px;
  height: 64px;
  background: var(--sg-accent);
  color: #172034;
  border-radius: 50%;
}
.sg-touch button.pressed {
  background: var(--sg-secondary);
  color: #0f2537;
  transform: scale(0.94);
}
.sg-result,
.sg-pause {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.sg-result h2 {
  font-size: clamp(35px, 7cqw, 84px);
  letter-spacing: -0.06em;
  margin: 10px 0;
  color: #fff;
  line-height: 1.1;
}
.sg-result h2 small {
  font-size: 20%;
  color: var(--sg-secondary);
  letter-spacing: 0;
}
.sg-result > p {
  color: var(--sg-muted);
  font-size: clamp(10px, 1.3cqw, 15px);
}
.sg-result-status {
  font-size: 11px;
  color: var(--sg-secondary);
  margin: 5px;
}
.sg-result-status button,
.sg-result-links button {
  color: #cad9e9;
  background: transparent;
  text-decoration: underline;
  font-size: 11px;
  padding: 8px;
}
.sg-result .sg-home-actions {
  justify-content: center;
  margin-top: 12px;
}
.sg-result-links {
  display: flex;
  margin-top: 12px;
}
.sg-pause h2 {
  font-size: clamp(35px, 7cqw, 70px);
  color: white;
  letter-spacing: -0.05em;
  margin: 20px 0;
}
.sg-pause .sg-btn {
  margin: 6px;
  min-width: 200px;
}
.sg-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 24px;
  border-top: 1px solid #213149;
  color: #778fa8;
  font-size: 10px;
}
.sg-bottom > span:first-child {
  letter-spacing: 0.13em;
  color: #adc1d7;
  font-weight: 700;
}
.sg-bottom button {
  background: transparent;
  color: #b6c9df;
  font-size: 11px;
}
.sg-announcement {
  margin: 0;
  padding: 0 24px;
  color: var(--sg-secondary);
  background: #0e1d2f;
  font-size: 12px;
  min-height: 0;
}
.sg-announcement:not(:empty) {
  padding: 10px 24px;
  border-top: 1px solid #243b51;
}
.sg-dialog {
  width: min(540px, 94vw);
  max-height: 90dvh;
  border: 1px solid #364963;
  border-radius: 18px;
  background: #142137;
  color: #e9f3ff;
  padding: 32px;
  box-shadow: 0 24px 100px #0007;
  z-index: 100;
}
.sg-dialog::backdrop {
  background: #060d1ce0;
  backdrop-filter: blur(6px);
}
.sg-dialog h2 {
  font-size: 28px;
  color: #fff;
  letter-spacing: -0.04em;
  margin: 8px 0 20px;
}
.sg-dialog p {
  color: #9fb4cb;
  font-size: 14px;
}
.sg-dialog .sg-close {
  position: absolute;
  top: 10px;
  right: 12px;
  color: #d6e8ff;
  background: transparent;
  font-size: 24px;
}
.sg-dialog label {
  display: block;
  font-size: 12px;
  color: #bed0e4;
  margin: 14px 0;
}
.sg-dialog input:not([type="checkbox"]):not([type="range"]),
.sg-dialog select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid #38506b;
  border-radius: 8px;
  background: #0f1c30;
  color: white;
  min-height: 42px;
}
.sg-dialog .sg-btn {
  font-size: 13px;
  margin: 6px 0;
}
.sg-dialog .sg-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
}
.sg-check input {
  margin-top: 4px;
}
.sg-dialog a {
  color: var(--sg-secondary);
}
.sg-dialog .sg-honey {
  display: none;
}
.sg-form-message {
  color: var(--sg-secondary);
  font-size: 12px;
  white-space: pre-line;
}
.sg-account-links {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  gap: 10px;
}
.sg-account-links button,
.sg-board-nav button {
  background: transparent;
  color: #b4c9df;
  font-size: 12px;
  padding: 8px 0;
}
.sg-volume {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.sg-volume input {
  width: 55%;
  accent-color: var(--sg-accent);
}
.sg-board {
  list-style: none;
  margin: 14px 0;
  padding: 0;
}
.sg-board li {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #2b3e56;
  padding: 12px 0;
  font-size: 13px;
}
.sg-board li b {
  color: var(--sg-accent);
}
.sg-board li strong {
  margin-left: auto;
  color: var(--sg-secondary);
  font-variant-numeric: tabular-nums;
}
.sg-board-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.sg-board-filters {
  display: flex;
  gap: 12px;
}
.sg-board-filters label {
  width: 50%;
  margin-top: 0;
}
.sg-preline {
  white-space: pre-line;
}
.sg-rotate {
  display: none;
}
.sg-app:fullscreen,
.sg-expanded {
  position: fixed;
  inset: 0;
  background: #050b16;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2147483600;
}
.sg-app:fullscreen .sg-shell,
.sg-expanded .sg-shell {
  width: min(100vw, calc((100dvh - 64px) * 16 / 9));
  border: 0;
  border-radius: 0;
  max-height: 100dvh;
}
.sg-app:fullscreen .sg-top,
.sg-expanded .sg-top {
  height: 42px;
  padding: 0 16px;
}
.sg-app:fullscreen .sg-brand img,
.sg-expanded .sg-brand img {
  max-height: 30px;
}
.sg-app:fullscreen .sg-bottom,
.sg-expanded .sg-bottom {
  height: 22px;
  padding: 0 16px;
}
.sg-app:fullscreen .sg-announcement,
.sg-expanded .sg-announcement {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 8;
}
.sg-app:fullscreen .sg-dialog {
  position: fixed;
}
.sg-font-mono {
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.sg-failure,
.sg-loading {
  background: #14243b;
  color: #c2d9ef;
  padding: 32px;
  border-radius: 16px;
}
.sg-failure h2 {
  color: white;
}
@keyframes sg-breathe {
  50% {
    transform: scale(1.07);
    opacity: 0.5;
  }
}
@media (pointer: coarse) {
  .sg-touch {
    display: block;
  }
  .sg-top {
    height: 54px;
    padding: 0 15px;
  }
  .sg-top-actions span {
    display: none;
  }
  .sg-bottom > span:nth-child(2) {
    display: none;
  }
  .sg-stage .sg-home-actions {
    margin-top: 12px;
  }
  .sg-stage .sg-btn {
    padding: 10px 14px;
    min-height: 40px;
  }
  .sg-stage .sg-note {
    margin-top: 8px;
  }
  .sg-stage .sg-card {
    min-width: 160px;
  }
  .sg-select-tabs {
    margin: 10px 0;
  }
  .sg-cards-toolbar > span {
    max-width: 42%;
  }
  .sg-app .sg-cards-arrow {
    width: 44px;
    height: 44px;
  }
  .sg-cards {
    gap: 10px;
  }
  .sg-select-foot {
    margin-top: 0;
  }
  .sg-card > div:last-of-type {
    padding: 8px;
  }
  .sg-hud {
    gap: 22px;
    padding: 8px 15px;
  }
  .sg-hud strong {
    font-size: 20px;
  }
  .sg-play-actions button {
    height: 34px;
    min-width: 34px;
    padding: 0 8px;
  }
}
@media (pointer: coarse) and (orientation: portrait) {
  .sg-rotate {
    position: absolute;
    inset: 0;
    background: #101c30;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 16px;
    text-align: center;
  }
  .sg-stage {
    min-height: 300px;
  }
  .sg-rotate > span {
    font-size: 48px;
    color: var(--sg-secondary);
  }
  .sg-rotate h2 {
    font-size: 22px;
    color: white;
    margin: 8px;
  }
  .sg-rotate p {
    font-size: 13px;
    color: #9cb3cb;
    margin: 0 0 15px;
  }
  .sg-rotate button {
    background: var(--sg-accent);
    padding: 11px 18px;
    border-radius: 8px;
    color: #152238;
    font-weight: 700;
  }
  .sg-app:fullscreen .sg-shell,
  .sg-expanded .sg-shell {
    width: 100vw;
  }
}
@media (max-width: 700px) {
  .sg-shell {
    border-radius: 12px;
  }
  .sg-top {
    padding: 0 12px;
  }
  .sg-top-actions {
    gap: 0;
  }
  .sg-top-actions button {
    padding: 8px;
  }
  .sg-top-actions span {
    display: none;
  }
  .sg-bottom {
    padding: 10px 12px;
  }
  .sg-bottom > span:nth-child(2) {
    display: none;
  }
  .sg-stage .sg-screen {
    padding: 3cqw;
  }
  .sg-art-caption {
    display: none;
  }
  .sg-stage .sg-home-actions {
    gap: 7px;
  }
  .sg-stage .sg-home-actions .sg-btn {
    font-size: 10px;
    padding: 9px 10px;
  }
  .sg-stage .sg-note {
    font-size: 9px;
  }
  .sg-home .sg-intro {
    max-width: 270px;
  }
  .sg-home h1 {
    margin: 10px 0;
  }
  .sg-stage .sg-result-links {
    margin-top: 4px;
  }
  .sg-result .sg-home-actions {
    margin-top: 5px;
  }
  .sg-result .sg-note {
    margin: 4px 0;
  }
  .sg-select-foot p {
    font-size: 9px;
  }
  .sg-selection-head {
    font-size: 8px;
  }
  .sg-stage .sg-card {
    min-width: 150px;
  }
  .sg-card strong {
    font-size: 11px;
  }
  .sg-card span {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sg-orbit {
    animation: none;
  }
  .sg-app button {
    transition: none;
  }
}

.sg-touch-device .sg-touch {
  display: block;
}
@media (orientation: portrait) {
  .sg-touch-device .sg-rotate {
    position: absolute;
    inset: 0;
    background: #101c30;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 16px;
    text-align: center;
  }
  .sg-touch-device .sg-stage {
    min-height: 300px;
  }
  .sg-touch-device .sg-rotate > span {
    font-size: 48px;
    color: var(--sg-secondary);
  }
  .sg-touch-device .sg-rotate h2 {
    font-size: 22px;
    color: white;
    margin: 8px;
  }
  .sg-touch-device .sg-rotate p {
    font-size: 13px;
    color: #9cb3cb;
    margin: 0 0 15px;
  }
  .sg-touch-device .sg-rotate button {
    background: var(--sg-accent);
    padding: 11px 18px;
    border-radius: 8px;
    color: #152238;
    font-weight: 700;
  }
}

.sg-top-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sg-top-actions svg {
  flex-shrink: 0;
}

.sg-play-actions { display: flex; gap: 8px; margin-left: auto; }
.sg-play-actions button { white-space: nowrap; font-size: 12px; }
.sg-result-links { flex-wrap: wrap; justify-content: center; }
.sg-claim-message { min-height: 1.4em; max-width: 55em; }
@media (max-width: 600px) {
  .sg-hud { gap: 10px; padding: 6px 8px; }
  .sg-play-actions { gap: 4px; }
  .sg-play-actions button { font-size: 10px; padding: 0 6px; }
}

.sg-card-copy { flex: 1 0 auto; }
.sg-card-image::before {
  content: "Chargement…"; position: absolute; inset: 0; display: grid;
  place-items: center; font-size: 11px; color: #b6cce2; padding: 12px;
}
.sg-card-image[data-image-state="error"]::before { content: "Image indisponible"; }
.sg-card-image[data-image-state="ready"]::before { content: none; }

/* Mobile controls: one left thumb can combine movement and stance/jump. */
.sg-stick {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 1px solid #b9d2e570;
  background: radial-gradient(circle, #243d55b8 0 35%, #132339b8 65%);
  color: #e1f6ff;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.sg-stick > span { position: absolute; pointer-events: none; font-size: 18px; line-height: 20px; }
.sg-stick-up { top: 5px; left: calc(50% - 6px); }
.sg-stick-down { bottom: 5px; left: calc(50% - 6px); }
.sg-stick-left { left: 7px; top: calc(50% - 10px); }
.sg-stick-right { right: 7px; top: calc(50% - 10px); }
.sg-stick .sg-stick-thumb {
  width: 40px; height: 40px; left: calc(50% - 20px); top: calc(50% - 20px);
  border-radius: 50%; background: #a1cadb80; border: 1px solid #d6f5ffc0;
  transform: translate(var(--sg-stick-x, 0px), var(--sg-stick-y, 0px));
}
.sg-stick.pressed .sg-stick-thumb { background: var(--sg-secondary); }
.sg-touch-left, .sg-touch-right { pointer-events: auto; }
.sg-touch-left { left: max(12px, env(safe-area-inset-left, 0px)); }
.sg-touch-right { right: max(12px, env(safe-area-inset-right, 0px)); }
.sg-touch button { -webkit-touch-callout: none; }
.sg-is-playing .sg-stage { touch-action: none; overscroll-behavior: contain; }
.sg-screen { overscroll-behavior: contain; touch-action: pan-y; }
.sg-cards { touch-action: pan-x pan-y; }
.sg-app:fullscreen, .sg-expanded {
  --sg-safe-top: env(safe-area-inset-top, 0px);
  --sg-safe-bottom: env(safe-area-inset-bottom, 0px);
  --sg-safe-left: env(safe-area-inset-left, 0px);
  --sg-safe-right: env(safe-area-inset-right, 0px);
  padding: var(--sg-safe-top) var(--sg-safe-right) var(--sg-safe-bottom) var(--sg-safe-left);
}
.sg-app:fullscreen .sg-shell, .sg-expanded .sg-shell {
  width: min(calc(100vw - var(--sg-safe-left) - var(--sg-safe-right)), calc((100dvh - 64px - var(--sg-safe-top) - var(--sg-safe-bottom)) * 16 / 9));
  max-height: calc(100dvh - var(--sg-safe-top) - var(--sg-safe-bottom));
}
.sg-app button:focus-visible, .sg-stick:focus-visible { outline: 3px solid var(--sg-secondary); outline-offset: 2px; }
@media (pointer: coarse) {
  .sg-play-actions button, .sg-top-actions button, .sg-select-tabs button,
  .sg-result-links button, .sg-back, .sg-account-links button, .sg-board-nav button,
  .sg-bottom button { min-width: 44px; min-height: 44px; }
  .sg-dialog input:not([type="checkbox"]):not([type="range"]), .sg-dialog select { font-size: 16px; }
  .sg-dialog { padding: 24px 18px; }
  .sg-dialog .sg-close { min-width: 44px; min-height: 44px; top: 0; right: 0; }
  .sg-hud { padding-top: 4px; gap: 12px; }
  .sg-hud strong { font-size: 17px; }
  .sg-play-actions { gap: 5px; }
  .sg-play-actions button { padding: 0 8px; }
  .sg-screen .sg-home-actions, .sg-account-links { flex-wrap: wrap; }
  .sg-home-screen { align-items: flex-start; }
  .sg-home { padding-bottom: 12px; }
}
@media (max-height: 450px) and (orientation: landscape) {
  .sg-touch-left, .sg-touch-right { bottom: 8px; }
  .sg-hud { gap: 10px; padding: 3px 8px; }
  .sg-hud strong { font-size: 16px; }
  .sg-hud [data-hud="lives"] { font-size: 16px; }
  .sg-home h1 { margin: 5px 0; }
  .sg-home-screen { align-items: flex-start; }
  .sg-screen .sg-home-actions { flex-wrap: wrap; }
}
@media (orientation: landscape) {
  /* Put the thumbs toward the device edges, using letterbox space where available. */
  .sg-expanded.sg-touch-device .sg-shell,
  .sg-app:fullscreen.sg-touch-device .sg-shell,
  .sg-expanded.sg-touch-device .sg-stage,
  .sg-app:fullscreen.sg-touch-device .sg-stage { overflow: visible; }
  .sg-expanded.sg-touch-device .sg-touch-left,
  .sg-app:fullscreen.sg-touch-device .sg-touch-left {
    left: calc((100% - 100vw - var(--sg-safe-left) + var(--sg-safe-right)) / 2 + max(12px, env(safe-area-inset-left, 0px)));
  }
  .sg-expanded.sg-touch-device .sg-touch-right,
  .sg-app:fullscreen.sg-touch-device .sg-touch-right {
    right: calc((100% - 100vw + var(--sg-safe-left) - var(--sg-safe-right)) / 2 + max(12px, env(safe-area-inset-right, 0px)));
    display: grid; grid-template-columns: 44px 64px; grid-template-rows: 44px 44px; gap: 8px;
  }
  .sg-expanded.sg-touch-device .sg-touch-right button,
  .sg-app:fullscreen.sg-touch-device .sg-touch-right button { width: 44px; height: 44px; }
  .sg-expanded.sg-touch-device .sg-touch-right [data-key="4"],
  .sg-app:fullscreen.sg-touch-device .sg-touch-right [data-key="4"] { grid-column: 1; grid-row: 1; }
  .sg-expanded.sg-touch-device .sg-touch-right [data-key="8"],
  .sg-app:fullscreen.sg-touch-device .sg-touch-right [data-key="8"] { grid-column: 1; grid-row: 2; }
  .sg-expanded.sg-touch-device .sg-touch-right .sg-fire,
  .sg-app:fullscreen.sg-touch-device .sg-touch-right .sg-fire {
    grid-column: 2; grid-row: 1 / 3; align-self: center; width: 64px; height: 64px;
  }
}
@media (pointer: coarse) {
  .sg-select-foot p { font-size: 12px; }
}
@media (max-height: 360px) and (orientation: landscape) {
  .sg-stick { width: 104px; height: 104px; }
}

.sg-announcement { pointer-events: none; }
.sg-is-playing .sg-announcement {
  position: absolute; width: 1px; height: 1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
