.page_game_runner {
  width: 100%;
}

#id_game_runner {
  width: 80%;
  max-width: 1000px;
  margin: 0 auto;
}

/* === Header === */
.gr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-bottom: 2px solid #e94560;
}
.gr-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gr-title h1 {
  margin: 0;
  font-size: 15pt;
  font-weight: 700;
  color: #e94560;
}
.gr-title-icon {
  font-size: 14pt;
  color: #e94560;
}
.gr-header-actions {
  display: flex;
  gap: 8px;
}

/* === Tabs === */
.gr-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #eee;
  background: #fafbfc;
}
.gr-tab {
  padding: 10px 20px;
  font-size: 10pt;
  font-weight: 600;
  color: #777;
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
.gr-tab:hover {
  color: #333;
  background: #f0f2f5;
}
.gr-tab-active {
  color: #e94560;
  border-bottom-color: #e94560;
}

/* === Game container === */
.gr-game-section {
  padding: 16px;
  display: flex;
  justify-content: center;
}
.gr-game-wrapper {
  position: relative;
  display: inline-block;
}
.gr-game-wrapper canvas {
  display: block;
  border: 3px solid #e94560;
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(233, 69, 96, 0.2);
  max-width: 100%;
  height: auto;
}
.gr-score-hud {
  position: absolute;
  top: 12px;
  right: 20px;
  color: white;
  font-size: 26px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  z-index: 5;
}
.gr-combo-hud {
  position: absolute;
  top: 45px;
  right: 20px;
  color: #ffd700;
  font-size: 16px;
  font-weight: bold;
  z-index: 5;
}
.gr-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.85);
  border-radius: 8px;
  z-index: 10;
}
.gr-overlay.hidden {
  display: none;
}
.gr-overlay h1 {
  color: #e94560;
  font-size: 38px;
  margin: 0 0 5px;
  text-shadow: 0 0 20px rgba(233,69,96,0.5);
}
.gr-overlay h2 {
  color: #2196F3;
  font-size: 20px;
  margin: 0 0 20px;
  font-weight: 300;
}
.gr-overlay p {
  color: #ccc;
  font-size: 15px;
  margin-bottom: 6px;
}
.gr-overlay-score {
  color: #e94560;
  font-size: 55px;
  font-weight: bold;
  text-shadow: 0 0 20px rgba(233,69,96,0.5);
}
.gr-overlay-record {
  color: #ffd700;
  font-size: 18px;
}
.gr-overlay-best {
  color: #ccc;
}
.gr-btn-play {
  margin-top: 20px;
  padding: 14px 45px;
  font-size: 18px;
  background: #e94560;
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
  letter-spacing: 1px;
}
.gr-btn-play:hover {
  background: #ff6b81;
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(233,69,96,0.5);
}
.gr-overlay-hint {
  margin-top: 15px;
  color: #888;
  font-size: 12px;
}

/* === Leaderboard === */
.gr-leaderboard {
  padding: 16px;
}
.gr-leaderboard-title {
  font-size: 9pt;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.gr-table-wrapper {
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
}
.gr-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 10pt;
}
.gr-table th {
  background: linear-gradient(135deg, #f1f3f5 0%, #e8eaed 100%);
  padding: 10px 14px;
  font-weight: 600;
  font-size: 9pt;
  color: #555;
  text-align: left;
  border-bottom: 2px solid #ddd;
}
.gr-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.gr-table tr:nth-child(even) td {
  background-color: #fafbfc;
}
.gr-table tr:hover td {
  background-color: #f0f7ff;
}
.gr-rank {
  font-weight: 700;
  font-size: 12pt;
  width: 40px;
  text-align: center;
}
.gr-rank-1 { color: #ffd700; }
.gr-rank-2 { color: #aaa; }
.gr-rank-3 { color: #cd7f32; }
.gr-player-me td {
  background-color: #e8f5e9 !important;
  font-weight: 600;
}
.gr-medal {
  font-size: 14pt;
}
.gr-score-cell {
  font-weight: 700;
  color: #e94560;
  font-size: 11pt;
}
.gr-games-count {
  color: #999;
  font-size: 9pt;
}
.gr-date {
  color: #999;
  font-size: 9pt;
}
.gr-no-scores {
  text-align: center;
  padding: 30px;
  color: #999;
  font-size: 10pt;
}

/* === Loading === */
.gr-loading {
  text-align: center;
  padding: 20px;
  color: var(--main-bg-color);
}
.gr-saving {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: #ffd700;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 9pt;
  z-index: 20;
}

/* === Responsive mobile === */
@media (max-width: 768px) {
  #id_game_runner {
    width: auto;
    margin: 0 10px;
  }
  .gr-game-wrapper canvas {
    width: 100%;
  }
  .gr-overlay h1 {
    font-size: 24px;
  }
  .gr-overlay h2 {
    font-size: 14px;
  }
  .gr-overlay-score {
    font-size: 36px;
  }
  .gr-btn-play {
    padding: 10px 30px;
    font-size: 14px;
  }
}
