/* ─── Admin Layout ───────────────────────────────────────────────────────────── */
.admin-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  position: relative;
  z-index: 1;
}

/* ─── Admin Header ───────────────────────────────────────────────────────────── */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.admin-header-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.admin-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
}

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  transition: color 0.15s;
}

.back-link:hover { color: var(--text); }

/* ─── Sections ───────────────────────────────────────────────────────────────── */
.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
}

.section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  color: var(--text);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.6;
}

.count-badge {
  background: var(--purple);
  color: #fff;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
}

/* ─── Forms ──────────────────────────────────────────────────────────────────── */
.game-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field--sm    { width: 70px; flex-shrink: 0; }
.field--grow  { flex: 1; min-width: 180px; }
.field--color { width: 80px; flex-shrink: 0; }

.field label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.field .hint {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.7;
}

.required { color: var(--pink); }

.field input[type="text"],
.field input[type="url"],
.field input[type="password"],
.field textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.field input[type="text"]:focus,
.field input[type="url"]:focus,
.field input[type="password"]:focus,
.field textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(123,47,255,0.2);
}

.field input[type="color"] {
  height: 44px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  width: 80px;
  outline: none;
  transition: border-color 0.15s;
}

.field input[type="color"]:focus,
.field input[type="color"]:hover {
  border-color: var(--purple);
}

.field textarea { resize: vertical; min-height: 72px; }

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* ─── Game List ──────────────────────────────────────────────────────────────── */
.game-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  transition: border-color 0.15s;
  position: relative;
  overflow: hidden;
}

.game-row:hover { border-color: var(--card-color, var(--purple)); }

.game-row-color-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--card-color, var(--purple));
  border-radius: 2px 0 0 2px;
}

.game-row-emoji {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.game-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.game-row-name {
  font-weight: 800;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-row-url {
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}

.game-row-url:hover { color: var(--cyan); }

.game-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag--sm {
  font-size: 0.62rem;
  padding: 1px 7px;
}

.game-row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 6px;
}

.btn-danger {
  display: inline-block;
  background: transparent;
  border: 1px solid rgba(255,61,154,0.3);
  color: var(--pink);
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.btn-danger:hover {
  background: rgba(255,61,154,0.12);
  border-color: var(--pink);
}

.inline-form { display: inline; }

.empty-text {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 0;
}

/* ─── Auth Page ──────────────────────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.auth-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.auth-logo { font-size: 3rem; margin-bottom: 16px; }

.auth-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.2rem;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 28px;
  font-weight: 600;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.auth-form .back-link {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 0.82rem;
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .admin-wrap { padding: 20px 16px 60px; }
  .admin-section { padding: 20px 16px; }
  .form-row { flex-direction: column; }
  .field--sm, .field--color { width: 100%; }
  .game-row { flex-wrap: wrap; }
  .game-row-actions { width: 100%; justify-content: flex-end; }
  .auth-box { padding: 28px 20px; }
}
