/* =====================================================
   CSS CUSTOM PROPERTIES
   ===================================================== */
:root {
  --font-base: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --color-bg:           #2d3748;
  --color-bg-dark:      #1a202c;
  --color-bg-medium:    #374151;
  --color-surface:      #4a5568;
  --color-accent:       #63b3ed;
  --color-accent-light: #90cdf4;
  --color-text:         #e2e8f0;
  --color-text-muted:   #a0aec0;
  --color-border:       rgba(99, 179, 237, 0.2);
  --color-success:      #2ed573;
  --color-error:        #ff4757;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --shadow-sm:   0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg:   0 8px 24px rgba(0, 0, 0, 0.4);
  --ease-out:    cubic-bezier(0.23, 1, 0.320, 1);
  --ease-in:     cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-base);
}

/* Force form elements to use the page font (browsers override * for these) */
input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

html,
body {
  height: 100%;
}

body {
  background-color: #2d3748;
  background-image: radial-gradient(rgba(99, 179, 237, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  color: #e2e8f0;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  scroll-behavior: smooth;
}

.container {
  flex: 1 0 auto; /* This allows the container to grow */
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  color: #e2e8f0;
  padding: 1.5rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

header::after {
  display: none;
}

/* headerShimmer keyframe removed — purely decorative */

.header-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1,
h2,
h3,
h4 {
  margin-bottom: 1.5rem;
  color: #e2e8f0;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.header-tagline {
  color: #a0aec0;
  font-size: 0.95rem;
  font-weight: 400;
  opacity: 0.85;
  letter-spacing: 0.5px;
  margin: 0;
}

/* Override generics for header h1 (must come after generic h1 rule) */
header h1 {
  font-family: var(--font-base);
  font-size: clamp(1rem, 4.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.25px;
  margin-bottom: 0.6rem;
  margin-top: 0;
  color: #e2e8f0;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: break-word;
  text-wrap: balance;
}

h2 {
  font-size: 1.7rem;
  color: var(--color-accent-light);
  margin-bottom: 2rem;
  text-align: center;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(99, 179, 237, 0.15);
}

/* Card styles for events and stages */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 30px;
  margin-bottom: 20px;
}

.card {
  background: linear-gradient(135deg, #4a5568 0%, #3d4558 100%);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid rgba(99, 179, 237, 0.2);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.7;
  z-index: 0;
}

.card-content {
  position: relative;
  z-index: 1;
}

.card h3 {
  color: #e2e8f0;
  background-color: rgba(26, 32, 44, 0.8);
  padding: 12px 15px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  border-color: rgba(99, 179, 237, 0.5);
}

/* Event image styling */
.event-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

/* Form styles for enemy calculator */
#enemy-forms-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-top: 20px;
  width: 100%;
  padding: 0;
  will-change: opacity;
}

#enemy-forms-container > h3 {
  grid-column: 1 / -1;
  margin-bottom: 10px;
  text-align: left;
}

.enemy-form {
  background: linear-gradient(135deg, #4a5568 0%, #3d4558 100%);
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 280px;
  max-width: 340px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.enemy-form h3 {
  margin-bottom: 15px;
  color: #e2e8f0;
}

.enemy-image-container {
  position: relative;
  width: 125px; /* slightly larger than before to show details */
  height: 125px;
  margin: 0 auto 10px;
  border-radius: 8px;
  overflow: visible; /* allows icons to display outside container */
}
.enemy-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 79%;
  height: 79%;
  object-fit: cover;
  z-index: 1;
}

.enemy-image {
  position: absolute;
  top: 45.7%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}

.enemy-type {
  position: absolute;
  top: -4%;
  right: -4%;
  width: 39%;
  height: 39%;
  z-index: 3;
  object-fit: contain;
}
.enemy-rarity {
  position: absolute;
  bottom: 2%;
  left: -20%;
  width: 80%;
  height: 42%;
  z-index: 3;
  object-fit: contain;
}

.form-group {
  margin-bottom: 10px;
  padding: 10px 8px;
  background: rgba(74, 85, 104, 0.3);
  border-radius: 8px;
  border-left: 3px solid #63b3ed;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  text-align: center;
  width: 100%;
  color: #90cdf4;
  letter-spacing: 0.3px;
  font-size: 0.9rem;
}

.form-group input {
  padding: 8px;
  font-size: 0.9rem;
  background-color: #2d3748;
  color: #e2e8f0;
  border: 1px solid #718096;
}

.form-group input[type="number"] {
  width: 80%;
  max-width: 200px;
  padding: 8px;
  border: 1px solid #718096;
  border-radius: 4px;
  text-align: center;
  background-color: #2d3748;
  color: #e2e8f0;
}

.form-group input[type="number"]:focus {
  border-color: #63b3ed;
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.2);
  background-color: #2d3748;
}

/* Remove default browser styles for inputs */
input[type="number"] {
  -webkit-appearance: none;
  -moz-appearance: textfield;
  appearance: none;
}

/* Remove spinner buttons in Webkit browsers */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #90cdf4;
  letter-spacing: 0.2px;
}

input,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #4a5568;
  border-radius: 6px;
  background-color: #2d3748;
  color: #e2e8f0;
  font-size: 0.95rem;
  /* iOS/Android: prevent zoom on focus */
  font-size: max(16px, 0.95rem);
}

input:focus,
select:focus {
  outline: none;
  border-color: #63b3ed;
  background-color: #374151;
}

.result {
  background: linear-gradient(135deg, #2d3748 0%, #374151 100%);
  padding: 15px 20px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-weight: 600;
  text-align: center;
  width: 90%;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.95rem;
  color: #e2e8f0;
  border: 1.5px solid #63b3ed;
  box-shadow: 0 4px 12px rgba(99, 179, 237, 0.15);
}

/* Navigation */
.breadcrumb {
  margin-bottom: 30px;
  font-size: 0.9rem;
  color: #e2e8f0;
  padding: 12px 16px;
  background: rgba(74, 85, 104, 0.3);
  border-radius: 6px;
  border: 1px solid rgba(99, 179, 237, 0.2);
  display: inline-block;
}

.breadcrumb a {
  color: #63b3ed;
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover {
  color: #90cdf4;
  text-shadow: 0 0 8px rgba(99, 179, 237, 0.3);
}

.breadcrumb a:active {
  color: #3182ce;
  text-shadow: 0 0 4px rgba(99, 179, 237, 0.2);
}

/* Notice box for tips (enemy page only) */
.notice-box {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(45, 182, 157, 0.08);
  border-left: 3px solid #2db69d;
  border-radius: 4px;
  border: 1px solid rgba(45, 182, 157, 0.2);
  color: #cbd5e0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.notice-box p {
  margin: 0;
}

.notice-box a {
  color: #63b3ed;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.notice-box a:hover {
  color: #90cdf4;
  text-decoration: underline;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  padding: 8px 16px;
  background: transparent;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
}

.back-button:hover {
  background: rgba(99, 179, 237, 0.07);
  border-color: rgba(99, 179, 237, 0.4);
  color: var(--color-accent-light);
  transform: none;
  box-shadow: none;
}

.back-button:active {
  background: rgba(99, 179, 237, 0.12);
  transform: none;
  box-shadow: none;
}

.results-container {
  margin-top: 25px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(99, 179, 237, 0.1) 0%, rgba(72, 187, 237, 0.08) 100%);
  border-radius: 8px;
  border: 1px solid rgba(99, 179, 237, 0.2);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Event card specific styles */
.card[style*="background-image"] {
  background-size: cover;
  background-position: center;
  min-height: 200px;
}

/* Stage card specific styles (smaller, no image) */
.stage-card {
  min-height: 120px;
  justify-content: center;
  text-align: center;
}

/* Adjust card grid for different card types */
.card-grid .card:not([style*="background-image"]) {
  min-height: 120px;
  justify-content: center;
}

.event-card {
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  width: 92%;
  max-width: 320px;
  aspect-ratio: 852 / 610 !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  position: relative;
  text-align: center;
  overflow: hidden;
  justify-self: center;
}

.event-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.35) 100%
  );
  z-index: 0;
}

.event-card .card-content {
  z-index: 1;
  width: 0;
  height: 0;
  padding: 0;
  display: none;
  padding: 15px;
}

.event-card h3 {
  color: white;
  background-color: rgba(26, 32, 44, 0.6);
  padding: 12px 20px;
  border-radius: 4px;
  margin: 0;
  text-align: center;
  width: auto;
  display: inline-block;
}

/* Regular cards (stages) */
.card:not(.event-card) {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 25px 20px;
  background: linear-gradient(135deg, #4a5568 0%, #3d4558 100%);
  border: 1px solid #5a6a7a;
}

.card:not(.event-card) h3 {
  margin: 0;
  width: 100%;
  line-height: 1.4;
  color: #e2e8f0;
  font-size: 1.1rem;
  font-weight: 600;
}

.card:not(.event-card):hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #5a6a7a 0%, #4d5d6d 100%);
}

/* Search bar styles */
.search-bar-wrapper {
  margin-bottom: 25px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  width: 90%;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  font-size: max(16px, 0.95rem);
  border: 1.5px solid #4a5568;
  border-radius: 6px;
  background-color: #2d3748;
  color: #e2e8f0;
}

.search-input::placeholder {
  color: #718096;
}

.search-input:focus {
  outline: none;
  border-color: #63b3ed;
  background-color: #374151;
}

/* Fade-in animation for search results — removed for performance */

/* Custom tooltip styling */
.card {
  position: relative;
  overflow: visible;
}

.card-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #1a202c;
  color: #f7fafc;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 1000;
  margin-bottom: 8px;
  border: 1.5px solid #4a5568;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.card-tooltip::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1a202c;
}

.card:hover .card-tooltip {
  opacity: 1;
}

/* Enemy forms container section heading */
#enemy-forms-container h3 {
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #63b3ed;
  color: #e2e8f0;
}

/* Checkbox input styles */
input[type="checkbox"] {
  width: 20px !important;
  height: 20px;
  margin: 0 auto;
  display: block;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: 2px solid #63b3ed;
  border-radius: 3px;
  outline: none;
  position: relative;
  background-color: #2d3748;
}

input[type="checkbox"]:hover {
  border-color: #90cdf4;
  box-shadow: 0 0 8px rgba(99, 179, 237, 0.2);
}

input[type="checkbox"]:checked {
  background-color: #63b3ed;
  border-color: #63b3ed;
  box-shadow: 0 0 8px rgba(99, 179, 237, 0.3);
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 10px;
  border: solid #2d3748;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Multiple enemy layout */
.enemy-form-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.enemy-form h4 {
  margin-bottom: 15px;
  text-align: center;
  width: 100%;
  color: #e2e8f0;
}

/* Footer styling */
footer {
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  padding: 2.5rem 2rem;
  text-align: center;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin-top: 4rem;
  opacity: 1;
  will-change: auto;
}

footer p {
  color: #a0aec0;
  margin: 0.5rem 0;
  line-height: 1.6;
  font-size: 0.9rem;
}

/* Improved animation system */
.content-container {
  position: relative;
  min-height: 400px;
  overflow: hidden;
}

.page-content {
  opacity: 0;
  transition: opacity 0.3s ease;
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
}

.page-content.active {
  opacity: 1;
  position: relative;
}

/* Remove outline from all input elements */
input:focus,
input:active,
select:focus,
select:active,
textarea:focus,
textarea:active {
  outline: none !important;
  box-shadow: none !important;
}

/* ===== HEADER CONTROLS ===== */
.header-controls {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  gap: 12px;
  z-index: 100;
}

.header-btn {
  background: rgba(99, 179, 237, 0.15);
  border: 1px solid rgba(99, 179, 237, 0.3);
  color: var(--color-accent);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
}

.header-btn:hover {
  background: rgba(99, 179, 237, 0.25);
  border-color: rgba(99, 179, 237, 0.5);
}

.header-btn:active {
  opacity: 0.85;
}

/* ===== PHASE TABS ===== */
.phase-tabs-container {
  display: flex;
  gap: 0;
  margin-bottom: 25px;
  padding: 0;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--color-border);
  border-radius: 0;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  box-shadow: none;
  position: relative;
  flex-wrap: wrap;
}

/* ===== RESULTS CARD ===== */
.results-card {
  background: linear-gradient(135deg, rgba(99, 179, 237, 0.1) 0%, rgba(72, 187, 237, 0.08) 100%);
  border: 2px solid var(--color-accent);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  margin-top: 10px;
  box-shadow: 0 4px 16px rgba(99, 179, 237, 0.12);
}

.results-card h3 {
  font-size: 1rem;
  color: var(--color-accent-light);
  margin-bottom: 10px;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.results-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.result-value {
  background: rgba(26, 32, 44, 0.6);
  border-left: 4px solid var(--color-accent);
  padding: 10px;
  border-radius: 6px;
  text-align: center;
}

.result-value-label {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-value-amount {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-accent);
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
}

/* ===== RESULTS ACTIONS ===== */
.results-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
}

.btn-copy-results,
.btn-download-results,
.btn-favorite {
  padding: 11px 18px;
  background: rgba(99, 179, 237, 0.15);
  border: 1.5px solid var(--color-accent);
  color: var(--color-accent);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.2px;
  user-select: none;
}

.btn-copy-results:hover,
.btn-download-results:hover,
.btn-favorite:hover {
  background: rgba(99, 179, 237, 0.25);
  border-color: var(--color-accent-light);
  color: var(--color-accent-light);
}

.btn-copy-results:active,
.btn-download-results:active {
  transform: translateY(0);
}

.btn-copy-results:disabled,
.btn-download-results:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-copy-results:disabled:hover,
.btn-download-results:disabled:hover {
  background: rgba(99, 179, 237, 0.15);
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: none;
}

.btn-favorite.favorited {
  background: linear-gradient(135deg, rgba(255, 71, 87, 0.2) 0%, rgba(255, 107, 107, 0.15) 100%);
  border-color: #ff4757;
  color: #ff6b6b;
}

.btn-favorite.favorited:hover {
  background: linear-gradient(135deg, rgba(255, 71, 87, 0.3) 0%, rgba(255, 107, 107, 0.25) 100%);
}

.btn-copy-results.copied {
  background: rgba(46, 213, 115, 0.2);
  border-color: var(--color-success);
  color: var(--color-success);
}

/* ===== FAVORITE STAR ICON ===== */
.favorite-icon {
  display: inline-block;
  font-size: 1.1em;
}

/* ===== TUTORIAL OVERLAY ===== */
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.tutorial-content {
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  border-radius: 16px;
  padding: 40px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.tutorial-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-close:hover {
  color: var(--color-accent);
}

.tutorial-content h2 {
  font-size: 1.8rem;
  margin-bottom: 25px;
  color: var(--color-accent-light);
  border: none;
  padding: 0;
}

.tutorial-steps {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
}

.tutorial-step {
  display: flex;
  gap: 15px;
  padding: 12px;
  background: rgba(99, 179, 237, 0.1);
  border-radius: 8px;
  border-left: 3px solid var(--color-accent);
}

.step-number {
  min-width: 32px;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: #1a202c;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.tutorial-step p {
  margin: 0;
  color: var(--color-text);
  line-height: 1.5;
}

.tutorial-start {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #63b3ed 0%, #4b93d4 100%);
  border: none;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
}

/* ===== ADVANCED SEARCH FILTERS ===== */
.search-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(74, 85, 104, 0.3);
  border-radius: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0;
  font-weight: 500;
}

.filter-group select {
  padding: 6px 10px;
  font-size: 0.85rem;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text);
  cursor: pointer;
}

.filter-group select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 8px rgba(99, 179, 237, 0.2);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .header-controls {
    gap: 8px;
  }

  .results-values {
    grid-template-columns: 1fr;
  }

  .results-card {
    padding: 20px;
  }

  .phase-tabs-container {
    gap: 6px;
    margin-bottom: 15px;
  }

  .phase-tab {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .search-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
  }

  .filter-group select {
    width: 100%;
  }
}

/* Placeholder styling */
input::placeholder {
  color: #a0aec0;
  opacity: 0.7;
}

/* Remove spinner buttons from number inputs */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* Favorite button styling */
.favorite-btn {
  background: none !important;
  border: none !important;
  cursor: pointer;
  font-size: 1.3rem;
  padding: 0 !important;
  color: var(--color-text-muted);
  transition: all 0.3s var(--ease-out) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
}

.favorite-btn:hover {
  color: #ff4757;
  transform: scale(1.2);
  box-shadow: none !important;
}

.favorite-btn.favorited {
  color: #ff4757;
}

/* Animation/helper classes — transitions removed for mobile performance */
.fade-in {}
.fade-out {}
.slide-in-right {}
.slide-out-left {}
.scale-in {}

/* Keyframes — all removed for mobile performance */

/* ===== CHARACTER PANEL INPUTS (mobile-friendly) ===== */
.character-inputs-section select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2363b3ed' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  cursor: pointer;
  min-height: 40px;
  /* prevent iOS auto-zoom on focus */
  font-size: max(16px, 0.9rem);
  touch-action: manipulation;
}

.character-inputs-section input[type="number"] {
  min-height: 40px;
  font-size: max(16px, 0.9rem);
  touch-action: manipulation;
  padding: 8px 10px;
}

@media (max-width: 576px) {
  .character-inputs-section select,
  .character-inputs-section input[type="number"] {
    min-height: 36px;
    padding: 5px 8px;
    font-size: max(16px, 0.82rem);
  }

  .character-inputs-section label {
    font-size: 0.72rem !important;
  }
}

/* ===== PHASE FAVORITES SECTION ===== */
.phase-favorites-section {
  margin-bottom: 25px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(99, 179, 237, 0.08) 0%, rgba(72, 187, 237, 0.06) 100%);
  border: 1.5px solid rgba(99, 179, 237, 0.25);
  border-radius: 12px;
}

.phase-favorites-section h3 {
  margin: 0 0 12px 0;
  color: #90cdf4;
  font-size: 0.95rem;
  letter-spacing: 0.4px;
  font-weight: 600;
}

.phase-favorites-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.phase-favorite-link {
  padding: 10px 14px;
  background: rgba(99, 179, 237, 0.1);
  border: 1px solid rgba(99, 179, 237, 0.3);
  border-radius: 6px;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

.phase-favorite-link:hover {
  background: rgba(99, 179, 237, 0.2);
  border-color: rgba(99, 179, 237, 0.5);
  color: var(--color-accent-light);
  transform: translateX(4px);
}

.phase-favorite-link:active {
  transform: translateX(2px);
}

/* ===== PHASE TABS (MINIMAL) ===== */
.phase-tabs-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 25px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  position: relative;
}

/* Single-row layout for phases */
.phases-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.phase-tab {
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(99, 179, 237, 0.2);
  color: var(--color-text-muted);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.4px;
  user-select: none;
  flex-shrink: 0;
  position: relative;
  white-space: nowrap;
}

.phase-tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  border-bottom-width: 3px;
  padding-bottom: 9px;
}

/* Phase tab group - container for tab, button, and help icon */
.phase-tab-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 8px;
  width: 100%;
}

/* Button group for favorites - positioned on the right */
.phase-button-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Favorite button for phases */
.phase-favorite-btn {
  padding: 6px 12px;
  background: rgba(99, 179, 237, 0.1);
  border: 1px solid rgba(99, 179, 237, 0.3);
  border-radius: 6px;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
}

.phase-favorite-btn:hover {
  background: rgba(99, 179, 237, 0.2);
  border-color: rgba(99, 179, 237, 0.5);
  color: var(--color-accent-light);
}

.phase-favorite-btn:active {
  opacity: 0.85;
}

/* Help icon for favorite button */
.phase-favorite-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1.5px solid rgba(99, 179, 237, 0.4);
  border-radius: 50%;
  background: rgba(99, 179, 237, 0.08);
  color: var(--color-text-muted);
  cursor: help;
  font-size: 0.8rem;
  font-weight: 600;
  user-select: none;
}

.phase-favorite-help:hover {
  background: rgba(99, 179, 237, 0.15);
  border-color: rgba(99, 179, 237, 0.6);
  color: var(--color-accent-light);
}

/* New help icon button style */
.phase-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1.5px solid rgba(99, 179, 237, 0.4);
  border-radius: 50%;
  background: rgba(99, 179, 237, 0.08);
  color: var(--color-text-muted);
  font-size: 1rem;
  font-weight: 600;
  user-select: none;
  flex-shrink: 0;
}

.phase-help-icon:hover {
  background: rgba(99, 179, 237, 0.15);
  border-color: rgba(99, 179, 237, 0.6);
  color: var(--color-accent-light);
}

.export-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 14px 20px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 10000;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

.export-notification.success {
  background: linear-gradient(135deg, #2ed573 0%, #1db85f 100%);
  color: white;
}

.export-notification.error {
  background: linear-gradient(135deg, #ff4757 0%, #e84444 100%);
  color: white;
}

/* Ensure content container has relative positioning for animations */
#content {
  position: relative;
  min-height: 400px; /* Adjust based on your content */
}

/* Animation container for page transitions */
.animation-container {
  position: relative;
  width: 100%;
}

/* Input validation styles */
.form-input.valid {
  border-color: #2ed573;
}

.form-input.invalid {
  border-color: #ff4757;
}

/* Smooth transition for border color */
.form-input {
  transition: border-color 0.3s cubic-bezier(0.23, 1, 0.320, 1);
}

/* Custom focus styles for better accessibility */
.form-input:focus {
  border-color: #63b3ed;
  box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.3);
}

.form-checkbox:focus {
  box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.3);
}

/* =====================================================
   SKIP LINK (accessibility)
   ===================================================== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.6rem 1.2rem;
  background: #63b3ed;
  color: #1a202c;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid #1a202c;
  outline-offset: 2px;
}

/* =====================================================
   FOCUS-VISIBLE (keyboard focus only, not mouse)
   ===================================================== */
:focus-visible {
  outline: 2px solid #63b3ed;
  outline-offset: 3px;
  border-radius: 3px;
}
*:focus:not(:focus-visible) {
  outline: none;
}

/* =====================================================
   FOOTER ENHANCEMENTS
   ===================================================== */
footer {
  position: relative;
  overflow: hidden;
}
footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 179, 237, 0.4), transparent);
}

/* Favorites section on homepage */
.favorites-section {
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: rgba(99, 179, 237, 0.08);
  border: 1px solid rgba(99, 179, 237, 0.25);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.favorites-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(99, 179, 237, 0.6), transparent);
}

.favorites-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-accent-light);
  margin-bottom: 1rem;
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.95rem;
}

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.favorite-item {
  background: rgba(42, 54, 71, 0.8);
  border: 1px solid rgba(99, 179, 237, 0.2);
  border-radius: 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
}

.favorite-item-header {
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.favorite-item-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-accent);
  margin: 0;
  word-break: break-word;
  flex: 1;
}

.btn-remove-favorite {
  background: transparent;
  border: 1px solid rgba(99, 179, 237, 0.3);
  color: #ff6b6b;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-remove-favorite:hover {
  background: rgba(255, 107, 107, 0.1);
  border-color: #ff6b6b;
  color: #ff8787;
}

.favorite-item-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.favorite-detail-row {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0;
  padding: 0;
  line-height: 1.4;
}

/* SEO about blurb */
.seo-about {
  margin-top: 2rem;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--color-text-muted);
  max-width: 680px;
}

.footer-disclaimer {
  font-size: 0.82rem;
  color: #cbd5e0;
  margin-bottom: 0.4rem !important;
}
.footer-copyright {
  font-size: 0.88rem;
  color: #a0aec0;
}

/* =====================================================
   CUSTOM SCROLLBAR (Webkit)
   ===================================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #1a202c;
}
::-webkit-scrollbar-thumb {
  background: #4a5568;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #63b3ed;
}

/* =====================================================
   SELECTION COLOR
   ===================================================== */
::selection {
  background: rgba(99, 179, 237, 0.3);
  color: #e2e8f0;
}

/* =====================================================
   TOOLS SECTION (Events page)
   ===================================================== */
.tools-section {
  margin-top: 24px;
}

.tools-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  padding-left: 4px;
}

.tool-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--color-bg-medium);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
  max-width: 480px;
}

.tool-card:hover {
  background: var(--color-surface);
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.tool-card-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.tool-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tool-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
}

.tool-card-desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* =====================================================
   STANDALONE DAMAGE CALCULATOR PAGE
   ===================================================== */

/* Two-panel layout */
.dc-panels {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.dc-card {
  flex: 1 1 280px;
  background: var(--color-bg-medium);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.dc-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 14px;
}

/* Enemy input grid — 2 equal columns by default */
.dc-enemy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dc-input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Crit toggle — no longer needs to span grid columns (handled inline by critRow wrapper) */
.dc-input-group.dc-check-group {
  /* intentionally empty — layout set inline */
}

.dc-input-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Section label above results */
.dc-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Results section card */
.dc-results-section {
  background: var(--color-bg-medium);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  overflow-x: auto;
}

/* Table rows use CSS grid: type-label | Super col | Extreme col */
.dc-table-header,
.dc-table-row {
  display: grid;
  grid-template-columns: 110px 1fr 1fr;
  gap: 0;
}

.dc-table-header {
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 4px;
  padding-bottom: 6px;
}

.dc-th {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  text-align: center;
  justify-content: center;
  min-width: 0;
}

/* First header cell (Type label) is left-aligned */
.dc-table-header .dc-th:first-child {
  text-align: left;
  justify-content: flex-start;
}

.dc-table-row {
  border-radius: var(--radius-sm);
  margin-bottom: 3px;
}

.dc-td {
  padding: 10px 8px;
  display: flex;
  align-items: center;
  min-width: 0;
}

.dc-td-type {
  gap: 6px;
}

/* Damage value cells — large and prominent, centered */
.dc-td-dmg {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  justify-content: center;
  text-align: center;
}

/* Row tinting — advantage = enemy has an edge (bad for player) */
.dc-row-advantage {
  background: rgba(192, 57, 43, 0.12);
}
.dc-row-advantage .dc-td-dmg {
  color: #fc8181;
}

.dc-row-neutral {
  background: transparent;
}
.dc-row-neutral .dc-td-dmg {
  color: var(--color-text);
}

.dc-row-disadvantage {
  background: rgba(46, 213, 115, 0.08);
}
.dc-row-disadvantage .dc-td-dmg {
  color: #68d391;
}

/* Type badges */
.dc-type-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dc-type-str { background: #c0392b; }   /* red    */
.dc-type-phy { background: #d35400; }   /* orange */
.dc-type-int { background: #6b46c1; }   /* purple */
.dc-type-teq { background: #276749; }   /* green  */
.dc-type-agl { background: #2b6cb0; }   /* blue   */

/* Class chips */
.dc-class-chip {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.dc-class-super {
  background: rgba(99, 179, 237, 0.15);
  color: #90cdf4;
  border: 1px solid rgba(99, 179, 237, 0.3);
}

.dc-class-extreme {
  background: rgba(255, 71, 87, 0.12);
  color: #ff6b7a;
  border: 1px solid rgba(255, 71, 87, 0.25);
}
