/* =============================================
   TANK 123 - NES Battle City Authentic UI
   ============================================= */

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* NES-style font import fallback */
@font-face {
  font-family: 'NES';
  src: local('Press Start 2P'), local('Courier New');
}

body {
  margin: 0;
  background: #000;
  color: #fff;
  font-family: 'Courier New', 'Lucida Console', monospace;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
}

/* Game Container */
#gameContainer {
  position: relative;
  width: 1024px;
  height: 896px;
}

/* Canvas */
canvas {
  display: block;
  background: #000;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ===== Screen Overlays ===== */
.screen {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  z-index: 10;
}

.screen.hidden { display: none; }

.screen-content {
  text-align: center;
  max-width: 90%;
}

/* ===== TITLE SCREEN (NES Battle City style) ===== */
.title-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  overflow: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  width: 100%;
  height: 100%;
}
.title-content::-webkit-scrollbar { display: none; }

/* Scroll group for slide-up intro */
.title-scroll-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 120px;
}

/* Slide-up intro animation (like original NES Battle City) */
.title-slide-intro {
  animation: titleSlideUp 3s ease-out forwards;
}

/* Instant skip (when user presses a key) */
.title-slide-skip {
  transform: translateY(0) !important;
  animation: none !important;
}

@keyframes titleSlideUp {
  0% { transform: translateY(100%); }
  100% { transform: translateY(0); }
}

/* Brick letter lines */
.title-brick-line {
  display: flex;
  justify-content: center;
}

.title-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  margin-left: 60px;
}

.title-cursor {
  position: absolute;
  left: 4px;
  top: 0;
  z-index: 2;
  transition: top 0.08s ease-out;
}

.title-cursor svg {
  display: block;
}

.title-menu-item {
  font-size: 22px;
  color: #FFF;
  letter-spacing: 4px;
  padding: 12px 0 12px 10px;
  cursor: pointer;
  user-select: none;
  transition: color 0.1s;
}

.title-menu-item:hover {
  color: #FCE4A8;
}

.title-menu-item.selected {
  color: #FCE4A8;
}

.title-stage-select {
  margin-top: 8px;
}

.title-stage-num {
  color: #FC9838;
  min-width: 24px;
  display: inline-block;
  text-align: center;
}

@keyframes nesBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Title screen name input */
.title-name-section {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.title-name-label {
  font-size: 18px;
  color: #FFF;
  letter-spacing: 4px;
}

.title-name-input {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  padding: 8px 12px;
  background: #1a1a1a;
  color: #FCE4A8;
  border: 2px solid #636363;
  text-align: center;
  width: 220px;
  letter-spacing: 3px;
  outline: none;
}

.title-name-input::placeholder {
  color: #444;
}

.title-name-input:focus {
  border-color: #FCE4A8;
}

.title-name-error {
  font-size: 12px;
  color: #B53120;
  letter-spacing: 2px;
  min-height: 16px;
  width: 100%;
  text-align: center;
}

/* Mode selector */
.title-mode-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.title-mode-label {
  font-size: 14px;
  color: #636363;
  letter-spacing: 4px;
}

.title-mode-options {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding-left: 36px;
}

/* PLAY GAME button */
.title-play-btn {
  font-family: 'Courier New', monospace;
  font-size: 20px;
  font-weight: bold;
  color: #000;
  background: #FCE4A8;
  padding: 12px 40px;
  letter-spacing: 4px;
  cursor: pointer;
  text-align: center;
  transition: background 0.1s, color 0.1s;
  user-select: none;
}

.title-play-btn:hover {
  background: #FC9838;
  color: #000;
}

.title-play-btn:active {
  background: #B53120;
  color: #FFF;
}

.title-copyright {
  margin-top: 30px;
  font-size: 11px;
  color: #636363;
  letter-spacing: 2px;
}

/* ===== LOBBY SCREEN ===== */
.screen-title {
  font-size: 28px;
  color: #FCE4A8;
  margin-bottom: 30px;
  letter-spacing: 4px;
}

.lobby-section {
  margin-bottom: 30px;
}

.lobby-section label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  color: #BCBCBC;
}

.lobby-section input,
#roomIdInput {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  padding: 10px;
  background: #1a1a1a;
  color: #FCE4A8;
  border: 2px solid #636363;
  text-align: center;
  width: 300px;
}

.lobby-section input:focus,
#roomIdInput:focus {
  outline: none;
  border-color: #FCE4A8;
}

/* Lobby mode selection */
.lobby-mode-select {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
}

.lobby-mode-btn {
  width: 300px;
  font-size: 16px !important;
  padding: 14px 20px !important;
  letter-spacing: 4px !important;
}

#btnPlayOnline {
  background: #B53120 !important;
  color: #FFF !important;
  border-color: #B53120 !important;
}

#btnPlayOnline:hover {
  background: #D04030 !important;
}

/* Searching panel */
#searchingPanel {
  text-align: center;
  margin: 30px 0;
}

.searching-status {
  margin-bottom: 20px;
}

.searching-text {
  font-size: 18px;
  color: #FCE4A8;
  letter-spacing: 4px;
}

.searching-dots::after {
  content: '';
  animation: searchDots 1.5s steps(4, end) infinite;
}

@keyframes searchDots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

.timeout-text {
  color: #B53120;
}

.timeout-hint {
  color: #999;
  font-size: 12px;
  margin-top: 10px;
}

.searching-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.lobby-back-btn {
  margin-top: 20px;
}

.lobby-panels {
  display: flex;
  gap: 30px;
  justify-content: center;
  margin: 30px 0;
}

.lobby-panel {
  background: #111;
  border: 2px solid #636363;
  padding: 25px;
  min-width: 300px;
}

.lobby-panel h3 {
  color: #FCE4A8;
  margin-bottom: 20px;
  font-size: 18px;
  letter-spacing: 2px;
}

/* Buttons (NES style) */
.action-button {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  padding: 10px 20px;
  background: #000;
  color: #FCE4A8;
  border: 2px solid #FCE4A8;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 5px;
  transition: background 0.1s;
}

.action-button:hover {
  background: #333;
}

.action-button.primary {
  background: #B53120;
  color: #FFF;
  border-color: #B53120;
}

.action-button.primary:hover {
  background: #D04030;
}

.action-button.secondary {
  border-color: #636363;
  color: #636363;
}

.action-button.secondary:hover {
  color: #BCBCBC;
  border-color: #BCBCBC;
}

.action-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.room-code-display { margin: 20px 0; }
.room-code-display label { display: block; margin-bottom: 8px; color: #636363; font-size: 14px; }

.room-code {
  font-size: 28px;
  font-weight: bold;
  color: #FC9838;
  letter-spacing: 8px;
  background: #111;
  padding: 12px;
  border: 2px solid #FC9838;
  display: inline-block;
}

.waiting-status {
  margin-top: 15px;
  color: #636363;
  font-style: italic;
}

#roomDetails {
  margin-top: 30px;
  background: #111;
  border: 2px solid #636363;
  padding: 25px;
}

#roomDetails h3 {
  color: #FCE4A8;
  margin-bottom: 15px;
  font-size: 18px;
}

.player-list {
  list-style: none;
  margin-bottom: 20px;
  text-align: left;
}

.player-list li {
  padding: 10px;
  margin: 5px 0;
  background: #0a0a0a;
  border-left: 3px solid #636363;
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-list li.ready { border-left-color: #00A800; }
.player-list li.host::before { content: "\2605"; color: #FC9838; font-size: 16px; }

.ready-indicator {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #636363;
  margin-left: auto;
}

.player-list li.ready .ready-indicator { background: #00A800; }

.lobby-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.error-message {
  color: #B53120;
  background: rgba(181, 49, 32, 0.1);
  border: 2px solid #B53120;
  padding: 15px;
  margin-top: 20px;
  font-size: 13px;
}

.error-message.success {
  color: #63B365;
  background: rgba(99, 179, 101, 0.1);
  border-color: #63B365;
}

/* ===== STAGE SCREEN (NES: gray bg, white text) ===== */
#stageScreen {
  background: #636363;
}

.stage-text {
  font-size: 48px;
  font-weight: bold;
  color: #000;
  letter-spacing: 8px;
}

/* ===== SCORE SCREEN (NES Battle City authentic) ===== */
#scoreScreen {
  background: #000;
}

/* NES Score Tally shared classes (ScoreScreen + GameOverScreen) */
.nes-sc-table {
  margin: 6px auto;
  font-size: 14px;
  max-width: 520px;
  width: 100%;
}

.nes-sc-row {
  padding: 2px 0;
}

.nes-sc-center {
  text-align: center;
}

.nes-sc-hiscore-label {
  color: #B53120;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 3px;
}

.nes-sc-hiscore-val {
  color: #FC9838;
  font-size: 20px;
  font-weight: bold;
}

.nes-sc-stage {
  margin: 8px 0 12px;
}

.nes-sc-white { color: #FFF; }
.nes-sc-p1 { color: #B53120; font-weight: bold; letter-spacing: 2px; }
.nes-sc-p2 { color: #39B54A; font-weight: bold; letter-spacing: 2px; }
.nes-sc-orange { color: #FC9838; font-size: 18px; font-weight: bold; }

.nes-sc-2p-header {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-bottom: 8px;
}

.nes-sc-p-col {
  text-align: center;
}

.nes-sc-enemy-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 0;
  gap: 4px;
  transition: opacity 0.3s;
  font-size: 14px;
}

.sc-row-appear {
  animation: nesSlideIn 0.2s ease-out;
}

@keyframes nesSlideIn {
  from { transform: translateY(6px); }
  to { transform: translateY(0); }
}

.nes-sc-pts {
  font-weight: bold;
  min-width: 48px;
  text-align: right;
}

.nes-sc-kills {
  font-weight: bold;
  min-width: 24px;
  text-align: center;
  font-size: 16px;
}

.nes-sc-arrow {
  font-size: 10px;
}

.nes-sc-tank-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
}

.nes-sc-tank-icon {
  width: 30px;
  height: 26px;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.nes-sc-sep {
  height: 2px;
  background: #FFF;
  margin: 6px 40px;
  transition: opacity 0.3s;
}

.nes-sc-total-num {
  font-size: 18px;
  font-weight: bold;
  min-width: 30px;
  text-align: center;
}

.nes-sc-total-spacer {
  display: inline-block;
  width: 80px;
}

/* ===== GAME OVER SCREEN (NES style) ===== */
#gameOverScreen {
  background: #000;
}

/* Game Over screen now reuses .sc-* score tally classes */
.go-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 20px;
}

.go-bottom-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 16px;
  transition: opacity 0.3s ease-in;
}

.go-title-small {
  font-size: 28px;
  font-weight: bold;
  color: #B53120;
  letter-spacing: 6px;
  margin-bottom: 6px;
  text-align: center;
}

.go-reason-small {
  font-size: 12px;
  font-weight: bold;
  color: #FC9838;
  letter-spacing: 3px;
  margin-bottom: 12px;
  text-align: center;
}


/* ===== LEADERBOARD SCREEN (Arcade Hall of Fame) ===== */
#leaderboardScreen {
  background: #000;
}

.lb-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.lb-header {
  font-size: 32px;
  font-weight: bold;
  color: #FCE4A8;
  letter-spacing: 6px;
  margin-bottom: 4px;
}

.lb-trophy {
  color: #FC9838;
}

.lb-subtitle {
  font-size: 12px;
  color: #636363;
  letter-spacing: 6px;
  margin-bottom: 16px;
}

/* Tab switcher */
.lb-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.lb-tab {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 3px;
  padding: 8px 24px;
  background: transparent;
  color: #636363;
  border: 2px solid #636363;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.lb-tab:hover {
  color: #BCBCBC;
  border-color: #BCBCBC;
}

.lb-tab-active {
  color: #FCE4A8;
  border-color: #FCE4A8;
  background: rgba(252, 228, 168, 0.08);
}

.lb-tab-active:hover {
  color: #FCE4A8;
  border-color: #FCE4A8;
}

.lb-sep {
  width: 340px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #636363, #FCE4A8, #636363, transparent);
  margin-bottom: 16px;
}

.lb-table-header {
  display: flex;
  width: 340px;
  padding: 4px 0;
  margin-bottom: 4px;
  border-bottom: 1px solid #636363;
}

.lb-table-header span {
  font-size: 10px;
  color: #636363;
  letter-spacing: 1px;
  font-weight: bold;
}

.lb-list {
  width: 340px;
  min-height: 260px;
}

.lb-loading, .lb-empty {
  text-align: center;
  color: #636363;
  font-size: 13px;
  letter-spacing: 2px;
  padding: 40px 0;
}

.lb-row {
  display: flex;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid #1a1a1a;
  animation: lbFadeIn 0.3s ease-out both;
}

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

.lb-col-rank {
  width: 36px;
  font-size: 14px;
  font-weight: bold;
  color: #636363;
  text-align: center;
}

.lb-col-name {
  flex: 1;
  font-size: 14px;
  color: #FFF;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
}


.lb-col-stage {
  width: 36px;
  font-size: 13px;
  color: #636363;
  text-align: center;
}

.lb-col-score {
  width: 80px;
  font-size: 14px;
  font-weight: bold;
  color: #FFF;
  text-align: right;
}

/* Rank colors */
.lb-gold { color: #FCE4A8; }
.lb-silver { color: #BCBCBC; }
.lb-bronze { color: #FC9838; }

/* Highlight current player's row */
.lb-row-you {
  background: rgba(252, 228, 168, 0.08);
  border-bottom-color: #333;
}

.lb-row-you .lb-col-name {
  color: #FCE4A8;
}

.lb-row-you .lb-col-score {
  color: #FCE4A8;
}

.lb-row-you .lb-col-rank {
  color: #B53120;
}

/* Your score display */
.lb-your-score {
  margin-top: 20px;
  font-size: 14px;
  color: #636363;
  letter-spacing: 2px;
}

.lb-your-pts {
  color: #FC9838;
  font-weight: bold;
}

.lb-continue-hint {
  margin-top: 24px;
  font-size: 13px;
  color: #636363;
  letter-spacing: 3px;
  animation: nesBlink 1s step-end infinite;
}

.go-continue-hint {
  margin-top: 40px;
  font-size: 13px;
  color: #636363;
  letter-spacing: 3px;
  animation: nesBlink 1s step-end infinite;
}

/* ===== Curtain Transition Overlay ===== */
#curtainOverlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 50;
}

.curtain-panel {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  background: #636363;
  transition: transform 500ms ease-in-out;
}

#curtainTop {
  top: 0;
  transform: translateY(-100%);
}

#curtainBottom {
  bottom: 0;
  transform: translateY(100%);
}

#curtainTop.curtain-closed {
  transform: translateY(0);
}

#curtainBottom.curtain-closed {
  transform: translateY(0);
}

.curtain-hidden {
  visibility: hidden;
}

/* ===== In-Game Toast Notification ===== */
.game-toast {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 24px;
  font-size: 14px;
  font-family: 'Press Start 2P', 'Courier New', monospace;
  letter-spacing: 2px;
  color: #FCE4A8;
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid #FCE4A8;
  z-index: 10;
  pointer-events: none;
  white-space: nowrap;
  animation: toastFadeIn 0.3s ease-out;
}

.game-toast.toast-warn {
  color: #B53120;
  border-color: #B53120;
}

.game-toast.toast-success {
  color: #63B365;
  border-color: #63B365;
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== In-Game GAME OVER Slide-Up ===== */
.game-over-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  z-index: 5;
}

.game-over-slide-text {
  font-size: 48px;
  font-weight: bold;
  color: #B53120;
  letter-spacing: 8px;
  font-family: 'Courier New', 'Lucida Console', monospace;
  transform: translateY(500px);
  transition: transform 2s ease-out;
}

.game-over-slide-text.slide-up {
  transform: translateY(0);
}

/* ===== Stage Screen Player Lives ===== */
.stage-players-info {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 60px;
}

.stage-player-lives {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #000;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 2px;
}

.stage-player-lives .player-label {
  color: #000;
}

.stage-player-lives .player-label.p1 {
  color: #B53120;
}

.stage-player-lives .player-label.p2 {
  color: #006800;
}

.stage-tank-icon {
  display: inline-block;
  vertical-align: middle;
}

.stage-lives-count {
  color: #000;
  font-size: 20px;
}

/* ===== Utility ===== */
.hidden { display: none !important; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  #gameContainer {
    transform: scale(0.8);
    transform-origin: center;
  }
}

@media (max-width: 768px) {
  #gameContainer {
    transform: scale(0.6);
    transform-origin: center;
  }
  .lobby-panels { flex-direction: column; }
}

/* ===== Mobile Touch Controls ===== */
#touchControls {
  width: 100%;
  max-width: 500px;
  height: 200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  flex-shrink: 0;
  touch-action: none;
}

/* --- Virtual joystick --- */
.joystick-base {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
  touch-action: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.joystick-knob {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.4);
  pointer-events: none;
  will-change: transform;
}

/* --- Shared touch button --- */
.touch-btn {
  position: relative;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  line-height: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.touch-btn.active {
  background: rgba(181, 49, 32, 0.5);
  border-color: #B53120;
  color: #fff;
}

/* --- Fire button --- */
.touch-fire {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 2px;
  border: 3px solid rgba(181, 49, 32, 0.5);
  background: rgba(181, 49, 32, 0.2);
  color: rgba(255, 255, 255, 0.85);
}

.touch-fire.active {
  background: rgba(181, 49, 32, 0.6);
  border-color: #B53120;
  color: #fff;
}

/* Mobile portrait */
body.mobile-mode {
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

body.mobile-mode #gameContainer { flex-shrink: 0; }
body.mobile-mode #touchControls { margin-top: auto; flex-shrink: 0; }

body.mobile-mode > .screen,
body.mobile-landscape > .screen {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  height: 100dvh;
  z-index: 100;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.mobile-mode > .screen .title-brick-line svg,
body.mobile-landscape > .screen .title-brick-line svg {
  transform: scale(0.6);
  transform-origin: center;
}

body.mobile-mode > .screen .title-menu-item,
body.mobile-landscape > .screen .title-menu-item {
  font-size: 16px;
  padding: 10px 0 10px 8px;
}

body.mobile-mode > .screen .stage-text,
body.mobile-landscape > .screen .stage-text {
  font-size: 36px;
}

body.mobile-mode > .screen .gameover-text,
body.mobile-landscape > .screen .gameover-text {
  font-size: 32px;
}

body.mobile-mode > .screen,
body.mobile-landscape > .screen {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-items: flex-start;
  justify-content: flex-start;
}

body.mobile-mode > .screen .screen-content,
body.mobile-landscape > .screen .screen-content {
  max-width: 95%;
  padding: 30px 10px calc(120px + env(safe-area-inset-bottom, 0px));
  margin: 0 auto;
}

body.mobile-mode > .screen .screen-title,
body.mobile-landscape > .screen .screen-title {
  font-size: 20px;
  margin-bottom: 15px;
}

body.mobile-mode > .screen .lobby-panels,
body.mobile-landscape > .screen .lobby-panels {
  flex-direction: column;
  gap: 15px;
}

body.mobile-mode > .screen .lobby-panel,
body.mobile-landscape > .screen .lobby-panel {
  min-width: auto;
  padding: 15px;
}

body.mobile-mode > .screen .lobby-section input,
body.mobile-mode > .screen #roomIdInput,
body.mobile-landscape > .screen .lobby-section input,
body.mobile-landscape > .screen #roomIdInput {
  width: 100%;
  max-width: 280px;
}

body.mobile-mode > .screen .action-button,
body.mobile-landscape > .screen .action-button {
  font-size: 12px;
  padding: 8px 16px;
}

body.mobile-mode > .screen .title-name-input,
body.mobile-landscape > .screen .title-name-input {
  width: 180px;
  font-size: 16px;
}

body.mobile-mode > .screen .lb-list,
body.mobile-landscape > .screen .lb-list {
  width: 280px;
}

/* Landscape */
body.mobile-landscape {
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

body.mobile-landscape #touchControls {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  height: 100%;
  max-width: none;
  margin-top: 0;
  padding: 0 12px;
  pointer-events: none;
  z-index: 50;
}

body.mobile-landscape .joystick-base,
body.mobile-landscape .touch-fire {
  pointer-events: auto;
}

body.mobile-landscape #gameContainer {
  transform-origin: center center;
}
