html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Arial, sans-serif;
  background: #000;
  color: white;
}
#hud {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 10;
  width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(17, 24, 39, 0.78);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 36px rgba(0,0,0,.25);
}
#hud h1 { margin: 0 0 8px; font-size: 22px; }
#status {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
#hint { font-size: 13px; opacity: .88; line-height: 1.35; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }
.dot { display:inline-block; width:12px; height:12px; border-radius:50%; vertical-align:-2px; margin-right:4px; }
.green { background:#22c55e; }
.red { background:#ef4444; }
.yellow { background:#facc15; }
canvas { display:block; }

#controls {
  margin-top: 8px;
  display: grid;
  gap: 6px;
  font-size: 12px;
}
#controls label {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
}
#controls select, #controls input, #controls button {
  font-size: 12px;
  border: 0;
  border-radius: 7px;
  padding: 4px 6px;
}
.netrow {
  display: flex;
  gap: 5px;
}
#roomCode {
  min-width: 0;
  flex: 1;
}
#connectNet {
  cursor: pointer;
  font-weight: 700;
}

.room-status {
  padding: 5px 7px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  font-size: 11px;
  line-height: 1.25;
}
.room-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  max-height: 122px;
  overflow: auto;
  padding-right: 2px;
}
.room-btn {
  border: 0;
  border-radius: 7px;
  padding: 5px 2px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  color: #0f172a;
}
.room-empty { background: #e5e7eb; }
.room-waiting { background: #fde047; }
.room-full { background: #fb7185; color: #fff; }
.room-selected { outline: 2px solid #38bdf8; }

/* V9 kompakt menü */
#hud {
  width: 330px !important;
  padding: 10px 12px !important;
}
#hud h1 {
  font-size: 21px !important;
  margin-bottom: 6px !important;
}
#hint {
  font-size: 12px !important;
  line-height: 1.35 !important;
}
.legend {
  gap: 8px !important;
  font-size: 12px !important;
  flex-wrap: wrap;
}
#controls {
  gap: 5px !important;
  margin-top: 6px !important;
}
#controls label {
  font-size: 12px !important;
}
#controls select {
  max-width: 170px;
}
.room-list {
  display: none !important;
}
.compact-room {
  display: flex;
  gap: 6px;
  align-items: center;
}
#roomSelect {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  border: 0;
  border-radius: 7px;
  padding: 5px 6px;
}
#connectNet {
  flex: 0 0 auto;
  padding: 5px 8px !important;
}
.room-status {
  font-size: 11px !important;
  padding: 5px 7px !important;
  max-height: 32px;
  overflow: hidden;
}

.time-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  font-size: 12px;
}
#timeSelect {
  max-width: 170px;
  font-size: 12px;
  border: 0;
  border-radius: 7px;
  padding: 4px 6px;
}
.timer-panel {
  position: fixed;
  right: 12px;
  top: 12px;
  z-index: 11;
  display: flex;
  gap: 6px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  border-radius: 12px;
  padding: 7px 8px;
  font-family: Arial, sans-serif;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.clock {
  min-width: 86px;
  text-align: center;
  padding: 6px 8px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
}
.active-clock {
  background: rgba(250, 204, 21, 0.95);
  color: #111827;
}
.low-time {
  background: rgba(239, 68, 68, 0.95) !important;
  color: white !important;
}
@media (max-width: 760px) {
  .timer-panel {
    top: auto;
    bottom: 10px;
    right: 10px;
    padding: 5px 6px;
  }
  .clock {
    min-width: 72px;
    font-size: 11px;
    padding: 5px 6px;
  }
}

.hidden {
  display: none !important;
}
.online-controls {
  display: grid;
  gap: 5px;
}

.game-over-panel {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.86);
  color: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 10px 32px rgba(0,0,0,.28);
  backdrop-filter: blur(7px);
}
.game-over-text {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}
.restart-btn {
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  background: #facc15;
  color: #111827;
}
.restart-btn:hover {
  filter: brightness(1.03);
}

.desktop-vr-btn {
  border: 0;
  border-radius: 9px;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 800;
  background: #38bdf8;
  color: #0f172a;
  cursor: pointer;
}
.desktop-vr-btn:hover {
  filter: brightness(1.05);
}
body.desktop-vr-test #hud {
  opacity: 0.18;
}
body.desktop-vr-test #hud:hover {
  opacity: 1;
}

/* AR sürümü: WebXR düğmesi HUD üstüne binmesin. */
#ARButton {
  z-index: 20 !important;
  bottom: 18px !important;
}
