.sl-shell {
  box-sizing: border-box;
  --sl-ink: #eef5e9;
  --sl-muted: #a9c3a5;
  --sl-night: #12241a;
  --sl-line: rgba(180, 220, 180, 0.22);
  --sl-aqua: #70e1ce;
  --sl-gold: #f4cc78;
  --sl-coral: #f17e62;
  --sl-amber: #e8a94e;
  width: min(92vw, 720px);
  max-width: 720px;
  min-width: 0;
  margin: 0 auto;
  padding: 0 10px 22px;
  overflow-x: hidden;
  color: var(--sl-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sl-shell *,
.sl-shell *::before,
.sl-shell *::after,
.sl-modal *,
.sl-modal *::before,
.sl-modal *::after {
  box-sizing: border-box;
}

.sl-shell .sl-hidden,
.sl-modal.sl-hidden {
  display: none !important;
}

.sl-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.sl-stats,
.sl-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sl-stat {
  min-width: 72px;
  padding: 7px 9px;
  border: 1px solid var(--sl-line);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(18, 42, 30, 0.94), rgba(10, 26, 20, 0.94));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  text-align: center;
}

.sl-stat span,
.sl-gauge span,
.sl-kicker {
  display: block;
  color: var(--sl-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1.15;
  text-transform: uppercase;
}

.sl-stat strong {
  display: block;
  margin-top: 3px;
  color: #f6fbf5;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1;
}

.sl-button,
.sl-touch-button,
.sl-modal-close {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(190, 230, 190, 0.3);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(24, 64, 46, 0.96), rgba(12, 34, 26, 0.96));
  color: var(--sl-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, opacity 120ms ease;
}

.sl-button {
  padding: 0 13px;
}

.sl-button:hover,
.sl-touch-button:hover,
.sl-modal-close:hover {
  transform: translateY(-1px);
  border-color: var(--sl-aqua);
}

.sl-button:active,
.sl-touch-button:active,
.sl-touch-button[aria-pressed="true"] {
  transform: translateY(1px);
  border-color: var(--sl-gold);
  background: linear-gradient(180deg, #2a5a44, #14302a);
}

.sl-button:focus-visible,
.sl-touch-button:focus-visible,
.sl-modal-close:focus-visible,
.sl-canvas:focus-visible {
  outline: 3px solid rgba(112, 225, 206, 0.78);
  outline-offset: 3px;
}

.sl-button:disabled {
  cursor: wait;
  opacity: 0.48;
  transform: none;
}

.sl-square {
  width: 46px;
  padding: 0;
  font-size: 18px;
}

.sl-sound {
  min-width: 52px;
  padding: 0 10px;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.sl-primary {
  border-color: rgba(244, 204, 120, 0.62);
  background: linear-gradient(180deg, #f3c975, #dba557);
  color: #102b32;
}

.sl-large {
  min-height: 50px;
  padding: 0 22px;
  font-size: 14px;
}

.sl-gauges {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  margin-bottom: 8px;
  padding: 8px 12px;
  border: 1px solid var(--sl-line);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(14, 38, 28, 0.96), rgba(16, 44, 34, 0.9));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}

.sl-gauge {
  min-width: 0;
}

.sl-bar {
  height: 8px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(220, 240, 220, 0.14);
}

.sl-bar i {
  display: block;
  width: 30%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f4cc78, #e0703a);
  box-shadow: 0 0 10px rgba(244, 204, 120, 0.45);
}

.sl-bar .sl-fuel {
  background: linear-gradient(90deg, #6eae5f, #a8d18a);
}

.sl-object {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  min-width: 0;
}

.sl-object i {
  width: 8px;
  height: 8px;
  grid-row: 1 / span 2;
  border-radius: 50%;
  background: var(--sl-aqua);
  box-shadow: 0 0 14px rgba(112, 225, 206, 0.9);
}

.sl-object strong {
  overflow: hidden;
  color: #f6fbf5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sl-gauge-copy {
  min-width: 92px;
  text-align: right;
}

.sl-gauge-copy span,
.sl-gauge-copy b {
  display: block;
  color: var(--sl-gold);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.sl-gauge-copy b {
  color: var(--sl-muted);
  font-size: 10px;
  font-weight: 700;
}

.sl-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid rgba(190, 230, 190, 0.27);
  border-radius: 19px;
  background: linear-gradient(#9fd4e8, #e8d9a8 62%, #5f9e5f);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  touch-action: none;
  user-select: none;
}

.sl-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.sl-hud {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  padding: 6px 12px;
  border: 1px solid rgba(236, 248, 236, 0.24);
  border-radius: 999px;
  background: rgba(10, 30, 22, 0.76);
  color: #f7f2d6;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.sl-banner {
  position: absolute;
  z-index: 7;
  top: 54px;
  left: 50%;
  max-width: calc(100% - 24px);
  padding: 8px 14px;
  border: 1px solid rgba(255, 235, 175, 0.36);
  border-radius: 999px;
  background: rgba(10, 34, 24, 0.92);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
  color: #fff1bd;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.sl-touch {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: none;
  grid-template-columns: 54px 54px minmax(76px, 1fr) 62px;
  align-items: end;
  gap: 7px;
  pointer-events: none;
}

.sl-touch-button {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 0 5px;
  border-color: rgba(236, 248, 232, 0.28);
  background: rgba(8, 30, 22, 0.86);
  font-size: 11px;
  pointer-events: auto;
  touch-action: none;
  backdrop-filter: blur(8px);
}

.sl-touch-button:first-child,
.sl-touch-button:nth-child(2) {
  font-size: 27px;
  font-weight: 400;
}

.sl-touch-stoke {
  border-color: rgba(244, 204, 120, 0.74);
  background: linear-gradient(180deg, rgba(244, 204, 120, 0.96), rgba(218, 165, 87, 0.96));
  color: #102b32;
  font-size: 13px;
}

.sl-overlay {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: linear-gradient(180deg, rgba(4, 20, 14, 0.1), rgba(4, 20, 14, 0.46));
}

.sl-card {
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid rgba(221, 239, 222, 0.3);
  border-radius: 19px;
  background: linear-gradient(145deg, rgba(14, 44, 32, 0.96), rgba(8, 28, 20, 0.94));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.sl-card .sl-kicker {
  color: var(--sl-gold);
}

.sl-card h2,
.sl-modal h2 {
  margin: 8px 0 10px;
  color: #fbf7e7;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.sl-card p,
.sl-modal p {
  margin: 0 auto 14px;
  color: #c5d8c8;
  font-size: 13px;
  line-height: 1.55;
}

.sl-card small {
  display: block;
  margin-top: 12px;
  color: #91ae96;
  font-size: 10px;
  line-height: 1.4;
}

.sl-card-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 16px;
}

.sl-result-score {
  display: block;
  margin: 8px 0 4px;
  color: var(--sl-gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
}

.sl-result-best {
  margin-bottom: 0;
  color: #8fae96;
  font-size: 11px;
}

.sl-tip {
  margin: 10px 2px 0;
  color: #9db6a2;
  font-size: 11px;
  line-height: 1.45;
}

.sl-modal {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 12, 8, 0.76);
  backdrop-filter: blur(7px);
}

.sl-modal-card {
  position: relative;
  width: min(540px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  padding: 26px;
  overflow: auto;
  border: 1px solid rgba(221, 239, 222, 0.28);
  border-radius: 19px;
  background: linear-gradient(145deg, #10392a, #071d16);
  box-shadow: 0 28px 76px rgba(0, 0, 0, 0.5);
}

.sl-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 46px;
  padding: 0;
  font-size: 23px;
  font-weight: 400;
}

.sl-flash {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  border-radius: inherit;
}

.sl-flash-gold { animation: sl-flash 0.7s ease-out; background: radial-gradient(circle at 50% 55%, rgba(255, 214, 120, 0.55), rgba(255, 214, 120, 0) 70%); }
.sl-flash-warn { animation: sl-flash 0.45s ease-out; background: radial-gradient(circle, rgba(241, 126, 98, 0) 45%, rgba(241, 96, 70, 0.55)); }

@keyframes sl-flash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.sl-pop {
  position: absolute;
  left: 50%;
  top: 34%;
  z-index: 4;
  pointer-events: none;
  color: #fff;
  font: 900 32px/1 Georgia, serif;
  letter-spacing: 0.04em;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, 0);
  animation: sl-pop 1.3s ease-out forwards;
}

.sl-pop-gain { color: var(--sl-gold); font-size: 40px; }
.sl-pop-lose { color: var(--sl-coral); }

@keyframes sl-pop {
  0% { opacity: 0; transform: translate(-50%, 16px) scale(0.6); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  30% { transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -56px) scale(1); }
}

.sl-shake {
  animation: sl-shake 0.38s ease-out;
}

@keyframes sl-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 3px); }
  40% { transform: translate(5px, -3px); }
  60% { transform: translate(-3px, 2px); }
  80% { transform: translate(2px, -1px); }
}

@media (pointer: fine) and (min-width: 701px) {
  .sl-touch {
    display: none;
  }
}

@media (pointer: coarse), (max-width: 700px) {
  .sl-shell {
    padding: 0 8px 18px;
  }

  .sl-topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .sl-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    gap: 5px;
  }

  .sl-stat {
    min-width: 0;
    padding: 6px 4px;
  }

  .sl-stat strong {
    font-size: 15px;
  }

  .sl-actions {
    justify-content: flex-end;
  }

  .sl-gauges {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }

  .sl-object {
    grid-column: 1 / -1;
  }

  .sl-gauge-copy {
    grid-column: 1 / -1;
    text-align: left;
  }

  .sl-stage {
    aspect-ratio: auto;
    height: clamp(460px, calc(100dvh - 330px), 640px);
    border-radius: 16px;
  }

  .sl-touch {
    display: grid;
    grid-template-columns: 48px 48px minmax(66px, 1fr) 58px;
    gap: 6px;
  }

  .sl-banner {
    font-size: 10px;
  }

  .sl-card {
    padding: 20px 16px;
  }

  .sl-card h2 {
    font-size: 24px;
  }
}

@media (max-width: 360px) {
  .sl-touch {
    grid-template-columns: 44px 44px minmax(56px, 1fr) 52px;
    gap: 4px;
  }

  .sl-touch-button {
    min-height: 50px;
  }
}

@media (max-width: 430px) {
  .sl-stat span {
    font-size: 8px;
    letter-spacing: 0.08em;
  }

  .sl-stat strong {
    font-size: 14px;
  }

  .sl-button {
    padding: 0 10px;
  }

  .sl-card-actions {
    flex-direction: column;
  }

  .sl-card-actions .sl-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sl-button,
  .sl-touch-button,
  .sl-pop,
  .sl-flash,
  .sl-shake {
    animation: none !important;
    transition: none;
  }
}
