

.pool-shell {
  position: relative !important;
  background: #070b17;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.5);
}


.pool-viewport {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  min-height: calc(100vh - 73px);
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  gap: 20px;
  padding: 16px;
  box-sizing: border-box;
}

@media (max-width: 1300px) {
  .pool-viewport {
    grid-template-columns: 260px 1fr;
  }
  .pool-gameplay-sidebar {
    display: none;
  }
}

@media (max-width: 960px) {
  .pool-viewport {
    grid-template-columns: 1fr;
    padding: 10px;
  }
  .settings-sidebar {
    position: fixed;
    top: 73px;
    left: -320px;
    width: 300px;
    height: calc(100vh - 73px);
    z-index: 1000;
    background: var(--bg-surface, #0d121f);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.7);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
  }
  .settings-sidebar.mobile-open {
    left: 0;
  }
  .mobile-settings-toggle {
    display: inline-flex !important;
  }
}


.pool-arena-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  gap: 16px;
}


.pool-match-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1000px;
  background: var(--panel-bg, rgba(16, 22, 36, 0.85));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  padding: 12px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  position: relative;
  gap: 12px;
}


.pool-player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.pool-player-card.player-2 {
  flex-direction: row-reverse;
  text-align: right;
}

.pool-player-card.active-turn {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
}

.pool-player-card.active-turn.player-2 {
  background: rgba(255, 170, 0, 0.08);
  border-color: rgba(255, 170, 0, 0.4);
  box-shadow: 0 0 16px rgba(255, 170, 0, 0.2);
}

.pool-player-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.pool-player-card.active-turn .pool-player-avatar {
  border-color: var(--primary-accent, #00f0ff);
  animation: pulseAvatar 1.5s infinite;
}

@keyframes pulseAvatar {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.pool-player-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pool-player-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pool-player-2 .pool-player-name-row {
  justify-content: flex-end;
}

.pool-player-name {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pool-player-group-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
}

.pool-player-group-badge.solids {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.pool-player-group-badge.stripes {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}


.pool-balls-rack {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pool-player-2 .pool-balls-rack {
  justify-content: flex-end;
}

.pool-rack-ball {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  background: #475569;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  position: relative;
  box-shadow: inset -1px -1px 3px rgba(0, 0, 0, 0.6), inset 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.pool-rack-ball.potted {
  opacity: 0.2;
  filter: grayscale(100%);
  transform: scale(0.8);
}


.pool-hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 160px;
}

.pool-turn-status-text {
  font-family: var(--font-mono, 'Share Tech Mono', monospace);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #38bdf8;
  text-align: center;
}

.pool-turn-timer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-mono, 'Share Tech Mono', monospace);
  font-size: 18px;
  font-weight: 800;
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 1px;
  transition: all 0.2s ease;
}

.pool-turn-timer-badge.timer-warning {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.6);
  animation: timerBlink 0.6s infinite alternate;
}

@keyframes timerBlink {
  0% { transform: scale(1); box-shadow: 0 0 4px rgba(239, 68, 68, 0.3); }
  100% { transform: scale(1.08); box-shadow: 0 0 16px rgba(239, 68, 68, 0.8); }
}

.pool-ball-in-hand-banner {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 2px 10px;
  border-radius: 12px;
  animation: pulseNotice 1.5s infinite;
}

@keyframes pulseNotice {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; transform: translateY(-1px); }
}


.pool-arena-table-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1070px;
  gap: 14px;
}


.miniclip-cue-power-meter {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 48px;
  height: 480px;
  max-height: 100%;
  background: linear-gradient(180deg, #182234 0%, #0d131f 100%);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 12px 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65), inset 0 1px 2px rgba(255, 255, 255, 0.1);
  user-select: none;
  touch-action: none;
  cursor: grab;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.miniclip-cue-power-meter:hover {
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7), 0 0 15px rgba(0, 240, 255, 0.2);
}

.miniclip-cue-power-meter:active {
  cursor: grabbing;
}

.cue-power-meter-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #94a3b8;
}

.cue-power-track {
  position: relative;
  width: 18px;
  flex: 1;
  margin: 10px 0;
  background: #090e17;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.cue-power-gauge-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 65%;
  background: linear-gradient(180deg, #10b981 0%, #f59e0b 50%, #ef4444 100%);
  border-radius: 9px;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
  pointer-events: none;
  transition: height 0.04s ease-out;
}

.cue-power-ticks {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  pointer-events: none;
  padding: 8px 0;
}

.cue-power-ticks span {
  display: block;
  width: 6px;
  height: 1.5px;
  background: rgba(255, 255, 255, 0.35);
  margin-left: auto;
  margin-right: auto;
}

.cue-power-draggable-stick {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  width: 8px;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cue-power-stick-tip {
  width: 8px;
  height: 6px;
  background: #38bdf8;
  border-radius: 2px 2px 0 0;
}

.cue-power-stick-shaft {
  width: 6px;
  flex: 1;
  background: linear-gradient(180deg, #fef08a 0%, #92400e 70%, #1c1917 100%);
}

.cue-power-stick-grip {
  width: 8px;
  height: 40px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0 0 3px 3px;
}

.cue-power-percent-badge {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

@media (max-width: 900px) {
  .pool-arena-table-row {
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
  }
  .miniclip-cue-power-meter {
    display: flex;
    width: 42px;
    min-width: 42px;
    height: auto;
    min-height: 280px;
    align-self: stretch;
    padding: 10px 3px;
  }
  .cue-power-meter-label {
    font-size: 8px;
    letter-spacing: 0.8px;
  }
  .cue-power-percent-badge {
    font-size: 11px;
  }
}

.pool-table-frame {
  position: relative;
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 1000px;
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 0, 0, 0.5);
  transition: all 0.4s ease;
  user-select: none;
  touch-action: none;
}


.pool-table-frame.theme-emerald {
  background: linear-gradient(135deg, #3d1c06 0%, #200f04 50%, #4a2208 100%);
  border: 4px solid #5a2e10;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), inset 0 2px 4px rgba(255, 255, 255, 0.1);
}


.pool-table-frame.theme-cyber {
  background: linear-gradient(135deg, #090e17 0%, #151d2c 50%, #0c121d 100%);
  border: 4px solid #00f0ff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 240, 255, 0.3), inset 0 0 15px rgba(0, 240, 255, 0.2);
}


.pool-table-frame.theme-burgundy {
  background: linear-gradient(135deg, #2b0b14 0%, #17050a 50%, #3a0e1b 100%);
  border: 4px solid #d97706;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 25px rgba(217, 119, 6, 0.25);
}


.pool-canvas-container {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.85);
  background: #000;
}

#pool-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

#pool-canvas.ball-in-hand-active {
  cursor: grab;
}

#pool-canvas.ball-in-hand-active:active {
  cursor: grabbing;
}


.pool-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1000px;
  background: var(--panel-bg, rgba(16, 22, 36, 0.85));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  padding: 12px 18px;
  gap: 16px;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .pool-controls-bar {
    flex-direction: column;
    gap: 12px;
  }
}


.pool-aim-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pool-fine-aim-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.pool-fine-aim-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: rgba(0, 240, 255, 0.4);
  color: #00f0ff;
}

.pool-fine-aim-btn:active {
  transform: scale(0.96);
}


.pool-power-control {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 480px;
}

.pool-power-label {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 1px;
}

.pool-power-slider-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.pool-power-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 60%, #ef4444 100%);
  outline: none;
  cursor: pointer;
  transition: opacity 0.2s;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.pool-power-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #00f0ff;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
  transition: transform 0.1s;
}

.pool-power-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.pool-power-val {
  font-family: var(--font-mono, monospace);
  font-size: 14px;
  font-weight: 800;
  color: #00f0ff;
  min-width: 42px;
  text-align: right;
}


.pool-shoot-btn {
  background: linear-gradient(135deg, #00f0ff, #0080ff);
  color: #000000;
  font-family: var(--font-mono, monospace);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 1.5px;
  padding: 10px 22px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.35);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pool-shoot-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.55);
}

.pool-shoot-btn:active {
  transform: translateY(1px);
}

.pool-shoot-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}


.pool-spin-widget {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pool-spin-label {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 1px;
}

.pool-spin-ball {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #cbd5e1 60%, #64748b 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset -2px -2px 5px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  touch-action: none;
}

.pool-spin-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  border: 1px solid #ffffff;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 5px rgba(239, 68, 68, 0.8);
  transition: transform 0.05s ease-out;
}


.online-reaction-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 1000px;
  padding: 8px 16px;
  background: rgba(16, 22, 36, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.reaction-label {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #94a3b8;
}

.reaction-emojis {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reaction-emoji-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 18px;
  padding: 4px 8px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.reaction-emoji-btn:hover {
  transform: scale(1.2);
  background: rgba(255, 255, 255, 0.15);
}

.floating-reactions-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 100;
}

.floating-emoji-item {
  position: absolute;
  font-size: 32px;
  animation: floatUpAndFade 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}

@keyframes floatUpAndFade {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.5);
  }
  20% {
    opacity: 1;
    transform: translateY(0px) scale(1.2);
  }
  70% {
    opacity: 1;
    transform: translateY(-80px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-140px) scale(0.8);
  }
}


.online-rematch-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1000px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(0, 128, 255, 0.15));
  border: 1px solid rgba(0, 240, 255, 0.4);
  padding: 10px 18px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.2);
  animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.rematch-text {
  font-weight: 700;
  font-size: 14px;
  color: #00f0ff;
}

.rematch-actions {
  display: flex;
  gap: 10px;
}

.rematch-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.rematch-btn.accept {
  background: #10b981;
  color: #fff;
}

.rematch-btn.decline {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.rematch-btn:hover {
  transform: translateY(-1px);
}


.screen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.screen-overlay.hidden {
  display: none;
}

.arcade-overlay-panel {
  background: var(--bg-surface, #0f172a);
  border: 1px solid var(--panel-border, rgba(255, 255, 255, 0.15));
  border-radius: 20px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 240, 255, 0.2);
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.multiplayer-modal-panel {
  max-width: 520px;
  text-align: left;
}

.multiplayer-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-close-icon {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.modal-close-icon:hover {
  color: #ffffff;
}


.multiplayer-tab-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.multiplayer-tab-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.multiplayer-tab-btn.active {
  background: rgba(0, 240, 255, 0.15);
  color: #00f0ff;
}

.room-code-display-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed rgba(0, 240, 255, 0.4);
  padding: 16px;
  border-radius: 12px;
  margin: 16px 0;
}

.room-code-chars {
  font-family: var(--font-mono, monospace);
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 8px;
  color: #00f0ff;
  text-shadow: 0 0 15px rgba(0, 240, 255, 0.6);
}

.qr-code-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
}

#host-qr-canvas {
  border-radius: 10px;
  background: #0b0f19;
  padding: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.qr-code-hint {
  font-size: 12px;
  color: #94a3b8;
}

.join-url-box {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.join-url-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  padding: 8px 12px;
  border-radius: 8px;
}

.copy-url-btn {
  background: rgba(0, 240, 255, 0.15);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.3);
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.copy-url-btn:hover {
  background: rgba(0, 240, 255, 0.25);
}

.join-input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.join-code-input {
  font-family: var(--font-mono, monospace);
  font-size: 28px;
  text-align: center;
  letter-spacing: 6px;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 12px;
  border-radius: 10px;
}

.join-code-input:focus {
  outline: none;
  border-color: #00f0ff;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.join-submit-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

.join-error-message {
  color: #ef4444;
  font-size: 13px;
  margin-top: 8px;
  text-align: center;
}


.public-rooms-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 12px;
}

.public-room-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.public-room-host {
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
}

.public-room-code {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: #00f0ff;
}

.public-room-join-btn {
  background: #10b981;
  color: #ffffff;
  border: none;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.public-room-join-btn:hover {
  background: #059669;
}


.pool-log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.pool-log-item {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
}

.pool-log-item.foul {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.pool-log-item.pot {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.pool-log-item.win {
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.1);
  font-weight: 700;
}

.pool-call-panel{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:13px 16px;background:#122439;border:1px solid #2c4660;border-radius:12px;margin:12px 0;color:#e6f3ff;font-size:12px}.pool-call-panel label{display:flex;align-items:center;gap:7px}.pool-call-panel select{background:#0b1727;color:#e4f0fc;border:1px solid #3d5b73;border-radius:7px;padding:7px;max-width:150px}.pool-call-panel p{width:100%;margin:0;color:#a7c3d9;font-size:11px}.pool-rule-decision{background:#19273c;border:1px solid #e6c174;border-radius:12px;padding:18px;margin:12px 0;color:#eef4ff}.pool-rule-decision button{padding:9px 12px;border:1px solid #678091;background:#24465a;color:#fff;border-radius:7px;margin:5px;cursor:pointer}.pool-rule-decision[hidden]{display:none}.pool-call-panel input[type=checkbox]{accent-color:#7be2bc}


.pool-shell:fullscreen,
.pool-shell.pseudo-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  border-radius: 0 !important;
  border: 0 !important;
  z-index: 999999 !important;
  margin: 0 !important;
  max-width: none !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  background: #080d1a !important;
}

.pool-shell:fullscreen .pool-viewport,
.pool-shell.pseudo-fullscreen .pool-viewport {
  flex: 1 !important;
  min-height: 0 !important;
  height: 100% !important;
  max-width: none !important;
  padding: 8px !important;
  gap: 12px !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.pool-shell:fullscreen .pool-main-arena,
.pool-shell.pseudo-fullscreen .pool-main-arena {
  flex: 1 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  overflow: hidden !important;
}

.pool-shell:fullscreen .pool-scoreboard-hud,
.pool-shell.pseudo-fullscreen .pool-scoreboard-hud {
  padding: 8px 16px !important;
  margin-bottom: 6px !important;
  max-width: 900px !important;
  flex-shrink: 0 !important;
}

.pool-shell:fullscreen .pool-arena-table-row,
.pool-shell.pseudo-fullscreen .pool-arena-table-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  max-height: calc(100dvh - 240px) !important;
  width: auto !important;
  max-width: 100% !important;
  margin: auto !important;
  gap: 10px !important;
}

.pool-shell:fullscreen .pool-table-frame,
.pool-shell.pseudo-fullscreen .pool-table-frame {
  max-height: calc(100dvh - 240px) !important;
  width: min(calc((100dvh - 240px) * 2), calc(100vw - 90px)) !important;
  height: min(calc(100dvh - 240px), calc((100vw - 90px) / 2)) !important;
  aspect-ratio: 2 / 1 !important;
  max-width: calc(100vw - 90px) !important;
  padding: 10px !important;
  margin: 0 auto !important;
}

.pool-shell:fullscreen .miniclip-cue-power-meter,
.pool-shell.pseudo-fullscreen .miniclip-cue-power-meter {
  height: min(calc(100dvh - 240px), calc((100vw - 90px) / 2)) !important;
  max-height: 100% !important;
}

.pool-shell:fullscreen .pool-call-panel,
.pool-shell.pseudo-fullscreen .pool-call-panel {
  padding: 6px 14px !important;
  margin: 4px auto 0 !important;
  font-size: 11px !important;
  max-width: 700px !important;
  flex-shrink: 0 !important;
}

.pool-shell:fullscreen .settings-sidebar,
.pool-shell.pseudo-fullscreen .settings-sidebar,
.pool-shell:fullscreen .pool-gameplay-sidebar,
.pool-shell.pseudo-fullscreen .pool-gameplay-sidebar {
  display: none !important;
}

.pool-shell:fullscreen .settings-sidebar.mobile-open,
.pool-shell.pseudo-fullscreen .settings-sidebar.mobile-open {
  display: flex !important;
  position: fixed !important;
  top: 60px !important;
  left: 0 !important;
  z-index: 1000000 !important;
}


@media (max-width: 900px) {
  .pool-power-control,
  .pool-shoot-btn {
    display: none;
  }
}
@media (max-width: 900px) {
  .pool-arena-container{gap:6px; min-width:0}
  .pool-arena-table-row{display:flex!important;flex-direction:row!important;align-items:center!important;gap:6px!important;width:100%!important;max-width:100%!important;min-width:0!important}
  .pool-table-frame{flex:1 1 auto!important;min-width:0!important;width:auto!important;max-width:calc(100% - 48px)!important;padding:5px!important;border-width:2px!important;border-radius:12px!important}
  .pool-canvas-container{width:100%;min-width:0}
  .pool-canvas-container canvas{display:block;width:100%;height:auto;touch-action:none}
  .miniclip-cue-power-meter{display:flex!important;flex:0 0 42px!important;width:42px!important;min-width:42px!important;height:auto!important;min-height:120px!important;align-self:stretch!important;padding:7px 3px!important}
  .cue-power-track{min-height:70px}
  .pool-match-hud{padding:5px 7px!important;gap:3px!important;min-width:0!important}
  .pool-call-panel{padding:5px 7px!important;margin:3px 0!important;gap:5px!important}
  .pool-controls-bar{padding:5px!important;gap:5px!important}
  .pool-controls-bar .pool-power-control,.pool-controls-bar .pool-shoot-btn{display:none!important}
  .pool-shell:fullscreen .pool-arena-table-row,.pool-shell.pseudo-fullscreen .pool-arena-table-row{width:100%!important;max-height:none!important;max-width:100%!important;gap:6px!important;margin:0 auto!important}
  .pool-shell:fullscreen .pool-table-frame,.pool-shell.pseudo-fullscreen .pool-table-frame{flex:1 1 auto!important;width:auto!important;height:auto!important;max-width:calc(100% - 48px)!important;max-height:none!important;aspect-ratio:auto!important;padding:4px!important;margin:0!important}
  .pool-shell:fullscreen .miniclip-cue-power-meter,.pool-shell.pseudo-fullscreen .miniclip-cue-power-meter{height:auto!important;min-height:125px!important;max-height:none!important}
  .pool-shell:fullscreen .pool-call-panel,.pool-shell.pseudo-fullscreen .pool-call-panel{max-width:100%!important;padding:5px!important;font-size:10px!important}
  .pool-shell:fullscreen .pool-main-arena,.pool-shell.pseudo-fullscreen .pool-main-arena{justify-content:flex-start!important;overflow-y:auto!important}
}
@media (max-width: 600px) {
  .pool-match-hud .pool-balls-rack{display:none}
  .miniclip-cue-power-meter{flex-basis:38px!important;width:38px!important;min-width:38px!important}
  .pool-table-frame{max-width:calc(100% - 44px)!important}
}
.pool-call-panel, .pool-shell:fullscreen .pool-call-panel, .pool-shell.pseudo-fullscreen .pool-call-panel { display:none!important; }
