/* MORSE ROOM — play corner page (straight key + drum beat). Requires common.css.
   Console frame parts (.console-topline など) は converter.css の定義をこのページ用に取り込んでいる。 */
.play-page { max-width: 1120px; }
.play-intro { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 26px 0 35px; }
.play-intro h1 { margin-bottom: 10px; }
.play-intro .lead { max-width: 680px; }

/* Console frame */
.console-topline, .console-bottomline { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.console-topline { min-height: 76px; padding: 14px 24px; border-bottom: 1px solid #42595b; background: rgb(9 17 19 / 24%); }
.console-title-wrap { display: flex; align-items: center; gap: 13px; }
.console-led { width: 10px; height: 10px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 4px rgb(214 243 106 / 10%), 0 0 15px rgb(214 243 106 / 65%); }
.console-overline { margin: 0 0 3px; color: #9aada6; font: 9px var(--font-mono); letter-spacing: .15em; }
.console-title-wrap h2 { margin: 0; color: #edf3ec; font: 700 16px var(--font-mono); letter-spacing: .13em; }
.console-bottomline { min-height: 31px; padding: 0 24px; border-top: 1px solid #40585a; color: #82968d; background: rgb(8 15 17 / 42%); font: 8px var(--font-mono); letter-spacing: .12em; }
.console-bottomline > span:last-child { display: inline-flex; align-items: center; gap: 7px; }
.console-bottomline i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 7px var(--green); }
.bottomline-center { color: #627872; }

/* Play console card */
.play-card { position: relative; overflow: hidden; margin-bottom: 26px; border: 1px solid #536c6c; border-radius: 13px; background: linear-gradient(135deg, rgb(255 255 255 / 3%), transparent 35%), linear-gradient(155deg, #26383a, #182629 65%, #142124); box-shadow: 0 20px 55px rgb(0 0 0 / 30%), inset 0 1px rgb(255 255 255 / 8%); }
.play-card::before { position: absolute; inset: 0; content: ""; opacity: .22; pointer-events: none; background: repeating-linear-gradient(135deg, transparent 0 7px, rgb(255 255 255 / 2%) 8px 9px); }
.play-mode-note { display: grid; gap: 3px; text-align: right; }
.play-mode-note span:first-child { color: var(--subtle); font: 8px var(--font-mono); letter-spacing: .13em; }
.play-mode-note span:last-child { color: var(--signal); font-size: 11px; font-weight: 700; }
.play-body { position: relative; z-index: 1; padding: 22px 24px 20px; }

/* Settings */
.play-settings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding-bottom: 20px; border-bottom: 1px solid rgb(83 108 108 / 45%); }
.setting-field { min-width: 0; }
.control-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: #dce7df; font-size: 10px; font-weight: 600; white-space: nowrap; }
.control-label span { color: #819690; font: 8px var(--font-mono); letter-spacing: .08em; }
.control-label .range-value { color: var(--signal); font: 700 16px var(--font-mono); letter-spacing: .03em; }
.control-label .range-value small { color: var(--subtle); font-size: 9px; }
.play-settings .range-field { margin-top: 2px; }

/* Key area */
.key-area { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; padding-top: 21px; }
.flash-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 19px 15px; border: 1px solid #4b6264; border-radius: 8px; background: linear-gradient(145deg, #142124, #0e191b); box-shadow: inset 0 0 20px rgb(0 0 0 / 16%); }
.flash-stage__label { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--subtle); font: 8px var(--font-mono); letter-spacing: .09em; }
.flash-stage__label span:last-child { font-family: var(--font-sans); letter-spacing: 0; }
.play-page .flash { width: 104px; height: 104px; border: 1px solid #60796e; border-radius: 50%; background: radial-gradient(circle, #2b3e3a 0 52%, #1a2a28 53%); box-shadow: inset 0 0 18px #0a1412, 0 0 0 6px rgb(35 53 56 / 45%); }
.play-page .flash.on { border-color: #e5ff82; background: radial-gradient(circle, #f6ff9f 0 28%, #d6f36a 46%, #93b43a 70%, #5e7a2b 100%); box-shadow: 0 0 12px 5px rgb(214 243 106 / 18%), 0 0 48px rgb(214 243 106 / 65%); }
.key-cur { margin: 0; color: var(--muted); font-size: 11px; }
.key-cur span { color: var(--signal); font: 700 14px var(--font-mono); letter-spacing: .1em; }
.key-main { min-width: 0; }

/* The big straight key */
.key-pad { width: 100%; min-height: 118px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px; border: 1px solid #6d8577; border-radius: 12px; color: var(--text); background: linear-gradient(180deg, #31484a, #1d2f31 60%, #162426); box-shadow: 0 7px 0 #0c1516, 0 14px 28px rgb(0 0 0 / 35%), inset 0 1px rgb(255 255 255 / 9%); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; transition: transform .05s, box-shadow .05s, background .1s; }
.key-pad__label { font: 700 26px var(--font-mono); letter-spacing: .3em; text-indent: .3em; color: var(--signal); }
.key-pad__hint { color: var(--muted); font-size: 11px; }
.key-pad.is-down { transform: translateY(5px); background: linear-gradient(180deg, #3d5a4c, #274435 60%, #1c3325); box-shadow: 0 2px 0 #0c1516, 0 6px 14px rgb(0 0 0 / 35%), inset 0 0 24px rgb(214 243 106 / 14%); }
.key-pad:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }

/* Keying meter（押下時間のバー。線が短点／長点の境目、超えると色が変わる） */
.key-meter { margin-top: 14px; }
.key-meter__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: var(--subtle); font: 8px var(--font-mono); letter-spacing: .13em; }
.key-meter__ms { color: var(--signal); font: 700 13px var(--font-mono); letter-spacing: .03em; }
.key-meter__track { position: relative; height: 14px; border: 1px solid #4b6264; border-radius: 7px; background: linear-gradient(180deg, #0d1618, #131f21); box-shadow: inset 0 0 10px rgb(0 0 0 / 35%); overflow: hidden; }
.key-meter__fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px 0 0 6px; background: linear-gradient(90deg, #93b43a, var(--signal)); transition: background .1s; }
.key-meter__fill.is-over { background: linear-gradient(90deg, #d98a2b, #ffb454); }
.key-meter__mark { position: absolute; top: -1px; bottom: -1px; left: 33.33%; width: 2px; margin-left: -1px; background: #e5ff82; box-shadow: 0 0 6px rgb(214 243 106 / 80%); }
.key-meter__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 5px; color: var(--subtle); font-size: 9px; }
.key-meter__verdict { font: 700 11px var(--font-mono); letter-spacing: .08em; min-height: 14px; }
.key-meter__verdict.is-dit { color: var(--signal); }
.key-meter__verdict.is-dah { color: #ffb454; }

.key-output { margin-top: 16px; }
.key-text { margin: 10px 0 12px; color: var(--text); font-size: 19px; font-weight: 700; letter-spacing: .06em; overflow-wrap: anywhere; min-height: 30px; }
.key-code { margin: 10px 0 4px; min-height: 24px; }
.key-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.key-actions .btn { min-height: 43px; }

/* Scale (do-re-mi) pad */
.scale-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid rgb(83 108 108 / 45%); }
.scale-pad { margin-top: 14px; }
.scale-keys { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.scale-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 10px 4px; border: 1px solid #4b6264; border-radius: 9px; color: var(--text); background: linear-gradient(160deg, #22363a, #141f22); font-size: 16px; font-weight: 700; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; transition: border-color .15s, background .15s, transform .05s; }
.scale-btn small { color: var(--subtle); font: 8px var(--font-mono); letter-spacing: .05em; }
.scale-btn:hover { border-color: var(--signal-dark); }
.scale-btn.is-selected { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal), 0 0 14px rgb(214 243 106 / 18%); }
.scale-btn.is-down { transform: translateY(2px); background: linear-gradient(160deg, #3d5a4c, #22392c); border-color: var(--signal); }
.scale-btn:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
@media (max-width: 700px) {
  .scale-keys { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .scale-btn { min-height: 58px; font-size: 15px; }
}
.answer-hint { margin: 10px 0 0; color: var(--subtle); font-size: 10px; }
.play-icon { font-size: 10px; }

/* Beat unit */
.beat-row { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.beat-dot-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 2px; }
.beat-dot { width: 34px; height: 34px; border: 1px solid #60796e; border-radius: 50%; background: radial-gradient(circle, #2b3e3a 0 52%, #1a2a28 53%); box-shadow: inset 0 0 10px #0a1412; }
.beat-dot.on { border-color: #e5ff82; background: radial-gradient(circle, #f6ff9f 0 28%, #d6f36a 55%, #93b43a 100%); box-shadow: 0 0 10px 3px rgb(214 243 106 / 22%), 0 0 30px rgb(214 243 106 / 60%); }
.beat-dot__label { color: var(--subtle); font: 8px var(--font-mono); letter-spacing: .13em; }
.beat-pattern-field { flex: 1 1 240px; max-width: 340px; }
.beat-tempo-field { flex: 1 1 200px; max-width: 300px; }
.beat-row .btn { min-height: 44px; }

/* How to / related links */
.howto-section { margin-top: 48px; }
.section-note { margin: -8px 0 18px; color: var(--muted); font-size: 12px; }
.play-links { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 31px; }
.related-link { min-width: 0; display: grid; grid-template-columns: 34px 1fr auto; column-gap: 12px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(145deg, #1d2c2f, #142124); transition: border-color .2s, transform .2s; }
.related-link:hover { border-color: var(--signal-dark); transform: translateY(-2px); }
.related-link__index { grid-column: 1 / -1; color: var(--signal-dark); font: 8px var(--font-mono); letter-spacing: .1em; }
.related-link__icon { grid-row: 2 / span 2; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line-bright); border-radius: 6px; color: var(--signal); background: #142220; font-size: 18px; }
.related-link strong { color: var(--text); font-size: 13px; }
.related-link p { grid-column: 2; margin: 2px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.related-link__arrow { grid-column: 3; grid-row: 2 / span 2; color: var(--signal); font-size: 10px; font-weight: 700; white-space: nowrap; }

@media (max-width: 900px) {
  .play-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .key-area { grid-template-columns: 190px minmax(0, 1fr); gap: 15px; }
  .play-page .flash { width: 86px; height: 86px; }
}
@media (max-width: 700px) {
  .play-intro { padding: 23px 0 28px; }
  .console-topline { min-height: 67px; padding: 12px 16px; }
  .console-bottomline { padding-inline: 16px; }
  .play-body { padding: 16px; }
  .play-settings { grid-template-columns: 1fr; gap: 13px; }
  .key-area { grid-template-columns: 1fr; gap: 12px; padding-top: 16px; }
  .flash-stage { flex-direction: row; justify-content: space-between; padding: 13px 16px; }
  .flash-stage__label { width: auto; flex-direction: column; align-items: flex-start; gap: 3px; }
  .play-page .flash { width: 58px; height: 58px; }
  .key-cur { text-align: right; }
  .key-pad { min-height: 104px; }
  .beat-row { align-items: stretch; }
  .beat-pattern-field { max-width: none; }
  .beat-tempo-field { max-width: none; }
  .howto-section { margin-top: 38px; }
  .play-links { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 520px) {
  .play-intro { align-items: flex-start; gap: 8px; }
  .play-intro h1 { font-size: 25px; }
  .play-intro .lead { font-size: 12px; }
  .console-title-wrap h2 { font-size: 13px; }
  .console-overline { font-size: 8px; }
  .key-pad__label { font-size: 22px; }
  .key-text { font-size: 16px; }
  .related-link { grid-template-columns: 30px 1fr; column-gap: 9px; padding: 13px; }
  .related-link__arrow { grid-column: 1 / -1; grid-row: auto; justify-self: end; }
}
@media (prefers-reduced-motion: reduce) {
  .play-page *, .play-page *::before, .play-page *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* How to play links */
.play-page .data-table a { color: var(--signal); font-weight: 700; }
