/* Race styles for game.php (ported from race.php). Loaded only for game type 'r'. */

/* ─── Castbar ─────────────────────────────────────────── */
.tribe-indicator {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid white;
}
#castbar .userbox {
  height: 135px;
  max-height: none;
}
.castbar-item-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  padding: 2px 2px 3px;
}
.castbar-item-icons img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  border-radius: 2px;
  opacity: 0.9;
}
.castbar-item-icons img.used-item {
  opacity: 0.45;
  filter: grayscale(100%);
}
.castbar-item-icons img.active-item {
  opacity: 1;
  filter: none;
  border: 1px solid gold;
  box-shadow: 0 0 3px gold;
}
.castbar-penalty-badge {
  position: absolute;
  top: 3px;
  right: 4px;
  padding: 1px 3px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: bold;
  line-height: 1;
  pointer-events: none;
  z-index: 4;
}

/* ─── Actionbox layout ────────────────────────────────── */
/* Info pills row (matches Arena's .arena-info-pills) with the item guide button on the right */
.race-info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.race-info-pills { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.race-pill-break { flex-basis: 100%; height: 0; }
.race-pill {
  background: #48484840;
  color: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.65em;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.race-pill-timer { font-size: 0.8em; padding: 4px 12px; margin: 0 auto; }
.race-double-elim {
  color: red;
  font-weight: bold;
  text-align: center;
  margin: 6px 0;
}
.race-center { text-align: center; }
.race-flash:empty { display: none; }
.race-flash {
  margin: 6px 0;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(220, 38, 38, 0.15);
  color: #7f1d1d;
  font-weight: bold;
  text-align: center;
}
.race-vote-title { text-align: center; font-weight: bold; margin: 8px 0 4px; }
.race-vote-desc  { font-size: 0.82em; text-align: center; margin-top: 6px; opacity: 0.75; }
.race-jaded-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.race-jaded-select {
  padding: 3px 6px;
  border-radius: 4px;
  background: #1e1e3a;
  color: #eee;
  border: 1px solid #555;
}

.race-guide-btn {
  flex-shrink: 0;
  background: rgba(0,0,0,0.25);
  border: 2px solid rgba(0,0,0,0.35);
  color: #1a1a1a;
  font-weight: bold;
  font-size: 1em;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.race-guide-btn:hover {
  background: rgba(0,0,0,0.45);
  border-color: rgba(0,0,0,0.6);
}

.game-type-r .competition-btn {
  background-color: #40d300;
  color: white;
  border: none;
  padding: 12px 24px;
  margin: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1em;
  text-decoration: none;
  display: inline-block;
}
.game-type-r .competition-btn:hover { background-color: #047857; }

/* Gamemode voting */
.game-type-r .vote-button {
  background-color: #1e40af;
  color: white;
  border: none;
  padding: 10px 22px;
  margin: 5px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1em;
  transition: all 0.2s;
}
.game-type-r .vote-button:hover { background-color: #1e3a8a; }
.game-type-r .vote-button.selected {
  background-color: #0f172a;
  transform: scale(0.95);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

/* ─── Transport ───────────────────────────────────────── */
.transport-buttons { margin: 15px 0; }
.transport-btn {
  background-color: #5c9fff;
  color: white;
  border: 2px solid #5c9fff;
  padding: 10px 20px;
  margin: 5px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1em;
  transition: all 0.2s;
}
.transport-btn:hover {
  background-color: #2563eb;
  transform: scale(1.05);
}
.transport-btn.selected {
  background-color: #1e40af;
  border-color: #1e3a8a;
  transform: scale(0.95);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.transport-btn:disabled { cursor: not-allowed; opacity: 0.75; }
.transport-btn:disabled:hover { transform: none; }

.money-display {
  font-size: 1.2em;
  font-weight: bold;
  color: #000;
  margin: 10px 0;
  padding: 10px;
  background-color: rgb(0 0 0 / 10%);
  border-radius: 5px;
}

/* ─── Item selection ──────────────────────────────────── */
.item-selection-section {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 12px;
  padding: 20px;
  margin: 15px 0;
  text-align: left;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.item-selection-section h3 {
  color: #e2b96c;
  font-size: 1.3em;
  margin: 0 0 4px 0;
  text-align: center;
  text-shadow: 0 0 10px rgba(226,185,108,0.5);
}
.item-selection-section > p {
  color: #aaa;
  margin: 0 0 14px 0;
  font-size: 0.9em;
  text-align: center;
}
.item-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.item-card-btn {
  background: linear-gradient(90deg, #040406, #262643);
  border: 2px solid #4a4a8a;
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s;
  color: #ddd;
  font-size: 0.9em;
  text-align: left;
  width: 100%;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.item-card-btn:hover {
  border-color: #e2b96c;
  box-shadow: 0 4px 16px rgba(226,185,108,0.3);
  color: #fff;
}
.item-card-image {
  width: 64px;
  height: 64px;
  min-width: 64px;
  background-color: #08080d;
  border-right: 2px solid #33334c;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.item-card-image img { width: 48px; height: 48px; object-fit: contain; }
.item-card-info { padding: 10px 14px; flex: 1; }
.item-card-title {
  font-weight: bold;
  font-size: 1em;
  color: #e2b96c;
  margin-bottom: 3px;
}
.item-card-desc { font-size: 0.78em; color: #bbb; line-height: 1.2; }
.reroll-btn {
  background-color: #7c3aed;
  color: white;
  border: none;
  padding: 9px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9em;
  transition: all 0.2s;
  margin-top: 6px;
}
.reroll-btn:hover { background-color: #5b21b6; transform: scale(1.05); }
.reroll-btn:disabled { background-color: #555; cursor: not-allowed; transform: none; }

/* ─── Morgana bid ─────────────────────────────────────── */
.morgana-bid-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.15);
  text-align: center;
}
.morgana-bid-section h4 { margin: 0 0 8px 0; font-size: 1em; }
.morgana-bid-input {
  width: 90px;
  padding: 7px 10px;
  border: 2px solid #1e40af;
  border-radius: 6px;
  font-size: 1em;
  font-weight: bold;
  text-align: center;
}
.morgana-bid-btn {
  background-color: #1e40af;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1em;
  margin-left: 6px;
  transition: background 0.2s;
}
.morgana-bid-btn:hover { background-color: #1e3a8a; }

/* ─── Owned items bar ─────────────────────────────────── */
.owned-items-bar {
  margin-top: 18px;
  border-top: 1px solid #18182d;
  padding-top: 10px;
  text-align: center;
}
.owned-items-bar h4 {
  margin: 0 0 8px 0;
  font-size: 0.9em;
  color: #e2b96c;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}
.owned-items-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.owned-item-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.owned-item {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  border: 2px solid #4a4a8a;
  background: #2a2a4a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
  overflow: hidden;
}
.owned-item:hover,
.owned-item:focus { border-color: #e2b96c; outline: none; }
.owned-item.used-item { border-color: #6b7280; }
.owned-item.used-item img { filter: grayscale(100%); opacity: 0.5; }
.owned-item.used-item:hover,
.owned-item.used-item:focus { border-color: #9ca3af; }
.owned-item img { width: 100%; height: 100%; object-fit: contain; }
.item-remaining-badge {
  position: absolute;
  top: 0;
  right: -1px;
  background: #fff;
  color: #111;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #333;
  z-index: 3;
  pointer-events: none;
}
.owned-item-hover-name {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.72);
  color: #e2b96c;
  font-size: 0.58em;
  font-weight: bold;
  text-align: center;
  padding: 2px 2px 3px;
  line-height: 1.2;
  pointer-events: none;
  word-break: break-word;
}
.owned-item:hover .owned-item-hover-name,
.owned-item:focus .owned-item-hover-name { display: block; }
.owned-item-stat {
  min-width: 56px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #e2b96c;
  font-size: 0.68em;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}
.owned-item-stat.used-item { color: #9ca3af; }

/* ─── Modals ──────────────────────────────────────────── */
#item-modal,
#race-guide-modal {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
}
#item-modal       { z-index: 9999;  background: rgba(0,0,0,0.72); }
#race-guide-modal { z-index: 10000; background: rgba(0,0,0,0.75); }
#item-modal.open,
#race-guide-modal.open { display: flex; }

#item-modal-box {
  background: #12121e;
  border: 1px solid #e2b96c;
  border-radius: 12px;
  padding: 28px 32px 24px;
  max-width: 280px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
  position: relative;
}
#item-modal-img { width: 80px; height: 80px; object-fit: contain; margin-bottom: 14px; }
#item-modal-name { font-size: 1.1em; font-weight: bold; color: #e2b96c; margin-bottom: 10px; }
#item-modal-desc { font-size: 0.85em; color: #ccc; line-height: 1.45; }

#race-guide-modal-box {
  background: #12121e;
  border: 1px solid #e2b96c;
  border-radius: 12px;
  padding: 20px 24px;
  max-width: 340px;
  width: 92%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.8);
  position: relative;
}
#race-guide-modal-title {
  font-size: 1.1em;
  font-weight: bold;
  color: #e2b96c;
  text-align: center;
  margin: 0 0 14px 0;
  flex-shrink: 0;
}
.race-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.3em;
  cursor: pointer;
  line-height: 1;
}
.race-modal-close:hover { color: #fff; }
#race-guide-modal-list {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.race-guide-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, #040406, #1e1e38);
  border: 1px solid #3a3a6a;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.race-guide-item-img {
  width: 58px;
  height: 58px;
  min-width: 58px;
  background: #08080d;
  border-right: 1px solid #33334c;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.race-guide-item-img img { width: 44px; height: 44px; object-fit: contain; }
.race-guide-item-info { padding: 8px 12px 8px 0; flex: 1; }
.race-guide-item-name { font-weight: bold; font-size: 0.92em; color: #e2b96c; margin-bottom: 3px; }
.race-guide-item-desc { font-size: 0.77em; color: #bbb; line-height: 1.3; }

/* ─── Powerup banner ──────────────────────────────────── */
.powerup-banner {
  background-color: #497bff;
  color: white;
  padding: 20px;
  margin: 15px 0;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  animation: race-powerup-pulse 2s infinite;
}
@keyframes race-powerup-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}
.powerup-banner h3 {
  margin: 0 0 15px 0;
  font-size: 1.5em;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.powerup-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
  flex-wrap: wrap;
}
.powerup-button {
  background: linear-gradient(45deg, #FFD700, #FFD700);
  border: 0;
  color: #000;
  font-size: 2em;
  width: 80px;
  height: 80px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.powerup-button.visible-correct   { background: linear-gradient(45deg, #00ed00, #00ed00); }
.powerup-button.visible-incorrect { background: linear-gradient(45deg, #ff4242, #ff4242); }
.powerup-button img { max-width: 70px; max-height: 70px; object-fit: contain; }
.powerup-button:hover  { transform: scale(1.1); box-shadow: 0 6px 15px rgba(0,0,0,0.4); }
.powerup-button:active { transform: scale(0.95); }
.powerup-message { margin-top: 15px; padding: 10px; border-radius: 5px; font-weight: bold; }
.powerup-success { background: #4CAF50; }
.powerup-failure { background: #f44336; }
