:root {
  --ink: #e8edf2;
  --muted: #77828e;
  --surface: #10151a;
  --panel: #151b21;
  --line: #2a333c;
  --green: #77f2a7;
  --cyan: #64d4ed;
  --amber: #ffc35b;
  --red: #ff5b5b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(100, 212, 237, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 212, 237, .035) 1px, transparent 1px),
    #090c0f;
  background-size: 36px 36px;
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }
.busy button:not(.stop-button) { pointer-events: none; opacity: .55; }

.console { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 32px; }

.console-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.eyebrow { margin: 0 0 10px; color: var(--cyan); font: 700 12px/1.2 Consolas, monospace; letter-spacing: .22em; }
h1 { margin: 0; font-size: clamp(38px, 6vw, 68px); line-height: .92; letter-spacing: -.05em; }
h1 span { color: transparent; -webkit-text-stroke: 1px #6d7882; }

.connection { min-width: 220px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); padding: 14px 18px; background: rgba(16, 21, 26, .88); }
.connection strong, .connection small { display: block; }
.connection strong { font: 700 15px Consolas, monospace; letter-spacing: .12em; }
.connection small { margin-top: 4px; color: var(--muted); }
.status-light { width: 12px; height: 12px; border-radius: 50%; background: var(--red); box-shadow: 0 0 16px rgba(255, 91, 91, .55); }
.status-light.online { background: var(--green); box-shadow: 0 0 16px rgba(119, 242, 167, .7); }

.status-strip { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); background: var(--surface); }
.status-strip div { min-width: 0; padding: 18px 20px; border-right: 1px solid var(--line); }
.status-strip div:last-child { border-right: 0; }
.status-strip span, footer span { color: var(--muted); font: 700 10px Consolas, monospace; letter-spacing: .14em; }
.status-strip strong { display: block; margin-top: 7px; font: 700 22px Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.notice { margin: 18px 0; padding: 13px 16px; border-left: 3px solid var(--cyan); background: rgba(100, 212, 237, .08); color: #b9c6cf; }
.notice.success { border-color: var(--green); background: rgba(119, 242, 167, .08); }
.notice.error { border-color: var(--red); background: rgba(255, 91, 91, .09); color: #ffb3b3; }

.control-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; }
.panel { position: relative; min-height: 360px; padding: 28px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(28, 36, 43, .95), rgba(15, 20, 25, .97)); box-shadow: 0 22px 60px rgba(0,0,0,.2); }
.panel::after { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(255,255,255,.025); pointer-events: none; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 34px; }
.panel-heading > div { display: flex; align-items: center; gap: 13px; }
.panel-number { color: var(--muted); font: 700 11px Consolas, monospace; }
h2 { margin: 0; font-size: 22px; letter-spacing: .02em; }
.panel-tag { border: 1px solid var(--cyan); color: var(--cyan); padding: 5px 8px; font: 700 10px Consolas, monospace; letter-spacing: .16em; }
.panel-tag.warning { border-color: var(--amber); color: var(--amber); }

.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.three-column { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
label, legend { color: #9aa6b1; font-size: 13px; font-weight: 700; }
input { width: 100%; margin-top: 9px; padding: 13px 14px; border: 1px solid #38434d; border-radius: 0; outline: none; color: var(--ink); background: #0c1115; font: 700 20px Consolas, monospace; }
input:focus { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(100,212,237,.12); }
fieldset { margin: 27px 0 0; padding: 0; border: 0; }
legend { margin-bottom: 10px; }
.interval-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.start-button { min-height: 82px; border: 1px solid #38434d; color: var(--ink); background: #0c1115; transition: .15s ease; }
.start-button:hover, .start-button:focus-visible { border-color: var(--green); color: var(--green); transform: translateY(-2px); }
.start-button strong, .start-button span { display: block; }
.start-button strong { font: 700 27px Consolas, monospace; }
.start-button span { margin-top: 3px; color: var(--muted); font: 700 9px Consolas, monospace; letter-spacing: .12em; }

.hint { min-height: 45px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.tone-button { width: 100%; min-height: 72px; margin-top: 15px; border: 1px solid var(--amber); color: var(--amber); background: rgba(255,195,91,.05); font-weight: 800; letter-spacing: .08em; }
.tone-button:hover, .tone-button:focus-visible { background: var(--amber); color: #12100a; }
.play-mark { display: inline-block; width: 0; height: 0; margin-right: 12px; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 11px solid currentColor; vertical-align: -2px; }

.stop-zone { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-top: 18px; padding: 22px 28px; border: 1px solid rgba(255,91,91,.35); background: repeating-linear-gradient(-45deg, rgba(255,91,91,.035), rgba(255,91,91,.035) 8px, transparent 8px, transparent 16px); }
.stop-zone > div > span { color: var(--red); font: 700 10px Consolas, monospace; letter-spacing: .18em; }
.stop-zone p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.stop-button { min-width: 270px; min-height: 70px; border: 0; color: white; background: var(--red); font: 900 24px Consolas, monospace; letter-spacing: .16em; box-shadow: 0 8px 30px rgba(255,91,91,.25); }
.stop-button:hover, .stop-button:focus-visible { background: #ff7373; }
.stop-button span { display: inline-block; width: 14px; height: 14px; margin-right: 13px; background: currentColor; vertical-align: -1px; }

footer { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 20px; padding: 0 2px; }
footer strong { color: #b4bec7; }

@media (max-width: 780px) {
  .console { width: min(100% - 20px, 620px); padding-top: 22px; }
  .console-header { align-items: stretch; flex-direction: column; }
  .connection { width: 100%; }
  .status-strip { grid-template-columns: repeat(2, 1fr); }
  .status-strip div { border-bottom: 1px solid var(--line); }
  .status-strip div:nth-child(2n) { border-right: 0; }
  .status-strip div:nth-last-child(-n+2) { border-bottom: 0; }
  .control-grid { grid-template-columns: 1fr; }
  .panel { min-height: 0; padding: 22px; }
  .stop-zone { align-items: stretch; flex-direction: column; }
  .stop-button { width: 100%; min-width: 0; }
}

@media (max-width: 440px) {
  .two-column, .three-column { grid-template-columns: 1fr; }
  .interval-buttons { grid-template-columns: repeat(2, 1fr); }
  footer { gap: 14px; flex-direction: column; }
}
