/* Nexagochi – digital pet game. Own visual identity: rounded "device" shell
   that re-themes its accent color per adopted species, instead of borrowing
   any other project's look. */

.ngc-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.ngc-header {
  text-align: center;
  margin-bottom: 2.2rem;
}
.ngc-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.ngc-back-btn:hover {
  color: var(--text-main);
}
.ngc-title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}
.ngc-title i {
  color: #FBBF24;
}
.ngc-subtitle {
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

/* --- Species picker --- */
.ngc-picker {
  text-align: center;
}
.ngc-picker h2 {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}
.ngc-picker p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 34rem;
  margin: 0 auto 1.8rem;
}
.ngc-species-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 700px) {
  .ngc-species-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.ngc-species-card {
  --ngc-accent: #94a3b8;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 18px;
  padding: 1.3rem 1rem 1.1rem;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.ngc-species-card:hover {
  transform: translateY(-4px);
  border-color: var(--ngc-accent);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
}
.ngc-species-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #0b1220;
  background: var(--ngc-accent);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--ngc-accent) 55%, transparent);
}
.ngc-species-name {
  font-weight: 700;
  font-size: 0.95rem;
}
.ngc-species-element {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ngc-accent);
}

/* --- Game device --- */
.ngc-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
}
.hidden {
  display: none !important;
}
.ngc-device {
  --ngc-accent: #94a3b8;
  width: min(420px, 100%);
  background: linear-gradient(165deg, rgba(30, 27, 24, 0.96), rgba(15, 17, 22, 0.96));
  border: 3px solid var(--ngc-accent);
  border-radius: 32px;
  padding: 1.4rem 1.4rem 1.6rem;
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.55), 0 0 0 6px rgba(255, 255, 255, 0.03) inset;
}
.ngc-device-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}
.ngc-pet-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.ngc-pet-name {
  font-weight: 800;
  font-size: 1.15rem;
}
.ngc-pet-stage {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ngc-accent);
}
.ngc-pet-age {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.ngc-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}
.ngc-mini-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ngc-accent) 20%, transparent);
  border: 1px solid var(--ngc-accent);
  color: #e5e7eb;
}
.ngc-xp-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}
.ngc-xp-bar {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.ngc-xp-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  transition: width 0.4s ease;
}
.ngc-xp-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.ngc-screen {
  position: relative;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--ngc-accent) 22%, #05070a), #05070a 75%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.2rem;
  margin-bottom: 1.1rem;
  overflow: hidden;
}
.ngc-pet-avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  color: #0b1220;
  background: var(--ngc-accent);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--ngc-accent) 55%, transparent);
  animation: ngc-bounce 2.4s ease-in-out infinite;
}
.ngc-pet-avatar.is-sleeping {
  animation: none;
  opacity: 0.6;
}
.ngc-pet-avatar.is-sad {
  animation: none;
  filter: grayscale(0.35);
}
@keyframes ngc-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.ngc-mood-bubble {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
}
.ngc-stats {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.2rem;
}
.ngc-stat {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.ngc-stat-label {
  flex: 0 0 108px;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.ngc-stat-bar {
  flex: 1;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.ngc-stat-fill {
  height: 100%;
  width: 80%;
  border-radius: 999px;
  background: var(--ngc-accent);
  transition: width 0.4s ease, background 0.4s ease;
}
.ngc-stat-health .ngc-stat-fill {
  background: #f87171;
}
.ngc-stat-fill.is-low {
  background: #ef4444 !important;
}
.ngc-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}
.ngc-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 0.4rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.ngc-action-btn i {
  font-size: 1.05rem;
  color: var(--ngc-accent);
}
.ngc-action-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--ngc-accent);
  transform: translateY(-2px);
}
.ngc-action-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.ngc-action-btn.is-active {
  background: var(--ngc-accent);
  color: #0b1220;
}
.ngc-action-btn.is-active i {
  color: #0b1220;
}
.ngc-action-btn-wide {
  grid-column: 1 / -1;
  flex-direction: row;
  justify-content: center;
}

/* --- Log / diary --- */
.ngc-log-wrap {
  width: min(420px, 100%);
}
.ngc-panel-title {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.ngc-log {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.ngc-log-entry {
  border-bottom: 1px dashed rgba(148, 163, 184, 0.15);
  padding-bottom: 0.35rem;
}
.ngc-log-entry:first-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* --- PvP arena --- */
.ngc-arena-wrap {
  width: min(420px, 100%);
}
.ngc-arena-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  line-height: 1.5;
}
.ngc-opponent-card {
  --ngc-accent: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--ngc-accent);
  border-radius: 14px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.8rem;
}
.ngc-opponent-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #0b1220;
  background: var(--ngc-accent);
}
.ngc-opponent-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.ngc-opponent-name {
  font-weight: 700;
  font-size: 0.9rem;
}
.ngc-opponent-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
}
.ngc-arena-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.ngc-arena-status {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  min-height: 1.2em;
}
.ngc-arena-status.is-error {
  color: #fca5a5;
}

/* --- Leaderboard --- */
.ngc-leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.ngc-leaderboard-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 0.6rem 0;
}
.ngc-leaderboard-row {
  --ngc-accent: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
}
.ngc-leaderboard-row.is-top3 {
  border-color: var(--ngc-accent);
}
.ngc-leaderboard-rank {
  width: 1.6rem;
  min-width: 1.6rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.ngc-leaderboard-row.is-top3 .ngc-leaderboard-rank {
  color: var(--ngc-accent);
}
.ngc-leaderboard-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #0b1220;
  background: var(--ngc-accent);
}
.ngc-leaderboard-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}
.ngc-leaderboard-name {
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ngc-leaderboard-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.ngc-leaderboard-record {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.ngc-release-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
}
.ngc-release-btn:hover {
  border-color: rgba(248, 113, 113, 0.6);
  color: #fca5a5;
}

/* --- Game over overlay --- */
.ngc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(6px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.ngc-overlay-box {
  width: min(92vw, 420px);
  background: linear-gradient(180deg, #0f172a, #111827);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 20px;
  padding: 1.8rem 1.6rem;
  text-align: center;
}
.ngc-overlay-box h2 {
  font-size: 1.3rem;
  margin-bottom: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #fca5a5;
}
.ngc-overlay-box p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.3rem;
}

/* --- Turn-based bot battle --- */
.ngc-battle-box {
  width: min(94vw, 460px);
  text-align: left;
}
.ngc-battle-fighters {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.ngc-battle-fighter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
}
.ngc-battle-icon {
  --ngc-accent: #94a3b8;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #0b1220;
  background: var(--ngc-accent);
}
.ngc-battle-name {
  font-size: 0.8rem;
  font-weight: 700;
}
.ngc-battle-vs {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
}
.ngc-battle-hp-bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.ngc-battle-hp-fill {
  height: 100%;
  width: 100%;
  background: #22c55e;
  transition: width 0.4s ease, background 0.3s ease;
}
.ngc-battle-hp-fill.is-mid {
  background: #f59e0b;
}
.ngc-battle-hp-fill.is-critical {
  background: #ef4444;
}
.ngc-battle-hp-text {
  font-size: 0.68rem;
  color: var(--text-muted);
}
.ngc-battle-log {
  margin-bottom: 0.9rem;
  text-align: left;
}
.ngc-battle-moves {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.ngc-move-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
  cursor: pointer;
  text-align: left;
}
.ngc-move-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}
.ngc-move-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.ngc-move-name {
  font-size: 0.82rem;
  font-weight: 700;
}
.ngc-move-meta {
  font-size: 0.66rem;
  color: var(--text-muted);
  text-transform: capitalize;
}
.ngc-battle-result {
  margin-top: 1rem;
}
