@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  min-height: 100vh;
  background-color: #0a0a0b;
  color: #e4e4e7;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: #dc2626; text-decoration: none; }
a:hover { color: #ef4444; }

/* ============================
   CENTERED PAGE (login, code, register, createuser)
   ============================ */
.page-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  position: relative;
}
.page-center::before {
  content: '';
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(220,38,38,0.06) 0%, transparent 65%);
  pointer-events: none;
}
.center-box {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 480px;
}

/* Logo */
.logo-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 36px;
}
.logo-block img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 16px;
  margin-bottom: 14px;
}
.logo-block .tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #52525b;
}

/* Card */
.card {
  width: 100%;
  background: #141416;
  border: 1px solid #1e1e24;
  border-radius: 18px;
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 48px; height: 3px;
  background: #dc2626;
  border-radius: 0 0 4px 4px;
}
.card h1 {
  font-size: 24px;
  font-weight: 700;
  color: #fafafa;
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.card .subtitle {
  font-size: 15px;
  color: #71717a;
  text-align: center;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Separator */
.sep {
  width: 100%;
  height: 1px;
  background: #1e1e24;
  margin: 20px 0;
}

/* Forms */
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #a1a1aa;
  margin-bottom: 8px;
}
.form-group input, .form-group select {
  width: 100%;
  padding: 14px 16px;
  background: #0a0a0b;
  border: 1px solid #27272a;
  border-radius: 12px;
  color: #fafafa;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input[type="color"] {
  padding: 6px;
  height: 48px;
  cursor: pointer;
}
.form-group input:focus, .form-group select:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}
.form-group input::placeholder {
  color: #3f3f46;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  gap: 8px;
}
.btn-block { width: 100%; }
.btn-primary {
  background: #dc2626;
  color: #fff;
}
.btn-primary:hover {
  background: #ef4444;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(220,38,38,0.3);
}
.btn-secondary {
  background: #1e1e24;
  color: #e4e4e7;
  border: 1px solid #27272a;
}
.btn-secondary:hover {
  background: #27272a;
}
.btn-danger {
  background: rgba(220,38,38,0.15);
  color: #fca5a5;
  border: 1px solid rgba(220,38,38,0.25);
}
.btn-danger:hover {
  background: rgba(220,38,38,0.25);
}
.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 8px;
}

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 18px;
  line-height: 1.5;
}
.alert-error {
  background: rgba(220,38,38,0.1);
  border: 1px solid rgba(220,38,38,0.25);
  color: #fca5a5;
}
.alert-success {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.25);
  color: #86efac;
}

/* Code block */
.code-block {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 600;
  color: #fafafa;
  background: #0a0a0b;
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  letter-spacing: 0.1em;
  user-select: all;
  margin: 16px 0;
}
.code-block .cmd { color: #dc2626; }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-red {
  background: rgba(220,38,38,0.15);
  color: #fca5a5;
  border: 1px solid rgba(220,38,38,0.25);
}
.badge-green {
  background: rgba(34,197,94,0.15);
  color: #86efac;
  border: 1px solid rgba(34,197,94,0.25);
}

.mc-name { color: #dc2626; font-weight: 700; }

.page-footer {
  margin-top: 36px;
  font-size: 12px;
  color: #3f3f46;
  letter-spacing: 0.04em;
  text-align: center;
}

/* ============================
   DASHBOARD LAYOUT (home, users, permissions, etc)
   ============================ */
.dash-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 32px;
  background: #111113;
  border-bottom: 1px solid #1e1e24;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar .nav-left {
  display: flex;
  align-items: center;
  gap: 24px;
}
.navbar .nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.navbar .nav-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}
.navbar .nav-logo span {
  font-size: 15px;
  font-weight: 700;
  color: #fafafa;
  letter-spacing: -0.01em;
}
.navbar .nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}
.navbar .nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #71717a;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.15s;
}
.navbar .nav-tab:hover {
  color: #e4e4e7;
  background: #1a1a1e;
}
.navbar .nav-tab.active {
  color: #fafafa;
  background: #1e1e24;
}
.navbar .nav-tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.navbar .nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Profile Button in Navbar */
.nav-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.nav-profile-btn:hover {
  background: #1a1a1e;
  border-color: #1e1e24;
}
.nav-profile-btn.active {
  background: #1e1e24;
  border-color: #27272a;
}
.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  image-rendering: pixelated;
}
.nav-profile-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.nav-profile-name {
  font-size: 13px;
  font-weight: 600;
  color: #fafafa;
}
.nav-profile-role {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Main Content */
.dash-main {
  flex: 1;
  padding: 40px 48px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Page Title */
.page-title {
  margin-bottom: 32px;
}
.page-title h1 {
  font-size: 28px;
  font-weight: 700;
  color: #fafafa;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.page-title p {
  font-size: 15px;
  color: #71717a;
}

/* Section Card */
.section {
  background: #141416;
  border: 1px solid #1e1e24;
  border-radius: 16px;
  margin-bottom: 24px;
  overflow: hidden;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid #1e1e24;
}
.section-header h2 {
  font-size: 17px;
  font-weight: 600;
  color: #fafafa;
}
.section-body {
  padding: 24px 28px;
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead th {
  text-align: left;
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid #1e1e24;
  white-space: nowrap;
}
.data-table tbody td {
  padding: 14px 16px;
  font-size: 14px;
  color: #e4e4e7;
  border-bottom: 1px solid #111113;
  vertical-align: middle;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}
.data-table .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open {
  display: flex;
}
.modal {
  background: #141416;
  border: 1px solid #1e1e24;
  border-radius: 18px;
  padding: 36px;
  width: 90%;
  max-width: 480px;
  position: relative;
}
.modal h2 {
  font-size: 20px;
  font-weight: 700;
  color: #fafafa;
  margin-bottom: 8px;
}
.modal .modal-desc {
  font-size: 14px;
  color: #71717a;
  margin-bottom: 24px;
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none;
  border: none;
  color: #71717a;
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
}
.modal-close:hover { color: #fafafa; }
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Permission toggles */
.perm-grid {
  display: grid;
  gap: 12px;
}
.perm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #0a0a0b;
  border: 1px solid #1e1e24;
  border-radius: 12px;
}
.perm-item .perm-label {
  font-size: 14px;
  color: #e4e4e7;
}
.perm-item .perm-desc {
  font-size: 12px;
  color: #52525b;
  margin-top: 2px;
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle .slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #27272a;
  border-radius: 99px;
  cursor: pointer;
  transition: 0.2s;
}
.toggle .slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #71717a;
  border-radius: 50%;
  transition: 0.2s;
}
.toggle input:checked + .slider {
  background: #dc2626;
}
.toggle input:checked + .slider::before {
  transform: translateX(20px);
  background: #fff;
}

/* Roles tabs */
.role-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.role-tab {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #71717a;
  background: #0a0a0b;
  border: 1px solid #1e1e24;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.role-tab:hover {
  color: #e4e4e7;
  border-color: #27272a;
}
.role-tab.active {
  color: #fafafa;
  background: #dc2626;
  border-color: #dc2626;
}

/* Welcome home card */
.home-welcome {
  text-align: center;
  padding: 48px 40px 32px;
}
.home-welcome img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 20px;
  margin-bottom: 24px;
}
.home-welcome h1 {
  font-size: 28px;
  font-weight: 700;
  color: #fafafa;
  margin-bottom: 12px;
}
.home-welcome p {
  font-size: 16px;
  color: #71717a;
  line-height: 1.7;
}

/* Online Users Grid */
.online-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.online-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: #0a0a0b;
  border: 1px solid #1e1e24;
  border-radius: 12px;
  transition: border-color 0.15s;
}
.online-card:hover {
  border-color: #27272a;
}
.online-card img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  image-rendering: pixelated;
}
.online-card .online-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.online-card .online-name {
  font-size: 14px;
  font-weight: 600;
  color: #fafafa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.online-card .online-role {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.online-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(34,197,94,0.5);
}

/* Quote */
.quote-block {
  text-align: center;
  padding: 24px;
  font-style: italic;
  color: #71717a;
  font-size: 15px;
  line-height: 1.6;
  border-top: 1px solid #1e1e24;
}
.quote-block .quote-author {
  margin-top: 8px;
  font-style: normal;
  font-size: 12px;
  color: #52525b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Settings */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid #1e1e24;
}
.settings-row:last-child { border-bottom: none; }
.settings-row .setting-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: #e4e4e7;
  margin-bottom: 4px;
}
.settings-row .setting-info p {
  font-size: 13px;
  color: #52525b;
}

/* Color preview */
.color-preview {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid #27272a;
  vertical-align: middle;
  margin-right: 8px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #52525b;
}
.empty-state svg {
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-state p {
  font-size: 15px;
}

/* ============================
   PLAYER OVERVIEW (User Commander)
   ============================ */
.player-overview {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}

.player-left {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #141416;
  border: 1px solid #1e1e24;
  border-radius: 16px;
  overflow: hidden;
}

/* Skin Viewer */
.skin-viewer-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 24px;
  background: linear-gradient(180deg, #1a1a1e 0%, #141416 100%);
  min-height: 300px;
}
.skin-render {
  max-height: 280px;
  width: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.5));
}

/* Player Info Block */
.player-info-block {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.player-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.player-mini-head {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.player-mc-name {
  font-size: 17px;
  font-weight: 700;
  color: #fafafa;
  display: flex;
  align-items: center;
  gap: 8px;
}
.namemc-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #1e1e24;
  color: #71717a;
  transition: all 0.15s;
}
.namemc-link:hover {
  background: #27272a;
  color: #fafafa;
}
.player-uuid {
  font-size: 12px;
  color: #52525b;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
  word-break: break-all;
}

/* Detail rows */
.player-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid #1e1e24;
}
.player-detail-label {
  font-size: 13px;
  font-weight: 500;
  color: #71717a;
  flex-shrink: 0;
}
.player-detail-value {
  font-size: 14px;
  color: #e4e4e7;
  text-align: right;
  display: flex;
  align-items: center;
  gap: 8px;
}
.placeholder-value {
  color: #3f3f46;
  font-style: italic;
  font-size: 13px;
}

/* Online/Offline dots */
.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34,197,94,0.5);
  flex-shrink: 0;
}
.offline-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #52525b;
  flex-shrink: 0;
}
.player-online {
  color: #4ade80;
  font-weight: 600;
  font-size: 13px;
}
.player-offline {
  color: #71717a;
  font-size: 13px;
}

/* Livelog Button */
.livelog-btn {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #fafafa;
  background: #dc2626;
  border-radius: 6px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all 0.15s;
  margin-left: 4px;
}
.livelog-btn:hover {
  background: #ef4444;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220,38,38,0.3);
}

/* Punish Action Buttons */
.punish-actions {
  display: flex;
  gap: 8px;
  padding: 16px 16px 12px;
  flex-wrap: wrap;
}
.punish-btn {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.15s;
}
.punish-btn:not(:disabled):hover {
  opacity: 0.8;
  transform: translateY(-1px);
}
.punish-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  filter: grayscale(0.7);
}
.punish-btn-red {
  background: rgba(220,38,38,0.15);
  color: #fca5a5;
  border: 1px solid rgba(220,38,38,0.3);
}
.punish-btn-red:not(:disabled):hover {
  background: rgba(220,38,38,0.25);
  border-color: rgba(220,38,38,0.5);
}
.punish-btn-green {
  background: rgba(34,197,94,0.15);
  color: #86efac;
  border: 1px solid rgba(34,197,94,0.3);
}
.punish-btn-green:not(:disabled):hover {
  background: rgba(34,197,94,0.25);
  border-color: rgba(34,197,94,0.5);
}
.punish-btn-yellow {
  background: rgba(245,158,11,0.15);
  color: #fcd34d;
  border: 1px solid rgba(245,158,11,0.3);
}
.punish-btn-yellow:not(:disabled):hover {
  background: rgba(245,158,11,0.25);
  border-color: rgba(245,158,11,0.5);
}

/* Punishlog Toggle */
.punishlog-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #71717a;
  cursor: pointer;
  border-top: 1px solid #1e1e24;
  transition: all 0.15s;
  user-select: none;
}
.punishlog-toggle:hover {
  color: #e4e4e7;
  background: rgba(255,255,255,0.02);
}
.punishlog-toggle svg {
  transition: transform 0.2s;
  flex-shrink: 0;
}
.punishlog-toggle.open svg {
  transform: rotate(180deg);
}

/* Punishlog Content */
.punishlog {
  display: none;
  border-top: 1px solid #1e1e24;
}
.punishlog.open {
  display: block;
}
.punishlog-empty {
  padding: 24px;
  text-align: center;
  color: #52525b;
  font-size: 14px;
}

/* Punishlog Entry */
.punishlog-entry {
  padding: 16px 20px;
  border-bottom: 1px solid #1e1e24;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.punishlog-entry:last-child {
  border-bottom: none;
}
.punishlog-entry.punishlog-active {
  background: rgba(220,38,38,0.04);
  border-left: 3px solid #dc2626;
}
.punishlog-entry.punishlog-lifted {
  opacity: 0.6;
}
.punishlog-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  font-size: 13px;
  line-height: 1.5;
}

/* Bento Grid (rechte Seite) */
.player-right {
  min-width: 0;
}
.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.bento-item {
  background: #141416;
  border: 1px solid #1e1e24;
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
  transition: border-color 0.15s;
}
.bento-item:hover {
  border-color: #27272a;
}
.bento-wide {
  grid-column: span 2;
}
.bento-label {
  font-size: 12px;
  font-weight: 600;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.bento-value {
  font-size: 22px;
  font-weight: 700;
  color: #fafafa;
}
.bento-value.placeholder-value {
  font-size: 14px;
  font-weight: 400;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar { padding: 0 16px; height: 56px; }
  .navbar .nav-tabs { display: none; }
  .nav-profile-info { display: none; }
  .dash-main { padding: 24px 16px; }
  .section-header { padding: 16px 20px; }
  .section-body { padding: 16px 20px; }
  .data-table { font-size: 13px; }
  .data-table thead th, .data-table tbody td { padding: 10px 12px; }
  .card { padding: 28px 24px; }
  .online-grid { grid-template-columns: 1fr; }
  .player-overview { grid-template-columns: 1fr; }
  .skin-viewer-box { min-height: 220px; }
  .skin-render { max-height: 200px; }
  .bento-grid { grid-template-columns: 1fr; }
  .bento-wide { grid-column: span 1; }
}

@media (max-width: 480px) {
  .page-center { padding: 20px; }
  .card { padding: 24px 20px; }
  .home-welcome { padding: 40px 20px 24px; }
}

/* ============================
   MOBILE OPTIMIZATIONS
   ============================ */

/* Navbar Mobile */
@media (max-width: 900px) {
  .navbar {
    padding: 0 16px;
    height: 60px;
  }
  
  .navbar .nav-left {
    gap: 16px;
    flex: 1;
  }
  
  .navbar .nav-logo span {
    display: none;
  }
  
  .navbar .nav-tabs {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: #111113;
    border-bottom: 1px solid #1e1e24;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  .navbar .nav-tabs.open {
    max-height: 400px;
  }
  
  .navbar .nav-tab {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 16px;
  }
  
  .navbar .nav-profile-info {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: #e4e4e7;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
  }
  
  .mobile-menu-toggle:hover {
    background: #1a1a1e;
  }
  
  .mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
  }
}

@media (min-width: 901px) {
  .mobile-menu-toggle {
    display: none !important;
  }
}

/* Main Content Mobile */
@media (max-width: 768px) {
  .dash-main {
    padding: 24px 16px;
  }
  
  .page-title h1 {
    font-size: 24px;
  }
  
  .page-title p {
    font-size: 14px;
  }
}

/* Tables Mobile - Horizontal Scroll */
@media (max-width: 900px) {
  .section-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .data-table {
    min-width: 600px;
  }
  
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Modals Mobile */
@media (max-width: 768px) {
  .punish-modal-content {
    margin: 20px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
  }
  
  .punish-modal-header h2 {
    font-size: 18px;
  }
  
  .form-group label {
    font-size: 13px;
  }
  
  .btn {
    padding: 12px 20px;
    font-size: 14px;
  }
}

/* Touch Optimization */
@media (hover: none) and (pointer: coarse) {
  .btn {
    min-height: 44px;
    padding: 12px 24px;
  }
  
  .nav-tab {
    min-height: 44px;
  }
  
  .nav-profile-btn {
    min-height: 44px;
  }
  
  input, textarea, select {
    font-size: 16px !important;
  }
  
  .data-table tbody tr {
    min-height: 48px;
  }
}

/* Grid Layouts Mobile */
@media (max-width: 768px) {
  .bento-grid,
  .player-overview,
  .online-grid {
    grid-template-columns: 1fr;
  }
  
  .bento-wide {
    grid-column: span 1;
  }
}

/* Upload Dropzone Mobile */
@media (max-width: 768px) {
  .upload-dropzone {
    padding: 32px 16px;
  }
  
  .upload-dropzone h3 {
    font-size: 16px;
  }
  
  .upload-dropzone p {
    font-size: 13px;
  }
  
  /* Upload page 2-column layout becomes 1-column on mobile */
  .dash-main > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* Player Query Mobile */
@media (max-width: 768px) {
  .player-detail-label {
    font-size: 12px;
  }
  
  .search-form {
    flex-direction: column;
  }
  
  .search-form input {
    width: 100%;
  }
  
  .punish-buttons {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .punish-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 120px;
  }
}

/* Home Welcome Mobile */
@media (max-width: 768px) {
  .home-welcome {
    padding: 32px 20px;
  }
  
  .home-welcome h1 {
    font-size: 22px;
  }
  
  .home-welcome p {
    font-size: 14px;
  }
}

/* Fullscreen Video Mobile */
@media (max-width: 768px) {
  #fullscreenVideoContainer {
    align-items: center;
    justify-content: center;
  }
  
  #fullscreenVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  
  #loginVideo {
    width: 180px !important;
    max-width: 90vw;
  }
}

/* Prevent zoom on input focus (iOS Safari) */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  textarea,
  select {
    font-size: 16px;
  }
}

/* Improve scrolling on iOS */
.section-body,
.table-container {
  -webkit-overflow-scrolling: touch;
}

/* Fix viewport height on mobile browsers */
@supports (-webkit-touch-callout: none) {
  .page-center {
    min-height: -webkit-fill-available;
  }
}
