* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0b0e14;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Courier New", monospace;
  touch-action: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #0b0e14;
}

#game-canvas {
  display: block;
  background-color: #0b0e14;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.15);
}

/* Floating Toolbar */
#top-toolbar {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.arcade-btn {
  background: rgba(22, 28, 46, 0.85);
  border: 1.5px solid #00f0ff;
  color: #00f0ff;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: bold;
  font-family: monospace;
  border-radius: 4px;
  cursor: pointer;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.6);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
  transition: all 0.15s ease;
}

.arcade-btn:hover {
  background: #00f0ff;
  color: #0b0e14;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.6);
}

.arcade-btn:active {
  transform: scale(0.95);
}

/* Game Over Floating Action Bar */
#gameover-actions {
  position: absolute;
  bottom: 30px;
  display: flex;
  gap: 12px;
  z-index: 15;
}

.action-share {
  border-color: #05ffa1;
  color: #05ffa1;
  box-shadow: 0 0 10px rgba(5, 255, 161, 0.3);
}

.action-share:hover {
  background: #05ffa1;
  color: #0b0e14;
}

.action-top {
  border-color: #ffd13b;
  color: #ffd13b;
  box-shadow: 0 0 10px rgba(255, 209, 59, 0.3);
}

.action-top:hover {
  background: #ffd13b;
  color: #0b0e14;
}

/* Modal Overlay */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 16px;
}

.modal-card {
  background: #161c2e;
  border: 2px solid #2e3856;
  border-radius: 8px;
  width: 100%;
  max-width: 360px;
  padding: 18px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 240, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #2e3856;
  padding-bottom: 8px;
}

.modal-header h2 {
  font-size: 16px;
  color: #ffd13b;
  font-family: monospace;
  font-weight: 900;
  letter-spacing: 1px;
}

.close-btn {
  background: transparent;
  border: none;
  color: #a6b0cf;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: #ff3b5c;
}

/* Submit Form */
.submit-box {
  background: #1c2338;
  border: 1px solid #00f0ff;
  border-radius: 6px;
  padding: 10px;
}

.submit-info {
  font-size: 12px;
  font-family: monospace;
  color: #00f0ff;
  margin-bottom: 8px;
  text-align: center;
}

.submit-form {
  display: flex;
  gap: 8px;
}

.submit-form input {
  flex: 1;
  background: #0b0e14;
  border: 1.5px solid #2e3856;
  border-radius: 4px;
  color: #ffd13b;
  font-size: 18px;
  font-weight: 900;
  font-family: monospace;
  text-align: center;
  text-transform: uppercase;
  padding: 6px;
  outline: none;
}

.submit-form input:focus {
  border-color: #ffd13b;
}

.arcade-btn-submit {
  background: #ffd13b;
  border: none;
  color: #0b0e14;
  font-weight: 900;
  font-family: monospace;
  font-size: 13px;
  padding: 0 14px;
  border-radius: 4px;
  cursor: pointer;
}

.arcade-btn-submit:hover {
  background: #fff;
}

/* Tabs */
.modal-tabs {
  display: flex;
  gap: 8px;
}

.tab-btn {
  flex: 1;
  background: #1a1f36;
  border: 1px solid #2e3856;
  color: #a6b0cf;
  padding: 7px;
  font-size: 12px;
  font-weight: bold;
  font-family: monospace;
  cursor: pointer;
  border-radius: 4px;
}

.tab-btn.active {
  background: #00f0ff;
  color: #0b0e14;
  border-color: #00f0ff;
  font-weight: 900;
}

/* Table */
.table-container {
  max-height: 220px;
  overflow-y: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: monospace;
  text-align: center;
}

.leaderboard-table th {
  color: #7d8aa8;
  padding: 6px;
  font-size: 11px;
  border-bottom: 1px solid #2e3856;
}

.leaderboard-table td {
  padding: 7px 4px;
  border-bottom: 1px solid #1a2033;
}

.player-tag {
  color: #ffd13b;
  font-weight: bold;
}

.player-score {
  color: #ffffff;
  font-weight: 900;
  font-size: 14px;
}

.player-date {
  color: #627196;
  font-size: 11px;
}

.top-1 td { color: #ffd13b; }
.top-2 td { color: #e2e8f0; }
.top-3 td { color: #cd7f32; }

/* Toast */
.toast {
  position: absolute;
  top: 70px;
  background: #05ffa1;
  color: #0b0e14;
  font-weight: bold;
  font-family: monospace;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  box-shadow: 0 0 15px rgba(5, 255, 161, 0.5);
  z-index: 200;
  transition: opacity 0.3s ease;
}

.hidden {
  display: none !important;
}
