:root {
  --bg-dark: #0d0f1a;
  --bg-panel: #1a1d33;
  --text: #e0e8ff;
  --muted: #a0a8c8;
  --accent-blue: #6fa8ff;
  --accent-pink: #ff7ac2;
  --accent-green: #6fe3a2;
  --accent-yellow: #ffd86b;
  --accent-red: #ff6f6f;
  --accent-purple: #b794f6;
  --accent-orange: #ffa94d;
  --accent-cyan: #5ce8f5;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: auto;
}

body {
  background: radial-gradient(circle at top, #1e2245, var(--bg-dark) 70%);
  color: var(--text);
  font-family:
    "Lexend",
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    sans-serif;
}

/* Header */
.app-header {
  padding: 16px 24px;
  border-bottom: 1px solid #303560;
  background: linear-gradient(180deg, #1a1d33 0%, var(--bg-dark) 100%);
}

.title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.help-btn {
  margin-left: 6px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #4a4f80;
  background: #2a2d4a;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.help-btn:hover {
  background: #38406c;
  transform: translateY(-1px);
}

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

.limit-badge,
.game-title {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent-green);
  line-height: 1;
  text-shadow: 0 0 6px #00ff88;
}

.hud {
  display: flex;
  gap: 16px;
  align-items: center;
}

.hud-item {
  background: var(--bg-panel);
  border: 1px solid #303560;
  border-radius: 12px;
  padding: 8px 14px;
  min-width: 140px;
  text-align: center;
  box-shadow: var(--shadow);
}

.hud-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.hud-value {
  font-family: "Space Mono", monospace;
  font-size: 26px;
  font-weight: 700;
  color: var(--accent-yellow);
}

.pause-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-panel);
  border: 2px solid #4a4f80;
  border-radius: 12px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.pause-btn:hover {
  border-color: var(--accent-blue);
  background: #1a1d33;
  transform: scale(1.05);
}

.pause-btn:active {
  transform: scale(0.98);
}

.pause-btn.paused {
  border-color: var(--accent-green);
  background: rgba(111, 227, 162, 0.15);
  box-shadow: 0 0 15px rgba(111, 227, 162, 0.3);
}

.pause-btn.paused .pause-icon::before {
  content: "▶️";
}

.pause-icon {
  font-size: 16px;
}

.pause-text {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 300px 1fr 320px;
  gap: 16px;
  padding: 16px;
  min-height: calc(100vh - 140px);
}

/* Left Panel */
.left-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.player-card {
  background: var(--bg-panel);
  border: 2px solid var(--accent-green);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 0 20px rgba(111, 227, 162, 0.4);
}

.player-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #4a4f80;
  background: #1a1d33;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.player-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.player-avatar-emoji {
  font-size: 40px;
}

.player-info {
  flex: 1;
}

.player-name {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 4px;
}

.player-level {
  font-size: 14px;
  color: var(--muted);
  font-family: "Space Mono", monospace;
}

.player-level span {
  color: var(--accent-yellow);
  font-weight: 700;
}

.player-status {
  margin-top: 12px;
  padding: 8px;
  background: #141938;
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-yellow);
}

/* Function Section */
.function-section {
  background: var(--bg-panel);
  border: 2px solid #303560;
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.function-section h3 {
  margin: 0 0 12px;
  color: var(--accent-orange);
  font-size: 16px;
  text-align: center;
}

.function-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 350px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.function-card {
  background: linear-gradient(135deg, #2a2d4a, #1a1d33);
  border: 2px solid #4a4f80;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.function-card:hover {
  transform: translateX(5px);
  border-color: var(--accent-blue);
}

.function-card.selected {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 20px rgba(255, 216, 107, 0.6);
  background: linear-gradient(135deg, #3a3d5a, #2a2d4a);
}

.function-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}

.function-formula {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  color: var(--accent-cyan);
}

/* Controls Info */
.controls-info {
  background: var(--bg-panel);
  border: 2px solid #303560;
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.controls-info h3 {
  margin: 0 0 12px;
  color: var(--accent-cyan);
  font-size: 16px;
  text-align: center;
}

.control-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: #141938;
  border-radius: 8px;
}

.control-key {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  color: var(--accent-yellow);
  background: #0d0f1a;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #4a4f80;
  min-width: 90px;
  text-align: center;
  font-size: 12px;
}

.control-desc {
  font-size: 14px;
  color: var(--text);
}

/* Game Area */
.game-area {
  background: var(--bg-panel);
  border: 2px solid #303560;
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.game-canvas {
  width: 100%;
  max-width: 1000px;
  height: auto;
  border: 3px solid #4a4f80;
  border-radius: 12px;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
  background: #0d0f1a;
}

.game-status {
  margin-top: 16px;
  padding: 12px 24px;
  background: #141938;
  border: 2px solid var(--accent-blue);
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--accent-yellow);
  text-align: center;
  max-width: 600px;
}

/* Countdown Overlay */
.countdown-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 15, 26, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 14px;
}

.countdown-number {
  font-size: 120px;
  font-weight: 900;
  color: var(--accent-yellow);
  text-shadow: 0 0 40px var(--accent-yellow);
  animation: countdown-pulse 1s ease-in-out;
}

@keyframes countdown-pulse {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Right Panel */
.right-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.action-btn {
  padding: 14px;
  border-radius: 10px;
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
  width: 100%;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
}

.action-btn.secondary {
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-red));
}

/* Stats Panel */
.stats-panel {
  background: var(--bg-panel);
  border: 2px solid #303560;
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.stats-panel h3 {
  margin: 0 0 12px;
  color: var(--accent-purple);
  font-size: 16px;
  text-align: center;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: #141938;
  border-radius: 8px;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--muted);
}

.stat-value {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 16px;
  color: var(--accent-yellow);
}

/* Game Log */
.game-log {
  background: var(--bg-panel);
  border: 1px solid #303560;
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-height: 250px;
  min-height: 150px;
}

.game-log h3 {
  margin: 0 0 12px;
  color: var(--accent-blue);
  font-size: 16px;
  text-align: center;
}

.log-content {
  flex: 1;
  overflow-y: auto;
  font-family: "Space Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
}

.log-entry {
  margin: 6px 0;
  padding: 4px 8px;
  border-left: 3px solid var(--accent-green);
  background: #141938;
  border-radius: 4px;
}

.log-entry.warning {
  border-left-color: var(--accent-orange);
}

.log-entry.error {
  border-left-color: var(--accent-red);
}

.log-entry.success {
  border-left-color: var(--accent-green);
}

/* Overlays */
.overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(13, 15, 26, 0.95);
  backdrop-filter: blur(8px);
  z-index: 100;
  overflow-y: auto;
  padding: 20px;
}

.overlay.visible {
  display: grid;
}

.overlay .card {
  background: var(--bg-dark);
  border: 2px solid #303560;
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
  color: var(--text);
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
}

.overlay .card h2 {
  margin: 0 0 16px;
  color: var(--accent-blue);
  font-size: 32px;
  text-align: center;
}

.overlay .card h3 {
  color: var(--accent-pink);
  font-size: 20px;
  margin: 16px 0 8px;
}

/* Instructions */
.instructions {
  width: min(1000px, 90vw);
}

.instructions-content {
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 10px;
  line-height: 1.6;
}

.instructions-content ul,
.instructions-content ol {
  padding-left: 24px;
}

.instructions-content li {
  margin: 6px 0;
}

.countdown {
  margin-top: 20px;
  text-align: center;
  color: var(--accent-yellow);
  font-family: "Space Mono", monospace;
  font-size: 18px;
  font-weight: 700;
}

/* Setup */
.setup {
  width: min(700px, 90vw);
}

.setup form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setup label {
  display: block;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.setup input {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  border-radius: 8px;
  background: #141938;
  color: var(--text);
  border: 2px solid #4a4f80;
  font-size: 16px;
  font-family: inherit;
}

.avatar-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.avatar-option {
  width: 100%;
  aspect-ratio: 1;
  font-size: 32px;
  border: 3px solid #4a4f80;
  border-radius: 12px;
  background: #141938;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.avatar-option:hover {
  border-color: var(--accent-blue);
  transform: scale(1.1);
}

.avatar-option.selected {
  border-color: var(--accent-green);
  background: linear-gradient(
    135deg,
    rgba(111, 227, 162, 0.2),
    rgba(81, 207, 102, 0.2)
  );
  box-shadow: 0 0 20px rgba(111, 227, 162, 0.4);
}

.level-selector-wrapper {
  position: relative;
  margin-top: 8px;
}

.level-selector-display {
  padding: 14px 18px;
  background: #141938;
  border: 2px solid #4a4f80;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}

.level-selector-display:hover {
  border-color: var(--accent-blue);
  background: #1a1d33;
}

.level-selector-wrapper.open .level-selector-display {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-color: var(--accent-green);
}

.level-arrow {
  color: var(--accent-blue);
  font-size: 12px;
  transition: transform 0.3s;
}

.level-selector-wrapper.open .level-arrow {
  transform: rotate(180deg);
}

.level-selector {
  list-style: none;
  padding: 0;
  margin: 0;
  background: #0d0f1a;
  border: 2px solid var(--accent-green);
  border-top: none;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  overflow: hidden;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  max-height: 0;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.level-selector-wrapper.open .level-selector {
  max-height: 400px;
  opacity: 1;
}

.level-option {
  padding: 14px 18px;
  border-bottom: 1px solid #2a2d4a;
  background: #141938;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}

.level-option:last-child {
  border-bottom: none;
}

.level-value {
  font-size: 16px;
  font-weight: 700;
  font-family: "Space Mono", monospace;
  color: var(--accent-yellow);
}

.level-desc {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.level-option:hover {
  background: #1a1d33;
  padding-left: 24px;
}

.level-option.selected {
  background: linear-gradient(
    90deg,
    rgba(111, 227, 162, 0.2),
    rgba(81, 207, 102, 0.1)
  );
  border-left: 4px solid var(--accent-green);
  padding-left: 14px;
}

.level-option.selected .level-value {
  color: var(--accent-green);
}

button.primary {
  width: 100%;
  background: linear-gradient(45deg, var(--accent-blue), var(--accent-pink));
  border: none;
  color: #fff;
  padding: 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s;
}

button.primary:hover {
  transform: scale(1.02);
}

button.primary:active {
  transform: scale(0.98);
}

/* Game Over */
.gameover {
  width: min(800px, 90vw);
  text-align: center;
}

.avatar-gasping {
  margin: 20px auto;
  width: 150px;
  height: 150px;
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  background: #1a1d33;
  border: 4px solid var(--accent-red);
  box-shadow: 0 0 30px rgba(255, 111, 111, 0.5);
}

.final-avatar {
  font-size: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  animation: gasp 1s ease-in-out infinite;
}

.final-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: gasp 1s ease-in-out infinite;
}

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

.slime-cover {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(
    to top,
    rgba(85, 107, 47, 0.95),
    rgba(154, 205, 50, 0.7),
    rgba(50, 205, 50, 0.3)
  );
  animation:
    slime-rise 2s ease-in-out infinite,
    slime-pulse 0.5s ease-in-out infinite;
  box-shadow: 0 -10px 30px rgba(50, 205, 50, 0.5);
}

.slime-cover::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: radial-gradient(
    circle,
    rgba(255, 250, 205, 0.9) 30%,
    rgba(50, 100, 50, 0.8) 50%,
    transparent 70%
  );
  border-radius: 50%;
  animation: eye-look 3s ease-in-out infinite;
}

.slime-cover::after {
  content: "";
  position: absolute;
  top: 5px;
  left: calc(50% - 2px);
  width: 8px;
  height: 8px;
  background: #000;
  border-radius: 50%;
  animation: pupil-dilate 1s ease-in-out infinite;
}

@keyframes slime-rise {
  0%,
  100% {
    height: 60%;
  }
  50% {
    height: 70%;
  }
}

@keyframes slime-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.85;
  }
}

@keyframes eye-look {
  0%,
  100% {
    left: 40%;
  }
  50% {
    left: 60%;
  }
}

@keyframes pupil-dilate {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
}

#gameOverMessage {
  font-size: 20px;
  margin: 20px 0;
  color: var(--accent-yellow);
  line-height: 1.6;
}

#leaderboardSection {
  margin: 24px 0;
  padding: 20px;
  background: #141938;
  border: 2px solid var(--accent-purple);
  border-radius: 12px;
}

#leaderboard {
  margin-top: 16px;
}

.leaderboard-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  margin: 8px 0;
  background: var(--bg-panel);
  border-radius: 8px;
  border-left: 4px solid var(--accent-blue);
}

.leaderboard-entry.current {
  border-left-color: var(--accent-yellow);
  background: linear-gradient(90deg, rgba(255, 216, 107, 0.2), var(--bg-panel));
}

.leaderboard-rank {
  font-size: 24px;
  font-weight: 900;
  color: var(--accent-yellow);
  min-width: 40px;
}

.leaderboard-name {
  flex: 1;
  font-weight: 700;
  text-align: left;
  margin-left: 16px;
}

.leaderboard-score {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 18px;
  color: var(--accent-green);
}

.gameover-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.gameover-actions button {
  flex: 1;
}

button.chip {
  background: #2a2d4a;
  border: 2px solid #4a4f80;
  color: #fff;
  padding: 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

button.chip:hover {
  background: #38406c;
  border-color: var(--accent-blue);
}

/* Function Editor */
.function-editor {
  width: min(700px, 90vw);
  position: relative;
}

.function-editor-content {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 10px;
}

.param-editors {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

.param-editor {
  background: #141938;
  border: 2px solid #4a4f80;
  border-radius: 10px;
  padding: 16px;
}

.param-editor label {
  display: block;
  color: var(--accent-cyan);
  font-weight: 700;
  margin-bottom: 12px;
  font-size: 16px;
}

.param-editor input[type="range"] {
  width: 100%;
  margin-bottom: 8px;
  height: 8px;
  border-radius: 4px;
  background: #2a2d4a;
  outline: none;
}

.param-editor input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-green);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(111, 227, 162, 0.5);
}

.param-editor input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-green);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(111, 227, 162, 0.5);
  border: none;
}

.param-editor input[type="number"] {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  background: #0d0f1a;
  color: var(--text);
  border: 2px solid #4a4f80;
  font-size: 16px;
  font-family: "Space Mono", monospace;
  font-weight: 700;
}

.param-editor input[type="number"]:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.editor-actions {
  margin-top: 20px;
}

/* Help Modal */
.help-modal {
  width: min(900px, 90vw);
  position: relative;
}

.help-content {
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 10px;
  line-height: 1.6;
}

.help-content ul,
.help-content ol {
  padding-left: 24px;
}

.help-content li {
  margin: 6px 0;
}

.help-content p {
  margin: 8px 0;
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 2px solid var(--accent-red);
  border-radius: 50%;
  background: var(--bg-dark);
  color: var(--accent-red);
  font-size: 32px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.close-btn:hover {
  background: var(--accent-red);
  color: var(--bg-dark);
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 0 20px rgba(255, 111, 111, 0.5);
}

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

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #141938;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #4a4f80;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #6fa8ff;
}

/* Responsive */
@media (max-width: 1400px) {
  .layout {
    grid-template-columns: 280px 1fr 300px;
  }
}

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .left-panel,
  .right-panel {
    max-height: none;
  }
}

@media (max-width: 768px) {
  .title-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .limit-badge,
  .game-title {
    font-size: 24px;
  }

  .avatar-selector {
    grid-template-columns: repeat(4, 1fr);
  }
}
