:root,
[data-theme="normal"] {
  --bg: #0e2019;
  --surface: #053121;
  --surface-input: #182c25;
  --text-primary: #ffffff;
  --text-secondary: #999999;
  --text-muted: #666666;
  --accent: #4aaf4d;
  --accent-10: rgba(74, 175, 77, 0.1);
  --accent-12: rgba(74, 175, 77, 0.12);
  --accent-15: rgba(74, 175, 77, 0.15);
  --accent-20: rgba(74, 175, 77, 0.2);
  --accent-25: rgba(74, 175, 77, 0.25);
  --accent-30: rgba(74, 175, 77, 0.3);
  --accent-40: rgba(74, 175, 77, 0.4);
  --dot-inactive: #333333;
  --overlay: rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] {
  --bg: #050806;
  --surface: #0a120d;
  --surface-input: #0f1a15;
  --text-primary: #f2f2f2;
  --text-secondary: #8a8f8c;
  --text-muted: #5a5f5c;
  --accent: #5fd162;
  --accent-10: rgba(95, 209, 98, 0.1);
  --accent-12: rgba(95, 209, 98, 0.12);
  --accent-15: rgba(95, 209, 98, 0.15);
  --accent-20: rgba(95, 209, 98, 0.2);
  --accent-25: rgba(95, 209, 98, 0.22);
  --accent-30: rgba(95, 209, 98, 0.3);
  --accent-40: rgba(95, 209, 98, 0.35);
  --dot-inactive: #222623;
  --overlay: rgba(0, 0, 0, 0.75);
}

[data-theme="light"] {
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-input: #eef2ef;
  --text-primary: #0e2019;
  --text-secondary: #5a6b62;
  --text-muted: #8a978f;
  --accent: #379645;
  --accent-10: rgba(55, 150, 69, 0.1);
  --accent-12: rgba(55, 150, 69, 0.12);
  --accent-15: rgba(55, 150, 69, 0.15);
  --accent-20: rgba(55, 150, 69, 0.2);
  --accent-25: rgba(55, 150, 69, 0.2);
  --accent-30: rgba(55, 150, 69, 0.28);
  --accent-40: rgba(55, 150, 69, 0.35);
  --dot-inactive: #d3dbd6;
  --overlay: rgba(0, 0, 0, 0.35);
}

* {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg);
}

#loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
}

#loader {
  display: block;
  position: relative;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  animation: spin 2s linear infinite;
}

#loader:before {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  bottom: 5px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--text-primary);
  animation: spin 3s linear infinite;
}

#loader:after {
  content: "";
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  bottom: 15px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  animation: spin 1.5s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px;
  border-radius: 25px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.container > div {
  background: var(--surface);
  padding: 14px;
  border-radius: 25px;
  width: 99%;
  box-sizing: border-box;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* neutral shadow, left as-is on purpose */
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h1 { margin: 0; font-size: 36px; color: var(--text-primary); }
h2 { margin: 4px 0; color: var(--text-primary); }
h3 { margin: 7px 0; font-size: 45px; color: var(--text-primary); }
p { margin: 5px 0; color: var(--text-primary); }

.date {
  color: var(--text-secondary);
}

.date-city-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.city-tag {
  display: inline-block;
  font-size: 13px;
  color: var(--accent);
  background: var(--accent-12);
  padding: 3px 12px;
  border-radius: 20px;
  border: 1px solid var(--accent-30);
}

.input-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
  text-align: center;
  padding-top: 14px;
  border-radius: 10px;
  width: 100%;
}

.input-wrapper1,
.input-wrapper2,
.input-wrapper3 {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  max-width: 400px;
  margin-bottom: 6px;
  margin-top: 6px;
  border-radius: 20px;
  background-color: var(--surface-input);
  box-sizing: border-box;
}

.input-wrapper1 {
  border: 0.75px solid var(--accent);
}

.input-wrapper2 {
  border: 0.75px solid var(--text-primary);
}

.input-wrapper3 {
  border: 0.75px solid #5bbad5; /* intentional: fixed accent for the 3rd-currency slot, not theme-driven */
}

.currency-symbol,
.currency-symbol2,
.currency-symbol3 {
  flex-shrink: 0;
  font-size: 1.25rem;
  color: var(--text-primary);
  pointer-events: none;
}

.currency-symbol {
  order: 0;
  padding-left: 1rem;
}

.currency-symbol2,
.currency-symbol3 {
  order: 2;
  padding-right: 1rem;
}

.number-input-left,
.number-input-right {
  order: 1;
  flex: 1;
  min-width: 0;
  padding: 10px 0.5rem;
  font-size: 1.4rem;
  border: none;
  background-color: transparent;
  box-sizing: border-box;
  text-align: left;
  appearance: textfield;
  -moz-appearance: textfield;
  color: var(--text-primary);
  caret-color: var(--text-primary);
}

.number-input-third {
  color: var(--text-primary);
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.resetButton {
  border: none;
  color: #000000; /* intentional: stays black — reads fine on the green accent bg in all 3 themes */
  padding: 8px 30px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 14px;
  border-radius: 25px;
  transition: background-color 0.3s ease;
  margin-top: 8px;
  margin-bottom: 5px;
  cursor: pointer;
  background-color: var(--accent);
}

.resetButton:hover {
  background-color: #ff7f76; /* intentional: dedicated hover color, not theme-driven */
}

.resetButton:active {
  background-color: var(--accent);
}

.buttonContainer {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 5px;
}

.header-image {
  width: 100%;
  max-width: 120px;
  height: auto;
  display: block;
  margin: 0 auto 10px auto;
  border-radius: 30px;
}

.image-container {
  padding-top: 10px;
}

.settingsBtn {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 1500;
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--accent);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}

.settingsBtn:hover {
  background: var(--accent);
  color: #ffffff; /* intentional: white reads fine on the accent green in all 3 themes */
}

.settings-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay);
  z-index: 1999;
}

.settings-overlay.active {
  display: block;
}

.settings-panel {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--accent-40);
  z-index: 2000;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: hidden;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.settings-panel.open {
  right: 0;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--accent-20);
}

.settings-header span {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: bold;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 6px;
  transition: color 0.2s;
}

.close-btn:hover {
  color: var(--text-primary);
}

.settings-section {
  margin-bottom: 28px;
}

.settings-section:last-child {
  margin-bottom: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.settings-label {
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.city-selector {
  display: flex;
  gap: 8px;
}

.city-btn {
  flex: 1;
  padding: 10px 8px;
  border: 1px solid var(--accent-25);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.city-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff; /* intentional: white on accent bg, consistent across themes */
  font-weight: 600;
}

.city-btn.disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.city-btn:not(.disabled):not(.active):hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.soon-badge {
  display: inline-block;
  font-size: 8px;
  background: #c8a84b; /* intentional: gold "soon" badge, not theme-driven */
  color: #ffffff;
  padding: 1px 5px;
  border-radius: 6px;
  margin-left: 4px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 700;
}

.currency-search-wrapper {
  position: relative;
  margin-bottom: 10px;
}

.currency-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 12px;
  pointer-events: none;
}

.currency-search {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--accent-25);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 8px 10px 8px 30px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.currency-search::placeholder {
  color: var(--text-muted);
}

.currency-search:focus {
  border-color: var(--accent);
}

.currency-grid-container {
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
  min-height: 0;
}

.currency-grid-container::-webkit-scrollbar {
  width: 4px;
}

.currency-grid-container::-webkit-scrollbar-track {
  background: transparent;
}

.currency-grid-container::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 2px;
}

.no-results {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 16px 0;
}

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

.curr-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--accent-25);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  text-align: left;
}

.curr-symbol {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--accent-10);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.curr-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.curr-code {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.curr-name {
  font-size: 11px;
  color: var(--text-muted);
}

.curr-btn.active {
  background: var(--accent);
  border-color: var(--accent);
}

.curr-btn.active .curr-symbol {
  background: rgba(255, 255, 255, 0.2); /* intentional: on-accent overlay, works on any accent green */
  color: #ffffff;
}

.curr-btn.active .curr-code {
  color: #ffffff;
}

.curr-btn.active .curr-name {
  color: rgba(255, 255, 255, 0.75); /* intentional: on-accent, consistent across themes */
}

.curr-btn:not(.active):hover {
  border-color: var(--accent);
}

.curr-btn:not(.active):hover .curr-code {
  color: var(--text-primary);
}

.sponsor-carousel {
  position: relative;
  width: 99%;
  margin-bottom: 10px;
}

.sponsor-banner {
  display: none;
  flex-direction: column;
  width: 100%;
  border: 1px solid var(--accent-15);
  border-radius: 18px;
  text-decoration: none;
  box-sizing: border-box;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
  animation: sponsorFadeIn 0.5s ease;
}

.sponsor-banner.active {
  display: flex;
}

.sponsor-banner:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px var(--accent-15);
}

.sponsor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--surface);
}

.sponsor-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.sponsor-name {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

@keyframes sponsorFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sponsor-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.sponsor-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot-inactive);
  cursor: pointer;
  transition: background 0.2s;
}

.sponsor-dot.active {
  background: var(--accent);
}

.sponsor-img {
  width: 100%;
  max-height: 80px;
  object-fit: cover;
  object-position: top;
  display: block;
  border-radius: 0 0 17px 17px;
}

/* ── Theme toggle ── */
.theme-selector {
  display: flex;
  gap: 8px;
}

.theme-btn {
  flex: 1;
  padding: 10px 8px;
  border: 1px solid var(--accent-25);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.theme-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.theme-btn:not(.active):hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* ── Fluid type & spacing using clamp() ── */
h2 { font-size: clamp(28px, 8vw, 44px); }
p { font-size: clamp(15px, 4.5vw, 22px); }
.smaller-text { font-size: clamp(15px, 4.5vw, 22px); }
.date { font-size: clamp(12px, 3.5vw, 16px); }
.number-input-left, .number-input-right { font-size: clamp(1.15rem, 4.5vw, 1.7rem); }
.currency-symbol, .currency-symbol2, .currency-symbol3 { font-size: clamp(1rem, 4vw, 1.5rem); }
.header-image { max-width: clamp(80px, 28vw, 170px); }

@media (max-width: 360px) {
  .container { margin: 4px; padding: 4px; }
  .container > div { padding: 10px; }
  .image-container { padding-top: 6px; }
  .header-image { margin-bottom: 6px; }
  .input-container { padding-top: 8px; margin-top: 6px; }
  .input-wrapper1, .input-wrapper2, .input-wrapper3 { margin-top: 4px; margin-bottom: 4px; }
  .sponsor-img { max-height: 65px; }
  .resetButton { padding: 7px 24px; margin-top: 6px; }
  .buttonContainer { margin-top: 4px; }
}

@media (max-height: 700px) {
  .image-container { padding-top: 6px; }
  .header-image { max-width: clamp(60px, 18vw, 100px); margin-bottom: 6px; }
  h2 { font-size: clamp(24px, 7vw, 36px); margin: 2px 0; }
  p { margin: 2px 0; }
  .date { margin-top: 4px; }
  .city-tag { margin-top: 4px; }
  .input-container { padding-top: 8px; margin-top: 6px; }
  .input-wrapper1, .input-wrapper2, .input-wrapper3 { margin-top: 3px; margin-bottom: 3px; }
  .sponsor-img { max-height: 60px; }
  .sponsor-dots { margin-top: 4px; }
  .resetButton { padding: 6px 24px; margin-top: 5px; margin-bottom: 2px; }
  .buttonContainer { margin-top: 4px; margin-bottom: 2px; }
  .container > div { padding: 10px 14px; }
}

@media (max-height: 570px) {
  .image-container { display: none; }
  .input-container { padding-top: 4px; }
  .sponsor-img { max-height: 50px; }
  .container > div { padding: 8px 14px; }
}

@media (min-width: 768px) {
  .container { max-width: 480px; }
  .container > div { padding: 20px; }
  .image-container { padding-top: 16px; }
  .header-image { margin-bottom: 16px; }
  p { margin: 8px 0; }
  .date { margin-top: 8px; }
  .input-container { padding-top: 20px; }
  .input-wrapper1, .input-wrapper2, .input-wrapper3 { margin-bottom: 10px; margin-top: 8px; }
  .resetButton { padding: 10px 35px; margin-top: 14px; }
  .sponsor-carousel { margin-bottom: 14px; }
  .sponsor-img { max-height: 110px; }
}