:root {
  color-scheme: dark;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  background: #090705;
  color: #fff8e8;
}

* { box-sizing: border-box; }

body {
  min-width: 900px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(166, 59, 18, .2), transparent 38%),
    linear-gradient(180deg, #17100b 0%, #050403 100%);
}

button { font: inherit; }

.shell {
  width: min(1440px, 96vw);
  margin: 0 auto;
  padding: 18px 0 24px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 4px 14px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #e6a457;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .24em;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 43px);
  letter-spacing: -.055em;
  text-shadow: 0 3px 18px rgba(255, 87, 20, .28);
}

h1 span { color: #ff4b27; padding: 0 .18em; }

.hardware-panel { display: flex; align-items: center; gap: 10px; }

.status-dot {
  color: #bad7ba;
  font-size: 13px;
  font-weight: 700;
}

.status-dot::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: #65d06e;
  box-shadow: 0 0 10px #65d06e;
}

.status-dot.connected { color: #8eeaff; }
.status-dot.connected::before { background: #28d9ff; box-shadow: 0 0 12px #28d9ff; }

.hardware-panel button,
#startButton {
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 9px;
  background: linear-gradient(180deg, #8e301b, #5d190f);
  color: white;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 1px rgba(255,255,255,.18), 0 6px 18px rgba(0,0,0,.3);
}

.hardware-panel button { padding: 9px 13px; font-size: 12px; }
.hardware-panel button:hover, #startButton:hover { filter: brightness(1.18); }

.game-frame {
  position: relative;
  overflow: hidden;
  border: 2px solid #6d4225;
  border-radius: 14px;
  background: #120d09;
  box-shadow: 0 22px 70px rgba(0,0,0,.62), inset 0 0 45px rgba(255,110,38,.08);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: linear-gradient(90deg, rgba(20,10,6,.96), rgba(16,11,9,.8), rgba(20,10,6,.96));
  transition: opacity .22s ease;
}

.overlay.hidden { opacity: 0; pointer-events: none; }

.versus-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(760px, 85%);
  gap: 24px;
}

.portrait {
  display: grid;
  justify-items: center;
  min-width: 0;
  padding: 14px 14px 13px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  box-shadow: inset 0 0 30px rgba(255,255,255,.04);
}

.portrait img {
  width: 100%;
  height: 230px;
  object-fit: contain;
  object-position: center;
  border-radius: 9px;
  background: white;
}

.portrait strong { margin-top: 10px; font-size: 19px; }
.portrait small { margin-top: 3px; color: #cbbeb4; }
.portrait-sahur { border-color: rgba(226, 125, 44, .52); }
.portrait-tung { border-color: rgba(233, 68, 44, .52); }

.versus-mark {
  color: #ff542f;
  font-size: 44px;
  font-weight: 1000;
  font-style: italic;
  text-shadow: 0 0 24px #ff3a1a;
  transform: rotate(-7deg);
}

.overlay h2 { margin: 19px 0 2px; font-size: 29px; }
.overlay p { margin: 5px 0 16px; color: #d4c8bd; }
#startButton { padding: 13px 25px; font-size: 16px; }

.control-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 14px 8px 0;
  color: #d6c8bd;
  font-size: 12px;
}

.control-strip div { display: flex; align-items: center; gap: 5px; }
.control-strip span { margin-left: 2px; }
.control-strip b { color: #8e7666; }

kbd {
  min-width: 27px;
  padding: 4px 7px;
  border: 1px solid #74513a;
  border-bottom-width: 3px;
  border-radius: 5px;
  background: #261810;
  color: #fff2dd;
  text-align: center;
  font-weight: 900;
}

@media (max-width: 1000px) {
  .portrait img { height: 180px; }
  .overlay h2 { font-size: 23px; }
}
