/* ============================================
   INVINCIBLE GTG TOTEM CALCULATOR
   Theme: Blue overlay on cityscape background
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Bebas+Neue&family=Inter:wght@300;400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
  --bg-overlay: rgba(10, 131, 178, 0.55);
  --bg-card: rgba(0, 60, 90, 0.55);
  --bg-card-solid: #064a66;
  --bg-input: rgba(255, 255, 255, 0.08);

  --blue-accent: #3b82f6;
  --blue-light: #7dd3fc;
  --blue-dim: #1e3a5f;

  --yellow-primary: #fdee0d;
  --yellow-bright: #fdee0d;
  --yellow-dim: rgba(253, 238, 13, 0.15);

  --text-white: #f0f0f0;
  --text-light: #cce4ef;
  --text-muted: #7fb8d0;

  --border: rgba(255, 255, 255, 0.12);
  --border-hover: rgba(255, 255, 255, 0.22);

  --font-display: 'Oswald', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.25);

  --transition: 0.25s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 14.4px;
}

body {
  font-family: var(--font-body);
  background: #0a83b2;
  color: var(--text-white);
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  line-height: 1.6;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: url('Background.jpg') center / cover no-repeat;
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-overlay);
  z-index: -1;
  pointer-events: none;
}

/* --- Container --- */
.container {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 24px 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* --- Header --- */
.hero-section {
  text-align: center;
  padding: 50px 0 30px;
}

.hero-logo {
  max-width: 320px;
  width: 80%;
  height: auto;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-divider {
  width: 100px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--yellow-primary), transparent);
  margin: 20px auto 0;
  border: none;
}

/* --- Totem Selector --- */
.totem-selector {
  max-width: 400px;
  margin: 0 auto 28px;
  width: 100%;
}

.totem-selector .input-group {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.totem-selector .input-group:hover {
  border-color: var(--border-hover);
}

.totem-select-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.totem-search-wrapper {
  flex: 1;
  position: relative;
}

.totem-search-wrapper .input-field {
  cursor: text;
}

.totem-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: #0a2a3a;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 20;
}

.totem-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-light);
  transition: background 0.15s ease;
}

.totem-dropdown-item:hover,
.totem-dropdown-item.highlighted {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
}

.totem-dropdown-item.selected {
  color: var(--text-muted);
}

.totem-dropdown-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.totem-dropdown-hero {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

.totem-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.totem-hero-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}

.hero-portrait-mini {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  border: 1.5px solid var(--border-hover);
}

.totem-hero-tag span {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-light);
}

/* --- Input Fields --- */
.input-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-light);
}

.input-field {
  width: 100%;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  border-radius: 0;
  color: var(--text-white);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  transition: var(--transition);
  outline: none;
}

.input-field::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.input-field:hover {
  border-bottom-color: var(--border-hover);
}

.input-field:focus {
  border-bottom-color: var(--blue-accent);
}

.input-field[type="number"]::-webkit-outer-spin-button,
.input-field[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.input-field[type="number"] {
  -moz-appearance: textfield;
}

/* --- Level Range Inputs --- */
.leveling-inputs {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  margin-bottom: 28px;
}

.leveling-input-group {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leveling-input-group:hover {
  border-color: var(--border-hover);
}

.level-arrow {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-muted);
  padding-bottom: 12px;
}

/* --- Section Cards --- */
.section-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.section-card:hover {
  border-color: var(--border-hover);
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.section-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: -8px;
  margin-bottom: 14px;
  line-height: 1.4;
}

/* --- Cost Grid --- */
.cost-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.cost-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.cost-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin-bottom: 4px;
}

.cost-item.cost-empty {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: transparent;
}

.cost-amount {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.cost-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Stats Grid --- */
.stats-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-name {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-white);
  letter-spacing: 0.5px;
}

/* --- Module Slots Row --- */
.module-slots-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
}

.module-label {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-light);
}

.module-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* --- Modules Grid --- */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.module-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}

.module-stat-name {
  font-size: 0.82rem;
  color: var(--text-light);
  font-weight: 500;
}

.module-stat-value {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--blue-light);
  letter-spacing: 0.5px;
}

/* --- Passive Ability --- */
.passive-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 12px;
}

.passive-table-wrapper {
  overflow-x: auto;
  margin: 0 -6px;
  padding: 0 6px;
}

.passive-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  
}

.passive-table th {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 8px 4px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.passive-table th:first-child {
  text-align: left;
}

.passive-table td {
  padding: 8px 4px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.passive-table td.param-name {
  text-align: left;
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.82rem;
  white-space: nowrap;
}

.passive-table td.param-value {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.passive-table th.active,
.passive-table td.active {
  color: var(--yellow-primary);
  background: none;
}

.passive-table th.active-tier,
.passive-table td.active-tier {
  color: var(--yellow-primary);
  background: none;
}

.passive-table tr.passive-totem-row th {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  padding-bottom: 0;
  padding-top: 6px;
  text-transform: none;
}
.passive-table tr.passive-totem-row th.active-tier {
  color: var(--yellow-primary);
}
.passive-table th.row-label {
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}
.passive-table tr.passive-totem-row th.row-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
}

.passive-table tr:last-child td {
  border-bottom: none;
}

/* --- Ability Level Row --- */
.ability-level-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.ability-level-input {
  width: 60px;
  text-align: center;
  flex-shrink: 0;
}

/* --- Discord Widget --- */
.discord-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #5865F2;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: background 0.2s ease, transform 0.2s ease;
}

.discord-widget:hover {
  background: #4752c4;
  transform: translateY(-2px);
}

.discord-widget svg {
  flex-shrink: 0;
}

.kofi-widget {
  position: fixed;
  bottom: 20px;
  right: 168px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #FF5E5B;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: background 0.2s ease, transform 0.2s ease;
}

.kofi-widget:hover {
  background: #e54a47;
  transform: translateY(-2px);
}

.kofi-widget svg {
  flex-shrink: 0;
}

/* --- Utility --- */
.hidden {
  display: none !important;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .container {
    padding: 0 16px 60px;
  }

  .hero-section {
    padding: 30px 0 20px;
  }

  .leveling-inputs {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .leveling-input-group {
    flex: 0 0 auto;
    width: 100%;
    max-width: 280px;
  }

  .level-arrow {
    transform: rotate(90deg);
    padding: 0;
  }

  .totem-selector {
    max-width: 100%;
  }

  .cost-grid {
    grid-template-columns: 1fr;
  }

  .modules-grid {
    grid-template-columns: 1fr;
  }

  .input-field {
    font-size: 16px;
  }

  .discord-widget,
  .kofi-widget {
    display: none;
  }
}
