:root {
  color-scheme: dark;
  background: #000;
  color: #fff;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* {
  box-sizing: border-box;
  user-select: none;
}
*::-moz-focus-inner {
  border: 0;
}
*:focus {
  outline: none;
  box-shadow: none;
}
html,
body {
  height: 100%;
}

/* maincolor body background */
html,
body,
.app-shell {
  touch-action: none;
}

body {
  margin: 0;
  min-height: 100%;
  background: rgb(22, 22, 22);
}
/* maincolor text color */
body {
  color: #ffffff;
}
button,
input,
select {
  font: inherit;
}
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100%;
}
.top-bar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 0px 14px;
  /* margin-bottom: 10px; */
  gap: 10px;
  /* border-bottom: 1px solid rgba(255, 255, 255, 0.08); */
}
.top-menu {
  position: relative;
  display: flex;
  align-items: center;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0px solid rgba(255, 255, 255, 0);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.00);
  color: #fff;
  cursor: pointer;
}
.icon-button:hover {
  background: rgba(255, 255, 255, 0);
}
.icon-button img {
  display: block;
  width: 20px;
  height: 20px;
}
.options-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 260px;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  background: rgba(10, 10, 10, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.24);
  z-index: 9999;
}
.options-menu.hidden {
  display: none;
}
.menu-header {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
  opacity: 0.82;
}
.menu-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.checkbox-item {
  margin-bottom: 0;
  padding: 15px 0;
}
.menu-item label {
  font-size: 0.88rem;
}
.menu-note {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.68);
}
.options-menu input[type="range"] {
  width: 100%;
}
.options-menu input[type="checkbox"] {
  margin-right: 10px;
}
.brand {
  font-size: 0.96rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.status {
  display: flex;
  align-items: center;
  gap: 10px;
}
.status span {
  opacity: 0.82;
  font-size: 0.9rem;
}
.main-grid {
  display: flex;
  flex: 1;
  gap: 18px;
  align-items: stretch;
  justify-content: center;
  min-height: 0;
  height: 100%;
  padding: 0 0px;
}
.game-panel {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  overflow: hidden;
  min-height: 0;
  align-self: stretch;
  height: 100%;
  touch-action: none;
}

@media (orientation: portrait) {
  .main-grid {
    align-items: center;
  }
  .game-panel {
    max-height: 60vh;
    height: auto;
  }
}

/* maincolor canvas background */
canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #010101;
  touch-action: none;
  border-radius: 0;
}
.ball-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: transparent;
  z-index: 1;
}
canvas#pongCanvas {
  position: relative;
  z-index: 0;
}
.bottom-panel {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  padding: 2px 14px;
  gap: 14px;
  min-width: 0;
  overflow-x: auto;
}
.zoom-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 10px;
  min-width: 0;
  border-radius: 12px;
  /* padding: 0px 12px; */
  flex-wrap: nowrap;
}
.zoom-bar label,
.zoom-bar span {
  font-size: 0.82rem;
  color: rgba(201, 201, 201, 0.88);
  white-space: nowrap;
  flex-shrink: 0;
}
.zoom-bar input[type="range"] {
  flex: 1 1 auto;
  min-width: 72px;
  max-width: 100%;
  width: auto;
  accent-color: #4f4f4f;
}
.canvas-info-bar {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 0;
  color: rgba(201, 201, 201, 0.88);
  font-size: 0.76rem;
  text-align: right;
  min-height: 16px;
  min-width: 0;
}
.canvas-info-bar span {
  display: inline-flex;
  white-space: nowrap;
  flex-shrink: 0;
}
.canvas-info-bar strong {
  font-weight: 400;
}
.zoom-bar input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}
.zoom-bar input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  background: #686868;
  border-radius: 50%;
  /* border: 1px solid rgba(255, 255, 255, 0.18); */
  margin-top: -4px;
}
.zoom-bar input[type="range"]::-moz-range-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}
.zoom-bar input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #ddd;
  border-radius: 50%;
  /* border: 1px solid rgba(255, 255, 255, 0.18); */
}

@media (max-width: 760px) {
  .bottom-panel {
    flex-direction: row;
    align-items: center;
  }
  .zoom-bar,
  .canvas-info-bar {
    flex: 0 0 auto;
  }
  .zoom-bar label,
  .zoom-bar span,
  .canvas-info-bar {
    font-size: 0.78rem;
  }
}
.info-bar {
  display: none;
  align-items: center;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0px 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.76rem;
  text-align: left;
  gap: 18px;
  margin-bottom: 4px;
}
.menu-button {
  width: 100%;
  padding: 10px 12px;
  margin: 0 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  text-align: left;
}
.menu-button:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}
.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px;
}
.panel h2 {
  margin: 0 0 14px;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ddd;
}
.label-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.94rem;
}
.checkbox-row {
  flex-direction: row;
  align-items: center;
}
.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}
.options-menu select option {
  background: #000;
  color: #fff;
}
input[type="range"] {
  width: 100%;
}
.zoom-bar input[type="range"] {
  width: auto;
  min-width: 56px;
  max-width: 100%;
}
button {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  font-size: 0.92rem;
}
.join-bar {
  display: flex;
  justify-content: flex-start;
  padding: 0 14px 10px;
}
.join-button {
  width: auto;
  margin-top: 15px;
  padding: 4px 14px;
  min-width: 80px;
}
button:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}
.player-list {
  display: grid;
  gap: 10px;
}
.player-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
}
.player-item span {
  opacity: 0.9;
}
.player-side {
  width: 48px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  opacity: 0.72;
}
@media (max-width: 960px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  .controls-panel {
    order: -1;
  }
}

