body:has(.hop) {
  background: radial-gradient(120% 70% at 50% 0%, #1d2547 0%, #0d1024 55%, #07080f 100%) fixed;
  color: #eef0fa;
}

body:has(.hop) > header {
  max-width: 760px;
  padding-bottom: 12px;
}

body:has(.hop) > header a {
  color: #a3a9c6;
  font-size: 13px;
}

main:has(.hop) {
  max-width: 760px;
  background: transparent;
  padding-top: 12px;
}

.hop {
  --accent: #facc15;
  --accent-ink: #2b2100;
  --muted: #a3a9c6;
  --panel: #151a33;
  --line: #2a3158;
  width: 100%;
}

.hop-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.hop-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--muted);
}

.hop-head h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: .06em;
}

.hop-head h1 span {
  margin-left: 14px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .12em;
  color: var(--muted);
}

.hop-best {
  min-width: 120px;
  padding: 8px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: right;
}

.hop-best span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--muted);
}

.hop-best strong {
  display: block;
  font-size: 22px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

/* ---- 画面（大きさは YamatoKit.screen が canvas に直接指定する） ---- */
.hop-frame {
  width: 100%;
  display: flex;
  justify-content: center;
}

.hop-screen {
  position: relative;
  line-height: 0;
  border-radius: 6px;
  outline: 3px solid #2c3566;
  box-shadow: 0 0 0 7px rgba(250, 204, 21, .07), 0 18px 50px rgba(0, 0, 0, .5);
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.hop-screen:focus-visible {
  outline-color: var(--accent);
}

.hop-screen canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #0b0614;
}

.hop-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  line-height: 1.6;
  text-align: center;
  background: rgba(8, 9, 22, .72);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.hop-overlay[hidden] {
  display: none;
}

.hop-overlay-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .24em;
  color: var(--muted);
}

.hop-overlay-title {
  margin: 0;
  font-size: clamp(24px, 6vw, 36px);
  font-weight: 800;
  letter-spacing: .06em;
  color: #fff;
  text-shadow: 0 0 18px rgba(250, 204, 21, .5);
}

.hop-overlay-desc {
  max-width: 340px;
  margin: 2px 0 12px;
  font-size: 13px;
  line-height: 1.7;
  color: #d5d9ec;
  white-space: pre-line;
}

.hop-overlay-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* ---- ボタン ---- */
.hop button {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: #eef0fa;
  background: #1f2647;
  border: 1px solid #39437a;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .15s, transform .08s;
}

.hop button:hover:not(:disabled) {
  background: #2a3360;
}

.hop button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.hop button:disabled {
  opacity: .4;
  cursor: default;
}

.hop .hop-primary {
  min-width: 140px;
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.hop .hop-primary:hover:not(:disabled) {
  background: #fde047;
}

.hop-actions {
  display: flex;
  gap: 8px;
  width: min(100%, 420px);
  margin: 14px auto 0;
}

.hop-actions button {
  flex: 1;
}

/* ---- スマホの操作ボタン ---- */
.hop-pad {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(100%, 520px);
  margin: 14px auto 0;
}

.hop-pad-group {
  display: flex;
  gap: 8px;
  touch-action: none;
}

.hop .hop-pad button {
  width: 72px;
  min-height: 64px;
  padding: 0;
  font-size: 20px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

.hop .hop-pad .hop-jump {
  width: 84px;
  font-size: 14px;
  letter-spacing: .1em;
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.hop .hop-pad .hop-dash {
  font-size: 12px;
  letter-spacing: .08em;
}

.hop .hop-pad button.is-held {
  transform: scale(.95);
  background: #36407a;
}

.hop .hop-pad .hop-dash.is-held {
  color: var(--accent-ink);
  background: #fde68a;
  border-color: #fde68a;
}

.hop .hop-pad .hop-jump.is-held {
  background: #fef08a;
}

@media (hover: hover) and (pointer: fine) {
  .hop-pad {
    display: none;
  }
}

.hop-status {
  min-height: 1.7em;
  margin: 10px 0 0;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
}

.hop-sound {
  margin: 0;
  font-size: 12px;
  text-align: center;
  color: var(--muted);
}

.hop-sound a {
  color: var(--accent);
}

.hop-note {
  margin: 4px 0 0;
  font-size: 12px;
  text-align: center;
  color: #f5b16b;
}

/* ---- 遊び方 ---- */
.hop-how {
  margin-top: 18px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
}

.hop-how h2 {
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing: .08em;
}

.hop-how dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 6px 18px;
  margin: 0;
}

.hop-how dl div {
  display: flex;
  gap: 10px;
}

.hop-how dt {
  flex: none;
  min-width: 112px;
  font-weight: 700;
  color: var(--accent);
}

.hop-how dd {
  margin: 0;
  color: #d5d9ec;
}

.hop-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 14px 0 0;
  padding: 10px 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.hop-points li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #d5d9ec;
}

.hop-points b {
  font-weight: 400;
  color: #fff;
}

.hop-points i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.hop-pt-coin { background: #ffd23f; border-radius: 50% !important; }
.hop-pt-stomp { background: #8e5bd6; }
.hop-pt-spike { background: #e5533d; }
.hop-pt-goal { background: var(--accent); }

.hop-how p {
  margin: 12px 0 0;
  line-height: 1.8;
  color: var(--muted);
}

@media (max-width: 600px) {
  .hop-head h1 {
    font-size: 30px;
  }

  .hop-head h1 span {
    display: block;
    margin: 4px 0 0;
  }

  .hop-best {
    min-width: 96px;
    padding: 6px 10px;
  }

  .hop-best strong {
    font-size: 18px;
  }

  .hop .hop-pad button {
    width: 64px;
    min-height: 60px;
  }

  .hop .hop-pad .hop-jump {
    width: 76px;
  }

  .hop-pad {
    gap: 8px;
  }

  .hop-how dt {
    min-width: 96px;
  }
}

@media (max-width: 600px) {
  main:has(.hop) {
    margin: 0;
  }
}
