/**
 * Pokemon Reborn UI - Multi-Theme System
 * MCCodes v2 - Supports multiple color themes
 */

/* ============================================
   THEME 1: Default Light
   ============================================ */
:root {
  --theme: 1;
  
  /* Colors */
  --page-bg: #ffffff;
  --bg-main: #ffffff;
  --bg-secondary: #f0f0f0;
  --bg-banner: #1a1a2e;
  --text-primary: #111111;
  --text-secondary: #333333;
  --text-light: #666666;
  
  /* Navigation */
  --nav-bg: #c9c9c9;
  --nav-hover: #b5b5b5;
  --nav-dropdown-bg: #efefef;
  --nav-dropdown-hover: #dddddd;
  --nav-text: #111111;
  --nav-border-light: #f7f7f7;
  --nav-border-dark: #7a7a7a;
  
  /* Stats */
  --stats-bg: #ffffff;
  --stats-secondary: #f4f4f4;
  --stats-border: #b8b8b8;
  --stats-label: #333333;
  --stats-value: #111111;
  
  /* Table */
  --table-header-bg: #7f7f7f;
  --table-header-text: #ffffff;
  --table-row-odd: #ffffff;
  --table-row-even: #f2f2f2;
  --table-border: #c8c8c8;
  
  /* Buttons */
  --btn-bg: #bdbdbd;
  --btn-hover: #9d9d9d;
  --btn-text: #111111;
  --a-text: #1d4f91;
  
  /* Bars */
  --bar-green: #27ae60;
  --bar-blue: #2980b9;
  --bar-yellow: #f39c12;
  --bar-red: #e74c3c;

  --notice-bg: #fff9e6;
  --notice-border: #dcc9a8;
  --notice-accent: #f39c12;
  --footer-text: #666666;
}

/* ============================================
   THEME 2: Dark
   ============================================ */
html[data-theme="2"] {
  --page-bg: #23232a;
  --bg-main: #2b2b32;
  --bg-secondary: #353540;
  --bg-banner: #231823;
  --text-primary: #e8e0cb;
  --text-secondary: #d2c5a8;
  --text-light: #b09b78;
  
  --nav-bg: #232329;
  --nav-hover: #3a3a44;
  --nav-dropdown-bg: #313139;
  --nav-dropdown-hover: #3a3a44;
  --nav-text: #f1e6bf;
  --nav-border-light: #6a6a77;
  --nav-border-dark: #16161a;
  
  --stats-bg: #26262d;
  --stats-secondary: #32323a;
  --stats-border: #555562;
  --stats-label: #bdb6a3;
  --stats-value: #f0d27a;
  
  --table-header-bg: #575764;
  --table-header-text: #f6edd1;
  --table-row-odd: #303038;
  --table-row-even: #27272f;
  --table-border: #555562;
  
  --btn-bg: #50404d;
  --btn-hover: #3e313d;
  --btn-text: #f6edd1;
  --a-text: #f0d27a;
  
  --bar-green: #58c576;
  --bar-blue: #63a4ff;
  --bar-yellow: #f0d27a;
  --bar-red: #ea6c78;

  --notice-bg: #38333c;
  --notice-border: #5e5162;
  --notice-accent: #c48f4a;
  --footer-text: #b7a88a;
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--page-bg);
  color: var(--text-primary);
  font-family: 'Tahoma', 'Verdana', Arial, sans-serif;
  font-size: 12px;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 8px;
  color: var(--text-primary);
  line-height: 1.25;
}

h1 { font-size: 19px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
h4 { font-size: 12px; }

p {
  margin: 0 0 9px;
  line-height: 1.5;
}

ul,
ol {
  margin: 0 0 12px 22px;
  line-height: 1.55;
}

hr {
  height: 0;
  margin: 12px 0;
  border: 0;
  border-top: 1px solid var(--table-border);
}

a {
  color: var(--a-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ============================================
   APP SHELL & BANNER
   ============================================ */
.app-shell {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  background: var(--bg-main);
  border-left: 1px solid var(--table-border);
  border-right: 1px solid var(--table-border);
}

.app-banner {
  background: var(--bg-banner);
  border-bottom: 1px solid var(--table-border);
  overflow: hidden;
  position: relative;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-banner img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
}

/* ============================================
   CONTROLS BAR (Toggle + Theme Switcher)
   ============================================ */
.controls-bar {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 50;
  display: flex;
  gap: 8px;
}

.control-btn {
  background: rgba(18,18,18,0.22);
  border: 1px solid rgba(255,255,255,0.3);
  color: #f7f1de;
  padding: 4px 8px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 10px;
  font-weight: bold;
  transition: all 0.2s ease;
}

.control-btn:hover {
  background: rgba(18,18,18,0.38);
  border-color: rgba(255,255,255,0.6);
}

.theme-selector {
  display: flex;
  gap: 4px;
}

.theme-btn {
  background: rgba(18,18,18,0.22);
  border: 1px solid rgba(255,255,255,0.3);
  color: #f7f1de;
  padding: 4px 6px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 9px;
  font-weight: bold;
  transition: all 0.2s ease;
}

.theme-btn:hover {
  background: rgba(18,18,18,0.38);
}

.theme-btn.active {
  background: rgba(18,18,18,0.55);
  border-color: rgba(255,255,255,0.8);
  box-shadow: 0 0 8px rgba(255,255,255,0.18);
}

/* ============================================
   PLAYER STATS STRIP
   ============================================ */
.player-strip {
  background: var(--stats-bg);
  color: var(--text-primary);
  border-top: 1px solid var(--stats-border);
  border-bottom: 1px solid var(--table-border);
  padding: 8px 12px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
}

.player-strip a {
  color: var(--a-text);
  font-weight: bold;
}

.player-strip a:hover {
  text-decoration: underline;
}

.player-strip-main {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--stats-border);
}

.player-stat {
  display: inline-block;
  margin-right: 16px;
  white-space: nowrap;
}

.player-stat-logout {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.player-stat-label {
  color: var(--stats-label);
  font-weight: bold;
}

.player-stat-value {
  color: var(--stats-value);
  font-weight: bold;
}

.player-strip-spacer {
  flex: 1 1 auto;
}

.player-pokemon-chip {
  width: auto;
  min-width: 0;
  max-width: none;
  margin-left: 0;
  text-decoration: none;
  justify-content: flex-start;
  padding: 5px 8px;
  min-height: 0;
  overflow: hidden;
}

.player-pokemon-chip:hover {
  background: var(--bg-main);
  text-decoration: none;
}

.player-pokemon-chip.is-hidden {
  display: none;
}

.status-notice.is-hidden {
  display: none;
}

.player-pokemon-content {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.player-pokemon-content img {
  display: block;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  object-fit: contain;
  flex: 0 0 32px;
}

.player-pokemon-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
  line-height: 1.05;
}

.player-pokemon-name {
  color: var(--stats-value);
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-pokemon-hpbar {
  display: block;
  width: 100%;
  height: 4px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(0,0,0,0.28);
  overflow: hidden;
}

.player-pokemon-hpfill {
  display: block;
  height: 100%;
  background: var(--bar-green);
  transition: width 0.3s ease;
}

.player-pokemon-level {
  color: var(--stats-label);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-strip-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(159px, 1fr));
  gap: 8px;
}

.player-strip-bars.is-collapsed {
  display: none;
}

.status-chip {
  background: var(--stats-secondary);
  border: 1px solid var(--stats-border);
  padding: 6px 8px;
  border-radius: 2px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.status-chip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  gap: 8px;
  white-space: nowrap;
}

.status-chip-label {
  color: var(--stats-label);
  font-weight: bold;
  font-size: 10px;
}

.status-chip-value {
  color: var(--stats-value);
  font-weight: bold;
  font-size: 10px;
  flex: 0 0 auto;
}

.status-bar {
  height: 10px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(0,0,0,0.35);
  border-radius: 1px;
  overflow: hidden;
}

.status-bar .fill {
  display: block;
  height: 100%;
  transition: width 0.3s ease;
}

.fill.green { background: var(--bar-green); }
.fill.blue { background: var(--bar-blue); }
.fill.yellow { background: var(--bar-yellow); }
.fill.red { background: var(--bar-red); }

.status-bar.hidden { display: none; }

.status-timer {
  color: var(--stats-label);
  font-size: 10px;
  line-height: 1.2;
  margin-top: 4px;
  opacity: 0.92;
}

.status-timer.hidden { display: none; }

.momentum-indicator {
  display: none;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid var(--stats-border);
  background: var(--stats-secondary);
  color: var(--stats-label);
  font-size: 10px;
  font-weight: bold;
  line-height: 1.2;
  white-space: nowrap;
}

.momentum-indicator.is-active {
  display: inline-flex;
  border-color: #d19d23;
  background: rgba(209,157,35,0.18);
  color: #d19d23;
  box-shadow: 0 0 8px rgba(209,157,35,0.22);
}

.momentum-indicator.is-active::before {
  content: ">>";
  margin-right: 4px;
}

.status-chip.momentum-boosted {
  border-color: #d19d23;
  background:
    linear-gradient(90deg, rgba(209,157,35,0.24), transparent 46%),
    var(--stats-secondary);
  box-shadow: inset 3px 0 0 #d19d23, 0 0 8px rgba(209,157,35,0.16);
}

/* ============================================
   NAVIGATION STRIP
   ============================================ */
.nav-strip {
  background: var(--nav-bg);
  border-top: 1px solid var(--nav-border-light);
  border-bottom: 1px solid var(--nav-border-dark);
  padding: 8px 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.nav-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.nav-support {
  margin-left: auto;
  margin-bottom: 0;
}

.status-notice.nav-promo {
  margin-left: auto;
  margin-bottom: 0;
  padding: 8px 10px;
  background: #f4f4f4;
  border: 1px solid var(--table-border);
  color: var(--text-light);
  font-size: 11px;
}

.status-notice:hover{
  border-left: 3px solid var(--nav-border-dark);
}

html[data-theme="2"] .status-notice.nav-promo {
  background: var(--bg-secondary);
}

.nav-promo + .nav-support {
  margin-left: 6px;
}

.nav-promo a {
  color: var(--a-text);
  text-decoration: none;
  font-weight: normal;
}

.nav-promo a:hover,
.nav-promo a:focus {
  color: var(--a-text);
  text-decoration: underline;
}

.nav-promo b {
  color: var(--text-primary);
}

.nav-group {
  position: relative;
  display: inline-block;
}

.nav-group.open .nav-dropdown {
  display: block;
}

.nav-trigger {
  background: linear-gradient(180deg, 
    var(--nav-border-light), 
    var(--nav-bg));
  border-left: 1px solid var(--nav-border-light);
  border-top: 1px solid var(--nav-border-light);
  border-right: 1px solid var(--nav-border-dark);
  border-bottom: 1px solid var(--nav-border-dark);
  color: var(--nav-text);
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  padding: 8px 16px;
  margin: 0;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -1px 0 rgba(0,0,0,0.12);
  outline: none;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-trigger::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: var(--nav-marker, #777);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

.nav-group-profile { --nav-marker: #2f80ed; }
.nav-group-explore { --nav-marker: #2e9f52; }
.nav-group-community { --nav-marker: #b05a22; }
.nav-group-help { --nav-marker: #8a63a8; }

.nav-group-profile .nav-dropdown { border-top: 3px solid #2f80ed; }
.nav-group-explore .nav-dropdown { border-top: 3px solid #2e9f52; }
.nav-group-community .nav-dropdown { border-top: 3px solid #b05a22; }
.nav-group-help .nav-dropdown { border-top: 3px solid #8a63a8; }

.nav-trigger:hover {
  background: linear-gradient(180deg, 
    var(--nav-bg),
    var(--nav-bg));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), inset 0 -1px 0 rgba(0,0,0,0.16);
}

.nav-trigger:active,
.nav-group.open .nav-trigger,
.nav-group:has(.nav-dropdown:hover) .nav-trigger {
  background: var(--nav-hover);
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.3), inset 0 -1px 0 rgba(255,255,255,0.1);
}

.nav-group:hover .nav-dropdown,
.nav-group:focus-within .nav-dropdown {
  display: block;
}

.nav-dropdown {
  display: none;
  position: absolute;
  left: -1px;
  top: 100%;
  min-width: 180px;
  background: var(--nav-dropdown-bg);
  border-left: 1px solid var(--nav-border-dark);
  border-right: 1px solid var(--nav-border-dark);
  border-bottom: 1px solid var(--nav-border-dark);
  border-top: 1px solid var(--nav-border-light);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  z-index: 100;
}

.nav-item {
  padding: 0;
  white-space: nowrap;
}

.nav-item a {
  display: block;
  position: relative;
  padding: 8px 12px 8px 26px;
  color: var(--nav-text);
  text-decoration: none;
  font-size: 12px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  border-bottom: 1px solid rgba(0,0,0,0.12);
}

.nav-item a::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: var(--nav-marker, #777);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
  transform: translateY(-50%);
}

.nav-item:last-child a {
  border-bottom: none;
}

.nav-item a:hover {
  background: var(--nav-dropdown-hover);
  color: var(--nav-text);
  text-decoration: none;
  box-shadow: inset 3px 0 0 var(--nav-marker, #777);
}

.nav-item a.menu-alert {
  color: #c0392b;
  font-weight: bold;
}

.nav-item a.menu-alert::before {
  background: #c0392b;
}

.menu-time {
  display: block;
  padding: 8px 12px;
  color: var(--text-light);
  font-size: 11px;
  border-top: 1px solid rgba(0,0,0,0.1);
  background: rgba(0,0,0,0.04);
}

/* ============================================
   CONTENT AREA
   ============================================ */
.content-shell {
  padding: 3px;
  background: var(--nav-bg);
}

.content-pane {
  background: var(--bg-main);
  border: 1px solid var(--table-border);
  padding: 16px;
  min-height: 420px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  overflow-wrap: anywhere;
}

.content-pane > h1:first-child,
.content-pane > h2:first-child,
.content-pane > h3:first-child {
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 3px double var(--table-border);
}

.content-pane > form {
  max-width: 760px;
  margin: 10px 0 14px;
  padding: 10px;
  border: 1px solid var(--table-border);
  background: var(--bg-secondary);
  line-height: 1.9;
}

.content-pane > form input[type="submit"] {
  margin: 8px 0 0;
}

.content-pane > table {
  width: 100%;
}

.staff-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  background: var(--page-bg);
  align-items: start;
}

.staff-sidebar {
  background: var(--bg-main);
  border: 1px solid var(--table-border);
  padding: 12px;
  line-height: 1.45;
}

.staff-sidebar hr {
  border: 0;
  border-top: 1px solid var(--table-border);
  margin: 10px 0;
}

.staff-main .content-shell {
  padding: 0;
}

.staff-main .content-pane {
  min-height: 520px;
}

.status-notice {
  margin-bottom: 8px;
  padding: 8px 10px;
  background: var(--notice-bg);
  border-left: 3px solid var(--notice-accent);
  border: 1px solid var(--notice-border);
  font-size: 11px;
}

.status-notice.compact {
  background: #fffaed;
  margin-bottom: 12px;
}

.status-notice b {
  color: #c0392b;
}

.status-notice a {
  color: var(--a-text);
  font-weight: bold;
}

.pvp-alert {
  max-width: 680px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #d8a0a0;
  border-left: 4px solid #c0392b;
  background: linear-gradient(90deg, #fff0f0, var(--bg-main) 72%);
  color: var(--text-primary);
}

.pvp-alert-kicker {
  margin-bottom: 4px;
  color: #a42a22;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
}

.pvp-alert-message {
  max-width: 58ch;
  line-height: 1.55;
  font-weight: bold;
}

.pvp-alert-actions {
  margin-top: 10px;
}

html[data-theme="2"] .pvp-alert {
  background: linear-gradient(90deg, #3d292d, var(--bg-main) 72%);
  border-color: #72464c;
  border-left-color: #e06868;
}

html[data-theme="2"] .pvp-alert-kicker {
  color: #ffd7d7;
}

.status-notice.cooldown-notice {
  background: #eaf8ff;
  border-color: #9fcfe1;
  border-left-color: #2f9dcc;
  color: #164a5d;
}

.status-notice.cooldown-notice b {
  color: #177ca6;
}

.profile-status-notice {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 8px;
  font-weight: bold;
}

.profile-status-danger {
  border: 1px solid #d9a2a2;
  border-left: 3px solid #c0392b;
  background: #fff0f0;
  color: #8e1f16;
}

.profile-cooldown-notice {
  border: 1px solid #9fcfe1;
  border-left: 3px solid #2f9dcc;
  background: #eaf8ff;
  color: #164a5d;
}

html[data-theme="2"] .profile-status-danger {
  background: #3d292d;
  border-color: #72464c;
  border-left-color: #e06868;
  color: #ffd7d7;
}

html[data-theme="2"] .status-notice.cooldown-notice {
  background: #223844;
  border-color: #3f7185;
  border-left-color: #66c7ee;
  color: #d5f3ff;
}

html[data-theme="2"] .status-notice.cooldown-notice b {
  color: #8adfff;
}

html[data-theme="2"] .profile-cooldown-notice {
  background: #223844;
  border-color: #3f7185;
  border-left-color: #66c7ee;
  color: #d5f3ff;
}

.tutorial-reward-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
  padding: 12px;
  border: 2px solid #b88720;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.72), rgba(255,243,190,0.58)),
    var(--notice-bg);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.7), 0 3px 0 rgba(91,61,13,0.18);
}

.tutorial-reward-capture {
  border-color: #3d8d55;
}

html[data-theme="2"] .tutorial-reward-card.tutorial-reward-capture {
  background:
    linear-gradient(135deg, rgb(55 55 55 / 72%), rgb(255 242 186 / 58%)),
    var(--notice-bg);
}

.tutorial-reward-battle {
  border-color: #b84a3f;
}

.tutorial-reward-sprite {
  flex: 0 0 86px;
  min-height: 86px;
  display: grid;
  place-items: center;
  border: 1px solid var(--table-border);
  background: var(--bg-main);
  image-rendering: pixelated;
}

.tutorial-reward-sprite img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  image-rendering: pixelated;
}

.tutorial-reward-content {
  flex: 1;
  min-width: 0;
}

.tutorial-reward-kicker {
  margin-bottom: 3px;
  color: #8a5a08;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.tutorial-reward-card h3 {
  margin-bottom: 4px;
  font-size: 16px;
}

.tutorial-reward-card p {
  color: var(--text-secondary);
}

.tutorial-reward-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tutorial-reward-item {
  min-width: 110px;
  padding: 5px 8px;
  border: 1px solid var(--table-border);
  background: var(--bg-main);
}

.tutorial-reward-item span,
.tutorial-reward-item strong {
  display: block;
}

.tutorial-reward-item span {
  color: var(--text-light);
  font-size: 9px;
  font-weight: bold;
  text-transform: uppercase;
}

.tutorial-reward-item strong {
  margin-top: 2px;
  color: var(--text-primary);
}

.tutorial-reward-details {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--table-border);
}

.tutorial-reward-details summary {
  color: var(--a-text);
  cursor: pointer;
  font-weight: bold;
}

.tutorial-reward-details .battle-log {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--table-border);
  background: var(--bg-main);
  text-align: left;
}

/* ============================================
   PLAYER PAGE CONTENT
   ============================================ */
.page-heading {
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 3px double var(--table-border);
}

.page-heading h2,
.page-heading h3 {
  margin: 0 0 4px;
  color: var(--text-primary);
  font-size: 17px;
  line-height: 1.2;
}

.page-heading p {
  max-width: 760px;
  color: var(--text-light);
  line-height: 1.5;
}

.game-panel {
  margin-bottom: 14px;
  border: 1px solid var(--table-border);
  background: var(--bg-main);
}

.game-panel-title {
  margin: 0;
  padding: 7px 10px;
  background: var(--table-header-bg);
  color: var(--table-header-text);
  border-bottom: 1px solid var(--table-border);
  font-size: 12px;
  font-weight: bold;
}

.game-panel-body {
  padding: 10px;
  line-height: 1.55;
  overflow-x: auto;
}

.next-goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.next-goal {
  background: var(--bg-secondary);
  border: 1px solid var(--table-border);
  padding: 8px;
  display: grid;
  gap: 5px;
}

.next-goal strong {
  color: var(--text-primary);
}

.next-goal span {
  color: var(--text-light);
  font-size: 11px;
}

.field-note {
  position: relative;
  margin: 0 0 14px;
  padding: 9px 11px 9px 34px;
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-left: 4px solid var(--notice-accent);
  line-height: 1.5;
}

.field-note::before {
  content: "?";
  position: absolute;
  left: 10px;
  top: 9px;
  width: 15px;
  height: 15px;
  border: 1px solid var(--notice-accent);
  color: var(--notice-accent);
  font-size: 10px;
  font-weight: bold;
  line-height: 13px;
  text-align: center;
}

.field-note strong {
  color: var(--text-primary);
}

.hints-disabled .tutorial-hint {
  display: none !important;
}

.player-status-summary {
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid var(--table-border);
  background: var(--bg-secondary);
  line-height: 1.5;
}

.info-msg,
.error-msg {
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid var(--table-border);
  line-height: 1.5;
}

.info-msg {
  background: var(--bg-secondary);
}

.error-msg {
  background: #fff0f0;
  border-color: #cf8d8d;
  color: #7f1f1f;
}

.online-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.online-main,
.online-chat {
  min-width: 0;
}

.shoutbox-form textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  margin-bottom: 8px;
}

.shoutbox-list {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow-y: auto;
}

.shoutbox-item {
  padding: 8px;
  border: 1px solid var(--table-border);
  background: var(--bg-secondary);
}

.shoutbox-meta {
  margin-bottom: 4px;
  font-weight: bold;
}

.shoutbox-time {
  color: var(--text-light);
  font-weight: normal;
  font-size: 11px;
}

.shoutbox-text {
  white-space: normal;
  word-break: break-word;
}

.shoutbox-delete-form {
  margin-top: 6px;
}

.info-grid,
.directory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.info-cell {
  padding: 8px 10px;
  border: 1px solid var(--table-border);
  background: var(--bg-secondary);
  line-height: 1.45;
}

.info-label {
  display: block;
  margin-bottom: 2px;
  color: var(--text-light);
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.info-value {
  color: var(--text-primary);
  font-weight: bold;
}

.directory-section {
  border: 1px solid var(--table-border);
  background: var(--bg-main);
}

.directory-section h3 {
  margin: 0;
  padding: 7px 9px;
  background: var(--table-header-bg);
  color: var(--table-header-text);
  font-size: 12px;
}

.directory-links {
  padding: 5px 9px 8px;
}

.directory-link {
  display: block;
  padding: 5px 2px;
  border-bottom: 1px dotted var(--table-border);
  line-height: 1.35;
}

.directory-link:last-child {
  border-bottom: 0;
}

.directory-link small {
  display: block;
  color: var(--text-light);
  font-size: 10px;
}

.donator-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid var(--table-border);
  background: var(--bg-secondary);
  color: var(--text-light);
  font-size: 11px;
}

.donator-secondary-link {
  font-weight: bold;
}

.donator-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.donator-pack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--table-border);
  background: var(--bg-main);
  padding: 10px;
}

.donator-pack-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px dotted var(--table-border);
  color: var(--text-primary);
}

.donator-pack-id {
  padding: 2px 6px;
  border: 1px solid var(--notice-accent);
  color: var(--notice-accent);
  background: var(--notice-bg);
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
}

.donator-pack h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 14px;
}

.donator-pack p {
  margin: 0;
  color: var(--text-light);
  line-height: 1.45;
}

.donator-pack ul {
  flex: 1 1 auto;
  margin: 0;
  padding-left: 18px;
  line-height: 1.5;
}

.donator-pack-form {
  margin: 0;
}

.donator-buy-button {
  width: 100%;
  min-height: 34px;
  font-weight: bold;
}

.paypal-like-button {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid #c29b1b;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffd761 0%, #f6c63c 100%);
  color: #1d1d1d;
  font-weight: bold;
  cursor: pointer;
}

.paypal-like-button:hover {
  background: linear-gradient(180deg, #ffe17f 0%, #ffd04f 100%);
}

.paypal-like-button-label {
  font-size: 18px;
  line-height: 1.1;
}

.paypal-like-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.card-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 20px;
  padding: 0 6px;
  border: 1px solid rgba(0,0,0,0.16);
  border-radius: 4px;
  background: #ffffff;
  color: #1c1c1c;
  font-size: 9px;
  font-weight: bold;
  line-height: 1;
}

.card-chip-paypal {
  color: #003087;
}

.card-chip-visa {
  color: #1434cb;
}

.card-chip-mastercard {
  color: #b02222;
}

.card-chip-gpay {
  color: #111111;
}

.paypal-like-powered {
  color: rgba(0,0,0,0.75);
  font-size: 10px;
  font-weight: bold;
}

.pokemon-farm-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.pokemon-farm-links {
  margin-bottom: 12px;
}

.pokemon-farm-filter-panel {
  margin-bottom: 14px;
}

.pokemon-farm-filter-panel[open] {
  padding-bottom: 0;
}

.pokemon-farm-filter-toggle {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pokemon-farm-filter-toggle::-webkit-details-marker {
  display: none;
}

.pokemon-farm-filter-toggle::after {
  content: '+';
  font-size: 16px;
  line-height: 1;
}

.pokemon-farm-filter-panel[open] .pokemon-farm-filter-toggle::after {
  content: '-';
}

.pokemon-farm-search {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px 12px;
  align-items: end;
  margin-left: 0;
  width: 100%;
}

.pokemon-farm-filters {
  flex-wrap: nowrap;
}

.pokemon-farm-search label {
  font-weight: bold;
  width: auto;
  white-space: nowrap;
  color: var(--text-light);
  margin-bottom: 4px;
  display: block;
}

.pokemon-farm-search input[type="text"] {
  width: 100%;
}

.pokemon-farm-search select {
  min-width: 0;
  max-width: 100%;
}

.pokemon-farm-search input[type="submit"],
.pokemon-farm-search button {
  flex: 0 0 auto;
}

.pokemon-farm-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pokemon-farm-clear-link {
  align-self: center;
}

.pokemon-release-batch-controls {
  margin: 0;
}

.pokemon-release-tools-panel {
  margin-bottom: 12px;
}

.pokemon-release-search-form {
  grid-template-columns: minmax(140px, 180px) minmax(220px, 1fr) auto;
}

.pokemon-release-search-form .pokemon-farm-filter-actions {
  justify-content: flex-start;
}

.pokedex-filter-button {
  padding: 6px 10px;
  line-height: 1;
}

.pokedex-pokemon-cell {
  white-space: nowrap;
}

.pokedex-pokemon-icon {
  display: inline-block;
  vertical-align: middle;
}

.pokedex-pokemon-name {
  display: inline-block;
  vertical-align: middle;
}

.pokemon-farm-table th .market-sort-link,
.pokemon-farm-table th .market-sort-link:visited {
  color: var(--table-header-text);
  text-decoration: none;
}

.pokemon-farm-table th .market-sort-link:hover,
.pokemon-farm-table th .market-sort-link:focus {
  color: var(--table-header-text);
  text-decoration: underline;
}
.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.action-row form {
  display: inline-block;
  margin: 0;
}

.action-link {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--table-border);
  background: var(--bg-secondary);
  color: var(--a-text);
  font-weight: bold;
  line-height: 1;
}

button.action-link {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  box-shadow: none;
  text-align: center;
  vertical-align: middle;
  margin: 0;
  outline: none;
}

button.action-link:hover,
.action-link:hover {
  background: var(--table-header-bg);
  color: var(--table-header-text);
  text-decoration: none;
}

.action-link.danger {
  color: #b72a2a;
}

button.action-link.danger {
  color: #b72a2a;
}

.pokemon-hunt-actions .action-link,
.pokemon-hunt-actions button.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--table-border);
  border-radius: 0;
  background: var(--bg-secondary);
  color: var(--a-text);
  font: inherit;
  font-weight: bold;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  box-shadow: none;
  cursor: pointer;
  white-space: nowrap;
  vertical-align: middle;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.battle-tent-actions .action-link,
.battle-tent-actions button.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--table-border);
  border-radius: 0;
  background: var(--bg-secondary);
  color: var(--a-text);
  font: inherit;
  font-weight: bold;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  box-shadow: none;
  cursor: pointer;
  white-space: nowrap;
  vertical-align: middle;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.pokemon-hunt-actions .action-link:hover,
.pokemon-hunt-actions button.action-link:hover {
  background: var(--table-header-bg);
  color: var(--table-header-text);
  text-decoration: none;
}

.battle-tent-actions .action-link:hover,
.battle-tent-actions button.action-link:hover {
  background: var(--table-header-bg);
  color: var(--table-header-text);
  text-decoration: none;
}

.pokemon-hunt-actions .action-link.danger,
.pokemon-hunt-actions button.action-link.danger {
  color: #b72a2a;
}

.page-action-nav,
.gang-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}

.gang-subnav {
  padding: 7px;
  border: 1px solid var(--table-border);
  background: var(--bg-secondary);
}

.gang-subnav-link {
  display: inline-block;
  padding: 6px 9px;
  border: 1px solid var(--table-border);
  background: var(--bg-main);
  color: var(--a-text);
  font-size: 11px;
  font-weight: bold;
}

.gang-subnav-link.is-active {
  background: var(--table-header-bg);
  color: var(--table-header-text);
}

.mission-result-actions {
  margin-top: 14px;
}

.gang-application-actions {
  white-space: nowrap;
}

.gang-application-actions form {
  display: inline-block;
  margin-right: 5px;
}

.margin-helper {
  margin-bottom: 0px;
  margin-left: auto;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(130px, 0.45fr) minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
}

.form-grid label {
  font-weight: bold;
}

.form-actions {
  grid-column: 1 / -1;
  padding-top: 4px;
}

.form-actions input[type="submit"] {
  margin: 0;
}

.muted-text {
  color: var(--text-light);
}

.referral-panel {
  margin-top: 4px;
}

.referral-lead {
  margin-bottom: 10px;
  line-height: 1.5;
}

.referral-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.referral-link-input {
  flex: 1 1 340px;
  min-width: 220px;
  padding: 7px 8px;
  border: 1px solid var(--table-border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font: inherit;
}

.guide-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.guide-nav a {
  padding: 5px 8px;
  border: 1px solid var(--table-border);
  background: var(--bg-secondary);
  font-weight: bold;
}

.guide-list {
  display: grid;
  grid-template-columns: minmax(120px, 0.3fr) minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--table-border);
}

.guide-list dt,
.guide-list dd {
  padding: 7px 9px;
  border-bottom: 1px solid var(--table-border);
  line-height: 1.45;
}

.guide-list dt {
  background: var(--bg-secondary);
  font-weight: bold;
}

.guide-list dd {
  margin: 0;
}

.guide-list dt:last-of-type,
.guide-list dd:last-of-type {
  border-bottom: 0;
}

/* ============================================
   TABLES
   ============================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  background: var(--bg-main);
}

.table-responsive {
  max-width: 100%;
  overflow-x: auto;
}

.centered-table {
    text-align: center;
}

.nature-stat-up {
    color: #2e8b3d;
}

.nature-stat-down {
    color: #c0392b;
}

.battle-log {
  text-align: center;
  line-height: 1.7;
}

.battle-log-round {
  margin: 0.6rem 0 0.2rem;
  font-weight: 700;
}

.battle-log-line {
  margin: 0.15rem 0;
}

.battle-log-attacker {
  color: #b72a2a;
}

.battle-log-defender {
  color: #518fff;
}

.battle-log-note {
  margin: 0.4rem 0;
  font-weight: 600;
}

.centered-action-form {
  margin: 16px auto 0;
  text-align: center;
}

.centered-action-form input[type="submit"],
.centered-action-form button {
  min-width: 120px;
}

.inline-action-form {
  display: inline;
  margin: 0;
}

.inline-action-form input[type="submit"] {
  border: none;
  background: none;
  color: var(--link-color, #2e6da4);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.type-coverage-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.type-coverage-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--type-color, #888);
  color: #fff;
  font-weight: bold;
  font-size: 0.85em;
  text-transform: uppercase;
  cursor: pointer;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.type-coverage-badge:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.type-coverage-badge input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.type-coverage-badge:has(input:checked) {
  outline: 2px solid #fff;
  box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.7), 0 0 16px 4px var(--type-color, #888);
}

.item-use-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.item-use-modal-overlay.hidden {
  display: none;
}

.item-use-modal {
  background: var(--bg-main, #fff);
  color: inherit;
  border-radius: 8px;
  padding: 20px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.item-use-modal p {
  margin: 0 0 16px;
  font-size: 1.05em;
}

.item-use-modal button {
  min-width: 100px;
}

.pokedex-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.pokedex-page-link {
  display: inline-block;
  padding: 6px 9px;
  border: 1px solid var(--table-border);
  background: var(--bg-main);
  color: var(--a-text);
  font-size: 11px;
  font-weight: bold;
  text-decoration: none;
}

.pokedex-page-link:hover {
  background: var(--bg-secondary);
}

.pokedex-page-current {
  display: inline-block;
  padding: 6px 9px;
  border: 1px solid var(--table-border);
  background: var(--table-header-bg);
  color: var(--table-header-text);
  font-size: 11px;
  font-weight: bold;
}

.hof-rank-badge {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.pokedex-page-ellipsis {
  padding: 0 2px;
  color: var(--text-light);
}

.pokedex-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
}

table th {
  background: var(--table-header-bg);
  color: var(--table-header-text);
  padding: 8px;
  text-align: left;
  font-weight: bold;
  font-size: 11.5px;
  border: 1px solid var(--table-border);
  overflow-wrap: normal;
  word-break: normal;
}

table td {
  padding: 6px 8px;
  border: 1px solid var(--table-border);
  font-size: 11.5px;
  line-height: 1.42;
  background: var(--bg-main);
  overflow-wrap: normal;
  word-break: normal;
}

table tr:nth-child(odd) td {
  background: var(--table-row-odd);
}

table tr:nth-child(even) td {
  background: var(--table-row-even);
}

table tr:hover td {
  opacity: 0.95;
}

table a {
  color: var(--a-text);
  text-decoration: none;
}

table a:hover {
  text-decoration: underline;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
  background: var(--bg-secondary);
  border: 1px solid var(--stats-border);
  color: var(--text-primary);
  font-family: 'Tahoma', Arial, sans-serif;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 2px;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  background: var(--bg-main);
  border-color: var(--stats-value);
  outline: none;
  box-shadow: 0 0 3px rgba(0,0,0,0.2);
}

input[type="submit"],
input[type="button"],
input[type="reset"],
button {
  background: linear-gradient(180deg, 
    var(--nav-border-light), 
    var(--btn-bg));
  border-left: 1px solid var(--nav-border-light);
  border-top: 1px solid var(--nav-border-light);
  border-right: 1px solid var(--btn-hover);
  border-bottom: 1px solid var(--btn-hover);
  color: var(--btn-text);
  cursor: pointer;
  font-size: 12px;
  margin: 0 auto;
  display: block;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -1px 0 rgba(0,0,0,0.2);
  transition: all 0.25s ease;
}

input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
button:hover {
  background: linear-gradient(180deg, 
    var(--nav-bg),
    var(--btn-hover));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), inset 0 -1px 0 rgba(0,0,0,0.3);
}

input[type="submit"]:active,
input[type="button"]:active,
input[type="reset"]:active,
button:active {
  background: var(--btn-hover);
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.3), inset 0 -1px 0 rgba(255,255,255,0.1);
}

/* ============================================
   FOOTER
   ============================================ */
.footer-meta {
  color: var(--footer-text);
  font-size: 10.5px;
  padding: 8px 12px;
  text-align: center;
  border-top: 1px solid var(--stats-border);
  margin-top: 8px;
  border-bottom: 1px solid #000;
  background: var(--bg-main);
}

.starter-panel {
  max-width: 900px;
  margin: 0 auto;
}

.starter-copy {
  margin: 8px 0 16px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.starter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.starter-card {
  background: var(--bg-secondary);
  border: 1px solid var(--table-border);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.starter-card-header {
  display: flex;
  gap: 10px;
  align-items: center;
}

.starter-name {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-primary);
}

.starter-type {
  color: var(--text-light);
  font-size: 11px;
}

.starter-tagline {
  color: var(--stats-value);
  font-weight: bold;
  line-height: 1.4;
}

.starter-desc {
  color: var(--text-secondary);
  line-height: 1.5;
  min-height: 72px;
}

.travel-panel {
  max-width: 920px;
  margin: 0 auto;
}

.travel-copy {
  margin: 8px 0 16px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.travel-table td,
.travel-table th {
  vertical-align: top;
}

.travel-badge {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--stats-border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: bold;
}

.travel-badge.current {
  color: #1d6b3a;
}

.travel-badge.locked {
  color: #8a4b13;
}

.rookie-tutorial-shell {
  position: fixed;
  top: 16px;
  left: 16px;
  right: auto;
  z-index: 1200;
  pointer-events: auto;
}

.rookie-tutorial-shell.is-docked-right {
  right: 16px;
  left: auto;
}

.rookie-tutorial-shell.is-docked-bottom {
  top: auto;
  bottom: 10px;
}

.rookie-tutorial-card {
  display: flex;
  gap: 12px;
  max-width: 500px;
  align-items: flex-start;
}

.rookie-tutorial-shell.is-flipped .rookie-tutorial-card {
  flex-direction: row-reverse;
}

.rookie-tutorial-portrait {
  display: block;
  width: 90px;
  height: 90px;
  border: 2px solid var(--table-border);
  background: var(--bg-main);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}

.rookie-tutorial-bubble {
  position: relative;
  flex: 1;
  padding: 12px 14px;
  border: 2px solid var(--table-border);
  background: var(--notice-bg);
  box-shadow: 0 14px 28px rgba(0,0,0,0.35);
  line-height: 1.55;
}

.rookie-tutorial-bubble::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 22px;
  width: 18px;
  height: 18px;
  background: var(--notice-bg);
  border-left: 2px solid var(--table-border);
  border-bottom: 2px solid var(--table-border);
  transform: rotate(45deg);
}

.rookie-tutorial-shell.is-flipped .rookie-tutorial-bubble::before {
  right: -10px;
  left: auto;
  border: 0;
  border-top: 2px solid var(--table-border);
  border-right: 2px solid var(--table-border);
}

.rookie-tutorial-progress {
  margin-bottom: 4px;
  color: var(--text-light);
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rookie-tutorial-bubble h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.rookie-tutorial-bubble p {
  margin: 0;
}

.rookie-tutorial-actions {
  margin-top: 10px;
}

.rookie-tutorial-scrim {
  position: fixed;
  background: rgb(0 0 0 / 35%);
  z-index: 1000;
  pointer-events: none;
}

.rookie-tutorial-active .rookie-tutorial-shell {
  z-index: 1200;
}

.rookie-tutorial-active .tutorial-reward-card {
  position: relative;
  z-index: 1002;
}

.rookie-tutorial-active .nav-group:has(.tutorial-target) {
  z-index: 1100;
}

.rookie-tutorial-active .nav-group:has(.tutorial-target) .nav-dropdown {
  z-index: 1101;
}

.rookie-tutorial-active .tutorial-target {
  position: relative;
  border-color: #f0d27a !important;
  outline: 3px solid rgba(240, 210, 122, 0.8);
  outline-offset: 3px;
  box-shadow: 0 0 18px rgba(240, 210, 122, 0.9);
  animation: rookiePulse 1.2s ease-in-out infinite alternate;
}

.rookie-tutorial-active form.tutorial-target,
.rookie-tutorial-active a.tutorial-target {
  display: inline-block;
}

@keyframes rookiePulse {
  from {
    transform: translateZ(0);
  }
  to {
    transform: translateY(-1px);
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .app-shell {
    max-width: 100%;
    border-left: none;
    border-right: none;
  }

  .player-strip-bars {
    grid-template-columns: 1fr;
  }

  .player-strip-bars.is-collapsed {
    display: none;
  }

  .nav-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 6px;
  }

  .nav-group {
    display: block;
    width: 100%;
  }

  .nav-promo,
  .nav-support {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }

  .nav-menu > .nav-promo {
    grid-column: auto;
  }

  .nav-menu > .nav-support {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .nav-menu > .nav-promo + .nav-support {
    grid-column: auto;
  }

  .nav-promo a,
  .nav-support a {
    display: block;
  }

  .donator-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .pokemon-farm-toolbar,
  .pokemon-farm-search {
    align-items: stretch;
  }

  .pokemon-farm-search {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .pokemon-release-search-form {
    grid-template-columns: 1fr;
  }

  .pokemon-farm-search label {
    width: auto;
  }

  .pokemon-farm-search input[type="text"],
  .pokemon-farm-search select,
  .pokemon-farm-search input[type="submit"],
  .pokemon-farm-search button {
    width: 100%;
  }

  .pokemon-farm-filter-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mail-compose-form table,
  .mail-compose-form tbody,
  .mail-compose-form tr,
  .mail-compose-form td {
    display: block;
    width: 100% !important;
  }

  .mail-compose-form table {
    border: 1px solid var(--table-border);
  }

  .mail-compose-form td {
    border-left: 0;
    border-right: 0;
  }

  .mail-compose-form tr td:first-child {
    padding-bottom: 3px;
    color: var(--stats-label);
    font-weight: bold;
  }

  .mail-compose-form tr td:last-child {
    padding-top: 3px;
  }

  .mail-compose-form input[type="text"],
  .mail-compose-form select,
  .mail-compose-form textarea {
    width: 100%;
    max-width: 100%;
  }

  .game-panel-body > table:not(.responsive-card-table),
  .table-responsive > table:not(.responsive-card-table) {
    min-width: 560px;
  }

  .paypal-like-button-label {
    font-size: 16px;
  }

  .controls-bar {
    position: static;
    justify-content: flex-end;
    padding: 8px;
    background: rgba(0,0,0,0.18);
  }

  .app-banner {
    display: block;
    min-height: 0;
  }

  .nav-trigger {
    width: 100%;
    padding: 6px 10px;
    font-size: 11px;
  }

  .nav-dropdown {
    position: absolute;
    left: 0;
    min-width: 100%;
    width: min(280px, calc(100vw - 20px));
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  }

  .nav-group:nth-child(even) .nav-dropdown {
    right: 0;
    left: auto;
  }

  .player-strip-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .player-stat {
    display: block;
    margin-right: 0;
    margin-bottom: 0;
  }

  .player-stat-logout {
    margin-left: 0 !important;
  }

  .player-strip-spacer {
    display: none;
  }

  .player-pokemon-chip {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-left: 0;
  }

  .status-chip-header {
    font-size: 11px;
  }

  .content-pane {
    padding: 12px;
  }

  .info-grid,
  .directory-grid {
    grid-template-columns: 1fr;
  }

  .online-layout {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .guide-list {
    grid-template-columns: 1fr;
  }

  .guide-list dt {
    border-bottom: 0;
  }

  .form-actions {
    grid-column: auto;
  }

  .staff-shell {
    grid-template-columns: 1fr;
  }

  .rookie-tutorial-shell {
    top: 10px;
    left: 10px;
    right: auto;
  }

  .rookie-tutorial-shell.is-docked-right {
    right: 10px;
    left: auto;
  }

  .rookie-tutorial-card {
    max-width: none;
    width: min(440px, calc(100vw - 20px));
    align-items: stretch;
  }

  .battle-tent-opponents,
  .battle-tent-opponents tbody {
    display: block;
    width: 100%;
  }

  .battle-tent-opponents {
    background: transparent;
  }

  .battle-tent-opponents > tbody > tr:first-child {
    display: none;
  }

  .battle-tent-opponents > tbody > tr:not(:first-child) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 12px;
    border: 1px solid var(--table-border);
    background: var(--bg-main);
  }

  .battle-tent-opponents > tbody > tr:not(:first-child) > td {
    display: block;
    min-width: 0;
    padding: 8px;
    border: 0;
    border-right: 1px solid var(--table-border);
    border-bottom: 1px solid var(--table-border);
    overflow-wrap: anywhere;
  }

  .battle-tent-opponents > tbody > tr:not(:first-child) > td:nth-child(even) {
    border-right: 0;
  }

  .battle-tent-opponents > tbody > tr:not(:first-child) > td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .battle-tent-opponents .battle-tent-trainer,
  .battle-tent-opponents .battle-tent-challenge {
    grid-column: 1 / -1;
    border-right: 0 !important;
  }

  .battle-tent-opponents .battle-tent-trainer {
    background: var(--bg-secondary) !important;
  }

  .battle-tent-opponents .battle-tent-pokemon img {
    vertical-align: middle;
  }

  .battle-tent-opponents .battle-tent-challenge {
    border-bottom: 0 !important;
  }

  .battle-tent-opponents .battle-tent-challenge form,
  .battle-tent-opponents .battle-tent-challenge select,
  .battle-tent-opponents .battle-tent-challenge input[type="submit"] {
    width: 100%;
    max-width: none;
  }

  .battle-tent-opponents .battle-tent-challenge select {
    margin-bottom: 7px;
  }

  .responsive-card-table,
  .responsive-card-table tbody {
    display: block;
    width: 100%;
  }

  .responsive-card-table {
    background: transparent;
  }

  .responsive-card-table > tbody > tr:first-child {
    display: none;
  }

  .responsive-card-table > tbody > tr:not(:first-child) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 12px;
    border: 1px solid var(--table-border);
    background: var(--bg-main);
  }

  .responsive-card-table > tbody > tr:not(:first-child) > td {
    display: block;
    min-width: 0;
    padding: 8px;
    border: 0;
    border-bottom: 1px solid var(--table-border);
    overflow-wrap: break-word;
  }

  .responsive-card-table > tbody > tr:not(:first-child) > td:nth-child(odd):not(:first-child) {
    border-left: 1px solid var(--table-border);
  }

  .responsive-card-table > tbody > tr:not(:first-child) > td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--text-light);
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .responsive-card-table .card-table-section {
    display: block !important;
    margin: 14px 0 6px !important;
    border: 0 !important;
  }

  .responsive-card-table .card-table-section td,
  .responsive-card-table .card-table-section th {
    border: 0 !important;
    background: var(--table-header-bg) !important;
    color: var(--table-header-text);
    font-weight: bold;
  }

  .responsive-card-table .card-table-section td::before,
  .responsive-card-table .card-table-section th::before {
    display: none;
  }

  .responsive-card-table > tbody > tr:not(:first-child) > td:first-child,
  .responsive-card-table .card-table-action {
    grid-column: 1 / -1;
    border-left: 0 !important;
    border-right: 0 !important;
  }

  .responsive-card-table .card-table-action {
    border-bottom: 0 !important;
  }

  .gang-events-table > tbody > tr:not(:first-child) > td,
  .gang-attack-log-table > tbody > tr:not(:first-child) > td {
    grid-column: 1 / -1;
    border-left: 0 !important;
  }

  .responsive-card-table .card-table-action form,
  .responsive-card-table .card-table-action select,
  .responsive-card-table .card-table-action input[type="submit"],
  .responsive-card-table .card-table-action .action-link {
    width: 100%;
    max-width: none;
  }

  .shop-stock-table .card-table-action,
  .item-market-table .card-table-action,
  .travel-table .card-table-action {
    grid-column: 1 / -1;
    border-left: 0 !important;
  }

  .shop-stock-table .card-table-action form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
  }

  .shop-stock-table .card-table-action label {
    display: grid;
    gap: 3px;
  }

  .shop-stock-table .card-table-action input[type="text"] {
    width: 100%;
  }

  .item-market-table .card-table-action {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
  }

  .item-market-table .card-table-action a,
  .travel-table .card-table-action a,
  .travel-table .card-table-action span {
    display: inline-block;
    width: auto;
  }

  .pokemon-farm-table .pokemon-farm-sprite {
    grid-column: auto !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-left: 0 !important;
  }

  .pokemon-farm-table .pokemon-farm-name {
    grid-column: auto;
    border-left: 1px solid var(--table-border) !important;
  }

  .pokedex-pokemon-cell {
    grid-column: 1 / -1;
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    border-left: 0 !important;
  }

  .pokedex-pokemon-cell::before {
    flex: 0 0 100%;
  }

  .pokedex-pokemon-icon {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
  }

  .pokedex-pokemon-name {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .pokemon-farm-table > tbody > tr:not(:first-child) > td:nth-child(odd):not(:first-child) {
    border-left: 0;
  }

  .pokemon-farm-table > tbody > tr:not(:first-child) > td:nth-child(even) {
    border-left: 1px solid var(--table-border);
  }

  .responsive-profile-table,
  .responsive-profile-table tbody {
    display: block;
    width: 100%;
  }

  .responsive-profile-table > tbody > .profile-section-head {
    display: none;
  }

  .responsive-profile-table > tbody > tr:not(.profile-section-head) {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 8px;
  }

  .responsive-profile-table > tbody > tr:not(.profile-section-head) > td {
    display: block;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--table-border);
    overflow-wrap: anywhere;
  }

  .responsive-profile-table > tbody > tr:not(.profile-section-head) > td::before {
    content: attr(data-label);
    display: block;
    margin: -10px -10px 9px;
    padding: 6px 8px;
    background: var(--table-header-bg);
    color: var(--table-header-text);
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
  }

  .responsive-profile-table .profile-picture-cell img {
    display: block;
    max-width: 150px;
    height: auto !important;
    margin: 0 auto;
  }

  .profile-action-cell a {
    display: inline-block;
    margin-bottom: 5px;
    padding: 5px 7px;
    border: 1px solid var(--table-border);
    background: var(--bg-secondary);
  }

  .page-action-nav .action-link,
  .gang-subnav-link {
    flex: 1 1 128px;
    text-align: center;
  }

  .pokemon-farm-toolbar .gang-subnav-link {
    flex: 0 0 auto;
  }

  .gang-application-actions {
    white-space: normal;
  }

  .gang-application-actions form {
    display: block;
    margin: 0 0 7px;
  }

  .gang-application-actions form:last-child {
    margin-bottom: 0;
  }
}

@media (max-width: 480px) {
  .tutorial-reward-card {
    align-items: flex-start;
    gap: 9px;
    padding: 9px;
  }

  .tutorial-reward-sprite {
    flex-basis: 68px;
    min-height: 68px;
  }

  .tutorial-reward-sprite img {
    width: 58px;
    height: 58px;
  }

  .tutorial-reward-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tutorial-reward-item {
    min-width: 0;
  }

  .rookie-tutorial-shell {
    right: 10px;
    left: 10px;
  }

  .rookie-tutorial-shell.is-docked-right {
    right: 10px;
    left: 10px;
  }

  .rookie-tutorial-card {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .rookie-tutorial-shell.is-flipped .rookie-tutorial-card {
    flex-direction: column;
  }

  .rookie-tutorial-portrait {
    width: 72px;
    height: 72px;
  }

  .rookie-tutorial-bubble::before {
    left: 24px;
    top: -10px;
    border-left: 2px solid var(--table-border);
    border-top: 2px solid var(--table-border);
    border-bottom: 0;
    transform: rotate(45deg);
  }

  .rookie-tutorial-shell.is-flipped .rookie-tutorial-bubble::before {
    right: 24px;
    left: auto;
    top: -10px;
    border: 0;
    border-top: 2px solid var(--table-border);
    border-left: 2px solid var(--table-border);
  }
}
