:root {
  --bg: #000000;
  --panel: #07131d;
  --panel-edge: #16334d;
  --payline: #d7e3f5;
  --payline-glow: rgba(125, 191, 255, 0.6);
  --ship-frame: #060b12;
  --text: #edf4ff;
  --button-bg: #85d5ff;
  --button-shadow: #4fb6ff;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.noscript-message {
  max-width: 440px;
  margin: 24px auto;
  padding: 16px;
  color: #edf4ff;
  background: #07131d;
  border: 1px solid #16334d;
  border-radius: 8px;
  text-align: center;
  line-height: 1.5;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  margin: 0;
}

.app-shell {
  width: min(92vw, 440px);
  background: #000;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0 18px 18px;
  margin-top: 0;
}

.slot-machine {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  width: 100%;
  align-items: center;
  border: 2px solid rgba(211, 223, 255, 0.2);
  border-radius: 18px;
  overflow: visible;
}

.slot-machine::before,
.slot-machine::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 24px;
  height: 10px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #ff3030;
  pointer-events: none;
  z-index: 5;
}

.slot-machine::before {
  left: -30px;
}

.slot-machine::after {
  right: -30px;
}

.reel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel-window {
  position: relative;
  width: 100%;
  height: min(58vh, 430px);
  max-height: 430px;
  background: #000;
  border: none;
  border-radius: 0;
  overflow: hidden;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.9), 0 0 12px rgba(84, 162, 255, 0.08);
}

.reel-window::before,
.reel-window::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 30%;
  z-index: 3;
  pointer-events: none;
  border: none;
}

.reel-window::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.98), rgba(0, 0, 0, 0.7) 34%, rgba(0, 0, 0, 0));
}

.reel-window::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.98), rgba(0, 0, 0, 0.7) 34%, rgba(0, 0, 0, 0));
}

.reel-strip {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  will-change: transform;
  transition: transform 0.05s linear, filter 0.08s ease-out;
  background: #000;
}

.reel-strip.blurred {
  filter: blur(3px);
}

.reel-window .payline {
  display: none;
}

.reel-item {
  position: relative;
  width: 100%;
  height: clamp(112px, 21vw, 138px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border: none;
  overflow: hidden;
}

.reel-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: drop-shadow(0 0 10px rgba(123, 205, 255, 0.25));
  background: #000;
  padding: 0;
}

.reel-unlocked-indicator {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  padding: 2px 4px;
  border: 1px solid rgba(255, 215, 0, 0.8);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.82);
  color: #ffd700;
  font-size: 0.55rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 1px 2px #000;
}

.reel-item.matched {
  border: 4px solid #ff0000;
  box-shadow: inset 0 0 12px rgba(255, 0, 0, 0.4);
}

.reel-repair-indicator {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  border: 1px solid rgba(255, 215, 0, 0.8);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.82);
  color: #ffd700;
  font-size: 0.55rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 2px #000;
}

.reel-repair-indicator img {
  width: 1.15em;
  height: 1.15em;
  object-fit: contain;
}

.spin-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.spin-button {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #c9f2ff 0%, #80d0ff 100%);
  color: #062033;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 0.96rem;
  padding: 0.8rem 2rem;
  min-width: 148px;
  box-shadow: 0 10px 20px rgba(79, 182, 255, 0.28), inset 0 0 12px rgba(255,255,255,0.5);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.spin-button .crystal-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.spin-button .crystal-row img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
}

.spin-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(79, 182, 255, 0.36), inset 0 0 12px rgba(255,255,255,0.58);
}

.spin-button:active {
  transform: translateY(1px);
}

.spin-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.retry-prompt {
  display: flex;
  flex-basis: 100%;
  justify-content: center;
  margin-top: 16px;
}

.restart-account-button,
.retry-button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 220px;
  padding: 0.8rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffef9d 0%, #ffba00 100%);
  box-shadow: 0 12px 22px rgba(255, 186, 0, 0.28), inset 0 0 12px rgba(255,255,255,0.5);
  color: #111827;
  font-weight: 900;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.retry-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 26px rgba(255, 186, 0, 0.32), inset 0 0 12px rgba(255,255,255,0.6);
}

.retry-button:active {
  transform: translateY(1px);
}

.retry-main {
  display: block;
  font-size: 1rem;
}

.retry-sub {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
}

.retry-button,
.auth-btn-secondary.restart-account-button {
  background: #d32f2f;
  color: #000;
  border-color: #ff6b6b;
  box-shadow: none;
}

.retry-button:hover,
.auth-btn-secondary.restart-account-button:hover {
  background: #e53935;
  color: #000;
  box-shadow: none;
}

/* Bonus spin display */
.bonus-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  min-height: 46px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 165, 0, 0.15) 100%);
  border: 2px solid #ffd700;
  border-radius: 8px;
  animation: pulse 1.5s ease-in-out infinite;
}

.bonus-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ff8c00;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.bonus-counter {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffd700;
  min-width: 50px;
  text-align: center;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 215, 0, 0);
  }
}
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--payline);
  white-space: nowrap;
  display: inline-block;
}

@media (min-width: 700px) {
  .app-shell {
    padding: 0 18px 24px;
  }

  .reel-window {
    height: 460px;
  }

  .reel-item img {
    width: 82%;
    max-width: 120px;
  }
}

/* New styles for authentication and account system */

.app-header {
  padding: 12px;
  text-align: center;
  border-bottom: 2px solid rgba(211, 223, 255, 0.2);
  margin-bottom: 0;
  background: transparent;
  width: 100%;
}

.app-logo {
  display: block;
  height: auto;
  max-width: 200px;
  max-height: 80px;
  width: 100%;
  margin: 0 auto;
}

.header-display {
  position: relative;
  height: 96px;
  min-height: 96px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.discovery-flyover {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: -35%;
  width: min(30%, 110px);
  height: 80px;
  object-fit: contain;
  pointer-events: none;
  animation: discovery-flyover 3.2s linear forwards;
}

@keyframes discovery-flyover {
  0% {
    left: -35%;
    top: 48%;
    transform: translate(-100%, -50%) rotate(-2deg);
  }
  25% {
    top: 53%;
    transform: translate(-50%, -50%) rotate(2deg);
  }
  50% {
    top: 47%;
    transform: translate(-50%, -50%) rotate(-1deg);
  }
  75% {
    top: 53%;
    transform: translate(-50%, -50%) rotate(2deg);
  }
  100% {
    left: 135%;
    top: 49%;
    transform: translate(0, -50%) rotate(-2deg);
  }
}

.app-logo,
.crystal-logo,
.logo-message,
.reward-display {
  grid-area: 1 / 1;
  transition: opacity 400ms ease, transform 400ms ease;
}

.logo-message {
  opacity: 0;
  transform: scale(0.94);
  color: #ffd166;
  font-size: clamp(1rem, 4vw, 1.4rem);
  font-weight: 800;
  text-align: center;
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.7);
  pointer-events: none;
}

.logo-message.is-visible {
  opacity: 1;
  transform: scale(1);
}

.crystal-logo {
  opacity: 0;
  transform: scale(0.94);
  pointer-events: none;
}

.crystal-logo.is-visible {
  opacity: 1;
  transform: scale(1);
}

.app-logo.is-hidden {
  opacity: 0;
  transform: scale(0.94);
}

.reward-display {
  opacity: 0;
  transform: scale(0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.reward-display.is-visible {
  opacity: 1;
  transform: scale(1);
}

.reward-image {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
}

.reward-text {
  color: var(--payline);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
  white-space: pre-line;
}

.auth-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.auth-guest, .auth-logged {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.auth-logged {
  font-size: 0.85rem;
  justify-content: space-between;
}

.user-info {
  flex-basis: 100%;
  color: var(--payline);
}

.spins-info {
  flex-basis: 100%;
  color: #ffcc00;
  font-weight: bold;
}

.auth-btn {
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.auth-btn-primary {
  background: linear-gradient(180deg, #c9f2ff 0%, #80d0ff 100%);
  color: #062033;
  box-shadow: 0 4px 8px rgba(79, 182, 255, 0.3);
}

.auth-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(79, 182, 255, 0.4);
}

.auth-btn-secondary {
  background: rgba(79, 182, 255, 0.2);
  color: var(--button-bg);
  border: 1px solid var(--button-bg);
}

.auth-btn-secondary:hover {
  background: rgba(79, 182, 255, 0.35);
}

.hangar-tutorial-pulse {
  animation: hangar-tutorial-pulse 1.2s ease-in-out infinite;
}

.hangar-tutorial-target {
  animation: hangar-tutorial-pulse 1.2s ease-in-out infinite;
  border-color: #ffd700;
}

.ship-status-label {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  padding: 3px 2px;
  color: #000;
  background: #ffcc00;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

@keyframes hangar-tutorial-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 215, 0, 0); }
  50% { box-shadow: 0 0 16px rgba(255, 215, 0, 0.9); }
}

.auth-btn-tertiary {
  background: transparent;
  color: #888;
  border: 1px solid #666;
}

.auth-btn-tertiary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

#guestHangarCreateAccount {
  align-self: center;
  text-align: center;
}

.game-recommendation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: min(100%, 360px);
  margin: 4px auto 14px;
  padding: 8px 10px;
  background: rgba(79, 182, 255, 0.08);
  border: 1px solid rgba(125, 191, 255, 0.3);
  border-radius: 6px;
}

.game-recommendation img {
  width: 156px;
  height: 120px;
  flex: 0 0 156px;
  object-fit: contain;
}

.game-recommendation-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.game-recommendation-copy span {
  color: rgba(237, 244, 255, 0.58);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
}

.game-recommendation-copy strong {
  color: var(--payline);
  font-size: 0.92rem;
}

.game-recommendation .auth-btn {
  flex: 0 0 auto;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal {
  background: var(--panel);
  border: 2px solid var(--panel-edge);
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

#emailModal,
#leaderboardModal {
  z-index: 1100;
}

.modal-large {
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h2 {
  margin: 0 0 16px 0;
  font-size: 1.3rem;
  text-align: center;
  color: var(--payline);
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal input {
  padding: 10px 12px;
  border: 1px solid var(--panel-edge);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.95rem;
}

.modal input:focus {
  outline: none;
  border-color: var(--button-bg);
  background: rgba(255, 255, 255, 0.1);
}

.modal input::placeholder {
  color: rgba(237, 244, 255, 0.5);
}

.error-message {
  color: #ff6666;
  font-size: 0.85rem;
  text-align: center;
  margin: 0;
}

.terms-link-row {
  margin: -2px 0 8px;
  text-align: center;
  font-size: 0.8rem;
}

.terms-link-row a {
  color: var(--button-bg);
}

.terms-agreement {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0 0 12px;
  color: rgba(237, 244, 255, 0.72);
  font-size: 0.78rem;
  line-height: 1.35;
  cursor: pointer;
}

.terms-agreement input {
  width: auto;
  margin: 2px 0 0;
}

.terms-content {
  max-height: 58vh;
  margin: 0 0 18px;
  overflow-y: auto;
  color: rgba(237, 244, 255, 0.76);
  font-size: 0.82rem;
  line-height: 1.5;
}

.terms-content h3 {
  margin: 16px 0 4px;
  color: var(--payline);
  font-size: 0.92rem;
}

.terms-content p {
  margin: 7px 0;
}

.terms-updated {
  color: rgba(237, 244, 255, 0.48);
  font-size: 0.72rem;
}

.win-message {
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
  margin-bottom: 20px;
}

.shop-note {
  margin: -6px 0 14px;
  color: rgba(237, 244, 255, 0.68);
  font-size: 0.82rem;
  text-align: center;
}

.crystal-requirements {
  margin-top: 12px;
  padding: 8px 10px;
  color: rgba(237, 244, 255, 0.58);
  background: rgba(128, 128, 128, 0.12);
  border: 1px solid rgba(180, 180, 180, 0.16);
  border-radius: 5px;
  font-size: 0.72rem;
  line-height: 1.6;
  text-align: center;
}

.reset-account-note {
  margin: -8px auto 18px;
  max-width: 280px;
  padding: 7px 10px;
  color: rgba(237, 244, 255, 0.62);
  background: rgba(128, 128, 128, 0.12);
  border: 1px solid rgba(180, 180, 180, 0.16);
  border-radius: 5px;
  font-size: 0.72rem;
  line-height: 1.4;
  text-align: center;
}

.shop-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shop-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(133, 213, 255, 0.2);
  border-radius: 8px;
  text-align: center;
}

.shop-crystals {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
}

.shop-crystals img {
  width: 34px;
  height: 42px;
  object-fit: contain;
}

.shop-option-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.shop-crystal-icon {
  width: 28px;
  height: 36px;
  object-fit: contain;
}

.shop-option strong {
  color: var(--payline);
  font-size: 0.82rem;
}

.shop-option > span {
  color: #ffd700;
  font-size: 1rem;
  font-weight: 800;
}

@media (max-width: 520px) {
  .shop-options {
    grid-template-columns: 1fr;
  }
}

/* How to play guide */
.info-modal {
  width: min(620px, calc(100vw - 32px));
  max-width: 620px;
  background: #000;
  border-color: rgba(211, 223, 255, 0.22);
}

.info-heading {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(133, 213, 255, 0.18);
}

.info-heading h2 {
  margin: 3px 0 6px;
  font-size: 1.7rem;
}

.info-heading p {
  margin: 0;
  color: rgba(237, 244, 255, 0.72);
  font-size: 0.9rem;
}

.info-kicker {
  color: var(--button-bg);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.info-steps {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

.info-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(211, 223, 255, 0.14);
  border-radius: 8px;
}

.info-simple-step {
  grid-template-columns: minmax(0, 1fr);
  text-align: center;
}

.info-simple-step > div,
.info-score-step > div {
  width: 100%;
  min-width: 0;
}

.info-ship-row {
  width: 100%;
  min-height: 106px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0 auto 10px;
  padding: 10px 16px;
  background: rgba(211, 223, 255, 0.1);
  border: 1px solid rgba(211, 223, 255, 0.28);
  border-radius: 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.info-ship-row img {
  display: block;
  width: min(24%, 82px);
  height: 82px;
  object-fit: contain;
}

.info-score-step {
  grid-template-columns: minmax(0, 1fr);
}

.info-score-step h3 {
  margin-bottom: 8px;
}

.info-score-cost {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.info-score-cost img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.info-crystal-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  text-align: left;
}

.info-crystal-list p {
  display: grid;
  grid-template-columns: 28px 72px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: 32px;
  color: rgba(237, 244, 255, 0.72);
  font-size: 0.82rem;
}

.info-crystal-list img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.info-crystal-list strong {
  color: var(--button-bg);
}

.info-step-featured {
  border-color: rgba(255, 215, 0, 0.34);
  background: linear-gradient(110deg, rgba(255, 215, 0, 0.08), rgba(255, 255, 255, 0.035));
}

.info-score-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #ffd700;
  font-size: 1rem;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.45);
}

.info-step-number {
  align-self: start;
  color: #ffd700;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding-top: 3px;
}

.info-step h3 {
  margin: 0 0 5px;
  color: var(--payline);
  font-size: 1rem;
}

.info-step p {
  margin: 0;
  color: rgba(237, 244, 255, 0.72);
  font-size: 0.82rem;
  line-height: 1.45;
}

.info-step strong {
  color: var(--button-bg);
}

.info-note {
  padding: 14px 16px;
  background: rgba(211, 223, 255, 0.06);
  border: 1px solid rgba(211, 223, 255, 0.18);
  border-left: 3px solid var(--button-bg);
  border-radius: 7px;
}

.info-note h3 {
  margin: 0 0 8px;
  color: var(--payline);
  font-size: 0.92rem;
}

.info-note p {
  margin: 6px 0 0;
  color: rgba(237, 244, 255, 0.68);
  font-size: 0.78rem;
  line-height: 1.45;
}

.info-note strong {
  color: var(--button-bg);
}

.info-use-art,
.info-bonus-art {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  justify-content: space-around;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: rgba(211, 223, 255, 0.07);
  border: 1px solid rgba(211, 223, 255, 0.16);
  border-radius: 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.info-use-art span,
.info-bonus-art span {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  flex: 1 1 0;
  color: rgba(237, 244, 255, 0.82);
  font-size: 0.68rem;
  text-align: center;
}

.info-use-art img,
.info-bonus-art img {
  width: 34px;
  height: 44px;
  object-fit: contain;
}

.info-use-art strong,
.info-bonus-art strong {
  color: rgba(237, 244, 255, 0.82);
  font-size: 0.68rem;
  line-height: 1.1;
}

.info-step-art {
  position: relative;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
}

.info-step-art img {
  width: 34px;
  height: 58px;
  object-fit: contain;
}

.info-reel-art {
  flex-wrap: wrap;
  padding: 8px 3px;
}

.info-reel-art img {
  width: 34px;
  height: 28px;
  object-fit: cover;
}

.info-payline {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: #d7e3f5;
  box-shadow: 0 0 8px rgba(125, 191, 255, 0.8);
  z-index: 1;
}

.info-outcomes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
}

.info-outcomes span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(237, 244, 255, 0.82);
  font-size: 0.72rem;
  font-weight: 700;
}

.info-outcomes img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.info-close {
  display: block;
  margin: 0 auto;
}

@media (max-width: 520px) {
  .info-step {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .info-simple-step,
  .info-score-step {
    grid-template-columns: minmax(0, 1fr);
  }

  .info-step-art img {
    width: 26px;
    height: 48px;
  }

  .info-reel-art img {
    width: 25px;
    height: 23px;
  }

  .info-step h3 {
    font-size: 0.9rem;
  }

  .info-step p {
    font-size: 0.75rem;
  }

  .info-ship-row img {
    width: 27%;
    height: 64px;
  }

  .info-ship-row {
    min-height: 84px;
    padding: 8px;
  }

  .info-crystal-list p {
    grid-template-columns: 26px 62px minmax(0, 1fr);
    font-size: 0.75rem;
  }
}

/* Control Panel styles */
.collection-stats {
  text-align: center;
  font-size: 1.1rem;
  color: var(--payline);
  margin: 0 0 16px 0;
  font-weight: bold;
}

.spaceship-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
  max-height: 60vh;
  overflow-y: auto;
}

.spaceship-item {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(211, 223, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}

.spaceship-item:hover {
  border-color: var(--button-bg);
}

.spaceship-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spaceship-item.undiscovered {
  opacity: 0.4;
  filter: grayscale(100%);
}

.spaceship-item.discovered {
  border-color: var(--payline);
  box-shadow: 0 0 10px var(--payline-glow);
}

.collected-section {
  padding-top: 8px;
}

.collected-section .spaceship-grid {
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 6px;
}

.collected-section .spaceship-item {
  min-height: 72px;
  padding: 4px;
}

.collected-section .spaceship-item img {
  max-height: 58px;
}

.spaceship-score {
  position: absolute;
  right: 3px;
  bottom: 3px;
  padding: 2px 5px;
  color: #000;
  background: #ffd700;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.1;
}

.lives-container {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 4px 0;
}

.life-heart,
.bonus-game-heart {
  display: inline-block;
  transform: scaleX(1.18);
  transform-origin: center;
  font-size: 2.3rem;
  line-height: 1;
}

.life-heart-active {
  color: #e32636;
  text-shadow: 0 0 8px rgba(227, 38, 54, 0.55);
}

.life-heart-empty {
  color: #050505;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.35);
}

.score-reel-item {
  background: #101010;
}

.score-multiplier-reel .reel-window,
.score-multiplier-reel .reel-strip,
.score-multiplier-reel .score-reel-item {
  background: #d32f2f;
}

.score-multiplier-reel .score-symbol {
  color: #000;
  text-shadow: none;
}

.score-reel-hidden .reel-window::after {
  content: "";
  position: absolute;
  inset: 0;
  height: auto;
  background: #000;
  z-index: 6;
  pointer-events: none;
}

.score-symbol {
  color: #ffd700;
  font-size: clamp(1.7rem, 6vw, 3rem);
  font-weight: 900;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.55);
}

.score-symbol img {
  width: 0.9em;
  height: 0.9em;
  object-fit: contain;
}

/* Control Panel Layout */
.control-panel-modal {
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Control Panel Mode Buttons */
.control-panel-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 24px;
}

.mode-btn {
  padding: 7px 10px;
  border: 2px solid rgba(211, 223, 255, 0.3);
  background: rgba(211, 223, 255, 0.05);
  color: rgba(211, 223, 255, 0.7);
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.mode-btn:hover {
  border-color: var(--payline);
  color: var(--payline);
}

.mode-btn.mode-active {
  background: var(--payline);
  color: #000;
  border-color: var(--payline);
}

#modeUnlock,
#modeUnlock.mode-active {
  background: #4A90E2;
  border-color: #4A90E2;
  color: #fff;
}

#modeScrap,
#modeScrap.mode-active {
  background: #8E44AD;
  border-color: #8E44AD;
  color: #fff;
}

#modeRepair,
#modeRepair.mode-active,
#modeScore,
#modeScore.mode-active {
  background: #D4AF37;
  border-color: #D4AF37;
  color: #000;
}

.leaderboard-list {
  display: grid;
  gap: 6px;
  margin: 0 0 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.leaderboard-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 16px;
}

.leaderboard-tabs .mode-btn {
  min-width: 0;
  padding-inline: 6px;
  font-size: 0.68rem;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(133, 213, 255, 0.14);
  border-radius: 6px;
}

.leaderboard-rank {
  color: #ffd700;
  font-weight: 800;
  text-align: center;
}

.leaderboard-row strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-score {
  color: #ffd700;
  font-size: 0.82rem;
  font-weight: 800;
}

.leaderboard-loading {
  margin: 12px 0;
  color: rgba(237, 244, 255, 0.68);
  text-align: center;
}

.total-score-box {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 0 0 24px;
  padding: 14px 16px;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.45);
  border-radius: 8px;
}

.total-score-label,
.total-score-unit {
  color: rgba(237, 244, 255, 0.7);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.total-score-box strong {
  color: #ffd700;
  font-size: 1.6rem;
  line-height: 1;
}

.control-panel-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid rgba(211, 223, 255, 0.2);
}

.control-panel-section h3 {
  color: var(--text-light);
  font-size: 18px;
  margin: 0 0 12px 0;
  font-weight: bold;
}

.control-panel-section:last-of-type {
  border-bottom: none;
}

.control-panel-future {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(211, 223, 255, 0.05);
  border-radius: 8px;
  padding: 20px;
  color: rgba(211, 223, 255, 0.5);
  text-align: center;
}

/* Spaceship Grid - Compact */
.spaceship-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 0;
  max-height: none;
  overflow: visible;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 8px;
}

.hangar-actions-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.restart-account-button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 156px;
}

.spaceship-item {
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid rgba(211, 223, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
}

.spaceship-item:hover {
  border-color: var(--button-bg);
  transform: scale(1.05);
}

.spaceship-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spaceship-item.undiscovered {
  opacity: 0.3;
  filter: grayscale(100%);
}

.spaceship-item.discovered {
  border-color: var(--payline);
  box-shadow: 0 0 8px var(--payline-glow);
}

.spaceship-item.has-action {
  align-items: flex-start;
}

.spaceship-item.has-action > img {
  height: 60%;
  object-fit: cover;
}

/* Ship action buttons */
.ship-action-btn {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 40%;
  padding: 2px 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(8px, 1.4vw, 11px);
  font-weight: bold;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  line-height: 1;
}

.repair-btn {
  background: #FFD700;
  color: #000;
}

.repair-btn:hover {
  background: #FFED4E;
  transform: scale(1.1);
}

.unlock-btn {
  background: #4A90E2;
  color: #fff;
}

.unlock-btn:hover {
  background: #6AA9EF;
  transform: scale(1.1);
}

.scrap-btn {
  background: #8E44AD;
  color: #fff;
}

.scrap-btn:hover {
  background: #A569BD;
  transform: scale(1.1);
}

.score-btn {
  background: #D4AF37;
  color: #000;
}

.score-btn:hover {
  background: #E6C65C;
  transform: scale(1.1);
}

/* Crystals Container */
.crystals-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  background: rgba(0, 0, 0, 0.3);
  padding: 20px;
  border-radius: 8px;
}

.crystal-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(211, 223, 255, 0.05);
  border-radius: 8px;
  border: 2px solid rgba(211, 223, 255, 0.15);
  transition: all 0.2s ease;
}

.crystal-item:hover {
  border-color: var(--payline);
  background: rgba(211, 223, 255, 0.1);
}

.crystal-item img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.crystal-count {
  font-size: 24px;
  font-weight: bold;
  color: var(--payline);
  text-align: center;
}

.crystal-action-btn {
  margin-top: 6px;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: #6ec5ff;
  color: #04131d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.crystal-action-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.crystal-label {
  font-size: 12px;
  color: rgba(211, 223, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Responsive adjustments */
@media (max-width: 440px) {
  .auth-logged {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .auth-logged .auth-btn {
    padding: 0.45rem 0.65rem;
    font-size: 0.75rem;
  }
  
  .user-info, .spins-info {
    flex-basis: auto;
    display: block;
  }
  
  .auth-btn {
    flex: 0 1 auto;
    min-width: 0;
  }
  
  .spaceship-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .bonus-game-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .ship-action-btn {
    font-size: clamp(7px, 2vw, 9px);
    letter-spacing: 0;
  }
  
  .crystals-container {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
 * BONUS GAME STYLES
 * ============================================================================ */

.bonus-game-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.bonus-game-modal {
  box-sizing: border-box;
  background: var(--panel);
  border: 2px solid var(--panel-edge);
  border-radius: 12px;
  padding: 24px;
  max-width: 900px;
  width: min(92vw, 520px);
  max-height: 90vh;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bonus-game-header {
  text-align: center;
}

.bonus-game-header h2 {
  margin: 0 0 12px 0;
  font-size: 1.8rem;
  color: var(--payline);
}

.bonus-game-info {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(211, 223, 255, 0.7);
}

.bonus-game-grid {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px;
  border-radius: 8px;
  margin: 20px 0;
  width: 100%;
  min-width: 0;
}

.bonus-game-cell {
  aspect-ratio: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  min-width: 0;
}

.bonus-game-cell.black {
  background-color: #050505;
  border-color: rgba(255, 255, 255, 0.12);
}

.bonus-game-cell.white {
  background-color: #ffffff;
  border-color: rgba(255, 255, 255, 0.9);
}

.bonus-game-cell.grey {
  background-color: #050505;
  border-color: rgba(255, 255, 255, 0.12);
}

.bonus-game-cell.has-reward {
  border-color: rgba(255, 215, 0, 0.6);
}

.bonus-game-cell.highlighted {
  border: 3px solid #ff4444;
  box-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
}

.bonus-game-cell.bonus-game-cross {
  color: #ff4444;
  font-size: 2rem;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(255, 68, 68, 0.8);
}

.bonus-game-spaceship {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
}

.bonus-game-hidden {
  opacity: 0;
}

.bonus-game-cell.is-visible,
.bonus-game-reward.is-visible,
.bonus-game-spaceship.is-visible {
  opacity: 1;
}

.bonus-game-wobble {
  animation: bonus-game-wobble 1.5s ease-in-out infinite;
}

@keyframes bonus-game-wobble {
  0%, 100% { transform: translateY(-5%); }
  50% { transform: translateY(5%); }
}

.bonus-game-reward {
  font-size: 0.85rem;
  font-weight: bold;
  color: #ffd700;
  text-align: center;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.bonus-game-reward img {
  width: 86%;
  height: 86%;
  object-fit: contain;
}

.bonus-game-life {
  position: relative;
  color: #e32636;
  font-size: 3rem;
  line-height: 1;
  text-shadow: 0 0 8px rgba(227, 38, 54, 0.65);
}

.bonus-game-life-loss {
  position: absolute;
  right: 4%;
  bottom: 8%;
  min-width: 1.3em;
  padding: 0.12em 0.2em;
  border-radius: 4px;
  background: #888;
  color: #111;
  font-size: 0.85rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-shadow: none;
}

.bonus-game-footer {
  text-align: center;
  padding-top: 12px;
  border-top: 1px solid var(--panel-edge);
}

#bonusGameStatus {
  margin: 0;
  color: var(--payline);
  font-size: 1rem;
}

