:root {
  --bg: #14171c; --card: #1d2229; --line: #2c333d;
  --text: #d7dde6; --muted: #8a94a3; --accent: #4f9cf9;
  --good: #4caf7d; --bad: #e05f5f; --warn: #d9a23c;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, sans-serif;
}
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 22px; border-bottom: 1px solid var(--line);
}
header h1 { font-size: 20px; margin: 0; }
main { padding: 22px; max-width: 1280px; margin: 0 auto; }
.hidden { display: none !important; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 18px;
}
.card h2 { margin-top: 0; font-size: 17px; }
.narrow { max-width: 360px; margin: 8vh auto; }
.center { text-align: center; }
.muted { color: var(--muted); font-size: 13px; }
.error { color: var(--bad); font-size: 13px; }
.rating { color: var(--warn); font-weight: 600; }
.columns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .columns { grid-template-columns: 1fr; } }

input {
  display: block; width: 100%; margin: 8px 0; padding: 9px 11px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 7px;
}
button {
  padding: 9px 16px; border: 0; border-radius: 7px; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 14px;
}
button:disabled { opacity: .45; cursor: default; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
button.danger { background: var(--bad); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; }
ul.plain { list-style: none; padding: 0; margin: 8px 0; font-size: 14px; }
ul.plain li { padding: 5px 0; border-bottom: 1px solid var(--line); }

.duel-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 18px; }
@media (max-width: 1000px) { .duel-grid { grid-template-columns: 1fr; } }
#statement { font-size: 14px; }
#statement pre { background: var(--bg); padding: 10px; border-radius: 7px; overflow-x: auto; }
#statement code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.duel-top { display: flex; justify-content: space-between; margin-bottom: 10px; }
.CodeMirror { height: 320px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; }
.duel-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 5px; }
.dot.on { background: var(--good); }
.dot.off { background: var(--bad); }

.v-AC { color: var(--good); font-weight: 700; }
.v-WA, .v-RE, .v-CE { color: var(--bad); font-weight: 700; }
.v-TLE, .v-MLE { color: var(--warn); font-weight: 700; }

.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center;
}
.overlay .card { min-width: 320px; }
