/* サイバーサッカー スタイル */

:root {
  --bg: #04050a;
  --you: #00e5ff;
  --cpu: #ff2bd6;
  --accent: #f6ff3d;
  --text: #dff6ff;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: 'Share Tech Mono', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', monospace;
  background: var(--bg);
  color: var(--text);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overflow: hidden;
}

#app {
  height: 100vh;
  height: 100dvh;
  background:
    linear-gradient(rgba(0, 229, 255, 0.05) 1px, transparent 1px) 0 0 / 100% 32px,
    linear-gradient(90deg, rgba(0, 229, 255, 0.05) 1px, transparent 1px) 0 0 / 32px 100%,
    var(--bg);
}

.screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1em;
  padding: 1em;
  text-align: center;
}

.screen[hidden] {
  display: none;
}

/* ---- タイトル ---- */

.game-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(2.4em, 12vw, 4em);
  line-height: 1.05;
  margin: 0;
  letter-spacing: 0.08em;
  color: var(--you);
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.7), 3px 3px 0 var(--cpu);
}

.howto {
  list-style: none;
  margin: 0;
  padding: 0.8em 1.1em;
  text-align: left;
  font-size: 0.9em;
  line-height: 1.9;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.05);
}

.howto b {
  color: var(--accent);
  font-weight: normal;
}

.name-box {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
}

.name-box label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7em;
  letter-spacing: 0.15em;
  opacity: 0.7;
}

#player-name {
  font: inherit;
  font-size: 1.1em;
  padding: 0.45em 0.8em;
  width: 12em;
  max-width: 80vw;
  border: 1px solid var(--you);
  border-radius: 0;
  background: rgba(0, 229, 255, 0.06);
  color: var(--text);
  text-align: center;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

#player-name:focus {
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}

/* ---- ボタン ---- */

.btn {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.05em;
  letter-spacing: 0.1em;
  padding: 0.75em 2em;
  border: 2px solid var(--you);
  border-radius: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.btn-main {
  background: var(--you);
  color: #001318;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.6);
}

.btn-sub {
  background: transparent;
  color: var(--you);
  font-size: 0.8em;
  padding: 0.6em 1.4em;
}

.btn:active {
  transform: scale(0.95);
}

/* ---- トグルスイッチ ---- */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.4em 0.2em;
  border: none;
  background: none;
  color: var(--text);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.8em;
  letter-spacing: 0.1em;
  cursor: pointer;
  touch-action: manipulation;
}

.switch-track {
  position: relative;
  width: 3.4em;
  height: 1.7em;
  border: 2px solid var(--you);
  background: rgba(0, 229, 255, 0.25);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.45);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.switch-knob {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: calc(100% - 1.15em - 2px);
  width: 1.15em;
  background: var(--you);
  transition: left 0.15s, background 0.15s;
}

.switch-state {
  width: 2.2em;
  text-align: left;
  color: var(--you);
}

.switch[aria-checked="false"] .switch-track {
  border-color: #56707a;
  background: transparent;
  box-shadow: none;
}

.switch[aria-checked="false"] .switch-knob {
  left: 2px;
  background: #56707a;
}

.switch[aria-checked="false"] .switch-state {
  color: #56707a;
}

.btn-row {
  display: flex;
  gap: 1em;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

/* ---- プレイ画面 ---- */

.screen-play {
  position: relative;
  padding: 0;
  gap: 0;
  justify-content: flex-start;
}

#hud {
  flex: none;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0.35em 0.7em;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.95em;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid rgba(0, 229, 255, 0.3);
  background: rgba(0, 0, 0, 0.6);
}

#hud-level {
  text-align: left;
  opacity: 0.85;
}

#hud-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6em;
}

#hud-clock {
  font-family: 'Share Tech Mono', monospace;
  font-weight: normal;
  font-size: 1.05em;
  white-space: nowrap;
}

#btn-pause {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2em;
  height: 2.2em;
  padding: 0;
  border: 1px solid var(--you);
  background: rgba(0, 229, 255, 0.08);
  cursor: pointer;
  touch-action: manipulation;
}

.pause-icon {
  width: 0.8em;
  height: 0.9em;
  border-left: 0.26em solid var(--you);
  border-right: 0.26em solid var(--you);
}

#pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2em;
  background: rgba(2, 4, 10, 0.78);
}

#pause-overlay[hidden] {
  display: none;
}

#pause-overlay h2 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(2em, 10vw, 3em);
  letter-spacing: 0.12em;
  margin: 0;
  color: var(--you);
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.7);
}

#hud-score b {
  font-size: 1.35em;
  color: #fff;
}

#hud .you { color: var(--you); }
#hud .cpu { color: var(--cpu); }

#field {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* ---- リザルト ---- */

#result-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(2em, 10vw, 3.2em);
  margin: 0;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-shadow: 0 0 18px rgba(246, 255, 61, 0.6);
}

#result-title.lose {
  color: var(--cpu);
  text-shadow: 0 0 18px rgba(255, 43, 214, 0.6);
}

#result-score {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8em;
  font-weight: 700;
  margin: 0;
}

#result-note {
  margin: 0;
  opacity: 0.85;
}

#result-total {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.1em;
  letter-spacing: 0.08em;
  margin: 0;
  color: var(--you);
}

#result-total small {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8em;
  font-weight: normal;
  color: var(--accent);
}

/* ---- ランキング ---- */

#ranking {
  width: min(420px, 92vw);
  max-height: 34vh;
  overflow-y: auto;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.05);
  padding: 0.5em 0.7em;
}

#ranking[hidden] {
  display: none;
}

#ranking h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8em;
  letter-spacing: 0.15em;
  margin: 0 0 0.3em;
  color: var(--you);
}

#ranking table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
}

#ranking td {
  padding: 0.25em 0.4em;
  border-top: 1px solid rgba(0, 229, 255, 0.15);
  text-align: right;
  white-space: nowrap;
}

#ranking td.name {
  text-align: left;
  width: 100%;
  white-space: normal;
  word-break: break-all;
}

#ranking tr.me td {
  color: var(--accent);
  background: rgba(246, 255, 61, 0.08);
}

#ranking p {
  margin: 0.4em 0 0;
  font-size: 0.85em;
  color: var(--accent);
}

/* 2026.10.18(02) */
