/* Ship Shape, the player's phone: the stage heading with its ring clock, the grid canvas, the loupe and arrows,
   and the lines under them. Built on the player shell (20_player_shell.css). */

/* ---------- Stage heading and ring clock ---------- */

.gtf-ss-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.gtf-ss-head__title {
  margin: 0;
  font-size: 34px;
}

.gtf-ss-clock__ring {
  --ring: var(--gtf-success);

  display: grid;
  flex: none;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: conic-gradient(var(--ring) calc(var(--progress, 0) * 360deg), var(--gtf-surface-4) 0);

  &.is-urgent {
    --ring: var(--gtf-orange);
  }

  &::before {
    content: "";
    grid-area: 1 / 1;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--gtf-ink);
  }
}

.gtf-ss-clock__value {
  grid-area: 1 / 1;
  z-index: 1;
  font-family: var(--gtf-mono);
  font-size: 26px;
  line-height: 1;
  color: var(--gtf-cream);
}

.gtf-ss-clock__ring.is-urgent .gtf-ss-clock__value {
  color: var(--gtf-orange);
}

/* ---------- The grid ---------- */

.gtf-ss-grid {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  margin-top: 16px;
  border-radius: 12px;
  background: var(--gtf-surface-1);
  touch-action: none;
  cursor: crosshair;

  &.is-locked {
    cursor: default;
    opacity: 0.85;
  }
}

/* ---------- Loupe and arrows ---------- */

.gtf-ss-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.gtf-ss-loupe {
  flex: none;
  width: 120px;
  height: 120px;
  border: 2px solid var(--gtf-surface-4);
  border-radius: 12px;
  background: var(--gtf-surface-1);
}

.gtf-ss-dpad {
  display: grid;
  grid-template-areas:
    ". up ."
    "left . right"
    ". down .";
  grid-template-columns: repeat(3, 52px);
  grid-template-rows: repeat(3, 52px);
  gap: 4px;
}

.gtf-ss-dpad__btn {
  border: 2px solid var(--gtf-line);
  border-radius: 12px;
  background: transparent;
  color: var(--gtf-cream);
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
}

.gtf-ss-dpad__btn--up { grid-area: up; }
.gtf-ss-dpad__btn--left { grid-area: left; }
.gtf-ss-dpad__btn--right { grid-area: right; }
.gtf-ss-dpad__btn--down { grid-area: down; }

/* ---------- Buttons and lines ---------- */

.gtf-ss-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.gtf-ss-btn {
  min-height: 56px;
  padding: 0 24px;
  border: 2px solid var(--gtf-line);
  border-radius: 12px;
  background: transparent;
  color: var(--gtf-cream);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.gtf-ss-btn--primary {
  flex: 1;
  border-color: transparent;
  background: var(--gtf-success);
  color: var(--gtf-ink);
  font-size: 19px;
}

.gtf-ss-lines {
  margin-top: 18px;
}

.gtf-ss-lines__head {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
}

.gtf-ss-lines__text {
  margin: 4px 0 0;
  font-size: 17px;
  line-height: 1.45;
}

/* ---------- Out and watching ---------- */

.gtf-ss-out {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--gtf-surface-3);
}

.gtf-ss-out__head {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--gtf-orange);
}

.gtf-ss-out__text {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--gtf-text-2);
}

/* ---------- Bombs landing on your ship ---------- */

.gtf-ss-grid.is-shaking {
  animation: gtf-ss-shake 0.9s ease-out;
}

@keyframes gtf-ss-shake {
  0%, 100% { transform: translate(0, 0); box-shadow: 0 0 0 0 transparent; }
  10% { transform: translate(-6px, 3px); box-shadow: 0 0 0 6px rgba(255, 110, 60, 0.9); }
  25% { transform: translate(5px, -4px); }
  40% { transform: translate(-4px, 2px); box-shadow: 0 0 0 3px rgba(255, 110, 60, 0.6); }
  60% { transform: translate(3px, -2px); }
  80% { transform: translate(-1px, 1px); }
}

@media (prefers-reduced-motion: reduce) {
  .gtf-ss-grid.is-shaking {
    animation: none;
  }
}
