/* The game's visual system. Structural sizing and Safari safeguards live in the
   base sheets; this layer owns typography, surfaces and responsive card art. */
@font-face {
  font-family: 'Nunito';
  src: url('fonts/Nunito.ttf') format('truetype');
  font-weight: 200 1000;
  font-display: swap;
}
@font-face {
  font-family: 'Lilita One';
  src: url('fonts/LilitaOne.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
:root {
  font-family: 'Nunito', sans-serif;
  --ink: #183d41;
  --paper: #eef0df;
  --dark: #102e36;
  --muted: #607975;
  --line: #bacdbb;
  --gold: #efc568;
  --green: #c5e593;
  --field-gold: #ffe3a0;
}
.shell {
  background: #112f38;
}
.topbar,
.battle-mode .topbar {
  height: 48px;
  flex-basis: 48px;
  background: linear-gradient(#23464f, #15333c);
  border-bottom: 1px solid #567473;
  padding: 0 14px;
}
.brand,
.battle-mode .brand {
  gap: 7px;
  font-size: 15px;
  letter-spacing: 0.3px;
}
.brand strong {
  font-family: 'Lilita One', sans-serif;
  font-weight: 400;
  color: #f8efd5;
}
.brand strong > span {
  color: #f4ce7a;
}
.brand-icon,
.battle-mode .brand-icon {
  width: 30px;
  height: 34px;
  border-radius: 7px;
  background: linear-gradient(145deg, #fff2b9, #d1a657);
  transform: rotate(-5deg);
  box-shadow: 0 2px 0 #071d26;
}
.brand-icon svg {
  width: 27px;
  height: 30px;
}
.wallet {
  gap: 5px;
}
.icon-button,
.battle-mode .icon-button {
  min-width: 32px;
  min-height: 34px;
  background: #274b55;
  border: 1px solid #647f7d;
  border-radius: 9px;
  color: #f8eccf;
  box-shadow: 0 2px 0 #0e2730;
}
.workspace {
  background: #eef0df;
}
.battle-mode .workspace {
  background: radial-gradient(ellipse at 50% 25%, #345e60, #142f39 80%);
  padding: 10px 14px;
}
.battle-grid {
  gap: 12px;
  max-width: 1280px;
  width: 100%;
  margin: auto;
}
.arena-wrap {
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.battle-hud {
  position: static;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  color: #ecf4e5;
}
.level-badge,
.wave-display {
  border: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
}
.level-badge {
  max-width: none;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.level-badge > span {
  color: #f6d283;
  font-size: 13px;
  letter-spacing: 0.8px;
  white-space: nowrap;
}
.level-badge strong {
  font-weight: 900;
  font-size: 14px;
  line-height: 1.15;
}
.wave-display {
  grid-template-columns: auto auto;
  align-items: center;
  gap: 3px 8px;
}
.wave-display > strong {
  font-size: 13px;
}
.wave-display > span {
  grid-column: 1 / -1;
  font-size: 13px;
}
.wave-dots {
  grid-column: 2;
  grid-row: 1;
}
.wave-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border-color: #75958e;
}
.wave-dots i.filled {
  background: #f2cf7e;
  border-color: #f2cf7e;
  box-shadow: 0 0 6px #edcc7355;
}
.base-health {
  display: flex;
  justify-content: space-between;
  align-items: center;
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.8px;
}
.base-health b {
  font-size: 13px;
  letter-spacing: 0;
  margin-left: 4px;
}
.home-base {
  color: #96e6f5;
}
.enemy-base {
  color: #ffc192;
}
.arena-mode {
  color: #a2bcb4;
  font-size: 13px;
}
.map-container {
  border: 2px solid #a2bc9c;
  border-radius: 20px;
  box-shadow:
    0 4px 0 #081f29,
    0 0 0 3px #42665b,
    0 8px 24px #051d2644;
}
.start-overlay {
  background: linear-gradient(145deg, #244d53f5, #102f3af5);
  border: 1px solid #c1d0a5;
  border-radius: 18px;
  box-shadow:
    0 5px 0 #102e35,
    0 16px 30px #102d3940;
  padding: 20px 24px;
  max-width: 420px;
}
.start-overlay > strong {
  font-family: 'Lilita One', sans-serif;
  font-weight: 400;
  font-size: 34px;
  color: #fff0cc;
}
.start-kicker {
  color: #edce84;
  font-size: 13px;
  letter-spacing: 1.8px;
}
.start-overlay > span:not(.start-kicker) {
  color: #d3e9db;
  line-height: 1.45;
  font-size: 13px;
}
.primary {
  background: linear-gradient(#fff0b1, #f0c568);
  border: 1px solid #f9e3a0;
  color: #24423f;
  border-radius: 11px;
  box-shadow:
    0 4px 0 #a67d37,
    inset 0 1px 0 #fff8d5;
  font-weight: 900;
  min-height: 46px;
}
.primary:hover {
  background: linear-gradient(#fff5c6, #f8d589);
}
.hand-dock {
  height: 230px;
  flex-basis: 230px;
  padding: 10px;
  border: 1px solid #6c9189;
  border-radius: 18px;
  background: linear-gradient(125deg, #315661, #1c3d49);
  box-shadow:
    0 4px 0 #0b2631,
    inset 0 1px 0 #718e8044;
  gap: 8px;
}
.deck-heading > strong {
  color: #e1eee0;
  font-size: 13px;
  font-weight: 800;
}
.dock-tools {
  gap: 8px;
}
.energy-summary {
  font-family: 'Lilita One', sans-serif;
  font-size: 22px;
  font-weight: 400;
  color: #a9e7fa;
}
.energy-summary b {
  font-weight: 400;
}
#rally {
  border-color: #82ada8;
  background: linear-gradient(#477c81, #335660);
  border-radius: 10px;
  padding: 0 14px;
  box-shadow: 0 3px 0 #17323a;
}
#rally span {
  font-size: 13px;
  font-weight: 900;
}
#pause {
  border-radius: 10px;
  font-weight: 900;
}
.hand {
  gap: 9px;
}
.card {
  border: 2px solid #a6c6c2;
  border-radius: 13px;
  background: linear-gradient(145deg, #eaf2d9, #bfcfbd);
  box-shadow:
    0 4px 0 #0d2733,
    inset 0 0 0 1px #f7f5d5;
}
.card:not(.unaffordable) {
  border-color: #b8d8c7;
  box-shadow:
    0 4px 0 #0d2733,
    inset 0 0 0 1px #fff9d7;
}
.card > .troop-art {
  background: radial-gradient(ellipse at 50% 70%, #fff4c2, transparent 68%);
  border-bottom: 0;
}
.card > .troop-art svg {
  filter: drop-shadow(0 4px 2px #2e555440);
  max-height: 86px;
}
.card:before {
  content: '';
  position: absolute;
  height: 4px;
  bottom: 0;
  width: 100%;
  background: var(--troop-color, #5595a6);
  z-index: 2;
}
.card .cost {
  font-size: 14px;
  border-radius: 8px;
  padding: 4px 7px;
  background: linear-gradient(#8fe0ed, #387895);
  color: #fff9db;
  text-shadow: 0 1px 1px #193f64;
  box-shadow: 0 2px 0 #284b64;
}
.card-info {
  padding: 8px;
  gap: 4px;
}
.card-info strong {
  font-weight: 1000;
  font-size: 14px;
  color: #1e3f43;
}
.card-power {
  font-size: 13px;
  font-weight: 800;
  color: #58716b;
}
.card-stats {
  font-size: 13px;
}
.card.selected {
  transform: translateY(-6px);
  border-color: #ffdd7f;
  box-shadow:
    0 5px 0 #a78544,
    0 0 16px #f5d37755;
}
.card.unaffordable {
  background: linear-gradient(145deg, #b6c6bc, #8ea7a5);
  opacity: 0.8;
}
.card.unaffordable:after {
  font-size: 13px;
  background: #254652;
  color: #f4edcc;
  padding: 4px;
}
.card-multiplier {
  border: 1px solid #a9ae84;
  font-weight: 1000;
}
.energy-track {
  height: 18px;
  flex-basis: 18px;
  gap: 7px;
}
.energy-pips {
  min-width: 0;
}
.energy-pips i {
  height: 9px;
  border: 1px solid #749da3;
  background: linear-gradient(90deg, #90dfee var(--fill), #193744 var(--fill));
}
.energy-track > span {
  font-size: 13px;
  letter-spacing: 0.4px;
}
.next-card {
  flex: 0 0 auto;
  height: 22px;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: #d2e5d7;
}
.next-card > span {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.5px;
}
.next-card svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.next-card b {
  font-size: 13px;
  white-space: nowrap;
  font-weight: 800;
}
.game-nav {
  height: 62px;
  flex: 0 0 62px;
  padding: 6px 10px;
  gap: 7px;
  background: linear-gradient(#23414a, #102e37);
  border-top: 1px solid #5f7e78;
}
.game-nav .nav {
  color: #b5cfca;
  background: none;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 900;
  font-size: 13px;
  gap: 4px;
}
.game-nav .nav > span {
  display: flex;
  align-items: center;
}
.game-nav svg {
  width: 22px;
  height: 22px;
}
.game-nav .nav.active {
  color: #ffdfa1;
  background: linear-gradient(#38565a, #294248);
  border-color: #8e916f;
  box-shadow:
    inset 0 1px 0 #9aab7544,
    0 2px 0 #0f2730;
}
.game-nav .nav i {
  background: #3d5b57;
  color: #e6e8c3;
  border-radius: 5px;
}
h1,
h2 {
  font-family: 'Lilita One', sans-serif;
  font-weight: 400;
  letter-spacing: 0.1px;
}
.page-heading h1 {
  font-size: 32px;
}
.section-banner {
  border-radius: 16px;
  background: linear-gradient(125deg, #e2e8cd, #f5f3df);
  border: 1px solid #bcccb2;
}
.troop-tile,
.operation {
  border-radius: 18px;
  background: linear-gradient(140deg, #faf5df, #e2e9d4);
  border: 1px solid #bacab2;
  box-shadow: 0 4px 0 #b0bfa8;
  overflow: hidden;
}
.troop-tile > .troop-art {
  background: radial-gradient(ellipse, #fff1b0, #cad8bc 75%);
}
.troop-tile h3,
.operation h3 {
  font-weight: 1000;
}
.troop-tile .troop-art svg {
  filter: drop-shadow(0 6px 3px #40645240);
}
.troop-tile button,
.pagination button {
  border-radius: 9px;
  font-weight: 900;
  min-height: 40px;
}
.operation-num {
  font-family: 'Lilita One', sans-serif;
  font-weight: 400;
  color: #afbf9e;
}
.operation.completed {
  border-color: #81a985;
}
.order {
  border-radius: 14px;
  background: #f6f4e0;
  box-shadow: 0 3px 0 #c5cfb7;
  border-color: #c2cdb4;
}
.order-icon {
  border-radius: 12px;
  background: #e6d7a0;
}
dialog {
  border-radius: 22px;
  border-color: #9aa98a;
  background: linear-gradient(145deg, #faf7e7, #eaf0da);
  box-shadow:
    0 8px 0 #0e2d3940,
    0 24px 80px #001d3560;
}
dialog h2 {
  font-size: 30px;
}
.modal-actions button,
.battle-menu button {
  border-radius: 11px;
  font-weight: 900;
}
.campaign-celebration h2 {
  font-size: 36px;
}
.drag-tutorial {
  background: #163e49ee;
  border-color: #e8d193;
  border-radius: 15px;
}
.drag-tutorial > strong {
  font-family: 'Lilita One', sans-serif;
  font-weight: 400;
}
@media (max-width: 700px) {
  .topbar,
  .battle-mode .topbar {
    padding: 0 9px;
    height: 44px;
    flex-basis: 44px;
    gap: 6px;
  }
  .brand,
  .battle-mode .brand {
    font-size: 13px;
  }
  .brand-icon,
  .battle-mode .brand-icon {
    width: 25px;
    height: 30px;
  }
  .brand-icon svg {
    width: 23px;
    height: 28px;
  }
  .battle-mode .workspace {
    padding: 8px;
  }
  .battle-grid {
    gap: 9px;
  }
  .battle-hud {
    gap: 4px 8px;
  }
  .level-badge {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
  .level-badge strong {
    font-size: 13px;
  }
  .wave-display {
    grid-template-columns: 1fr;
  }
  .wave-dots {
    display: none;
  }
  .base-health {
    font-size: 13px;
    letter-spacing: 0.5px;
  }
  .base-health b {
    font-size: 13px;
  }
  .map-container {
    border-radius: 16px;
  }
  .start-overlay {
    padding: 15px 18px;
    max-width: calc(100% - 32px);
  }
  .start-overlay > strong {
    font-size: 29px;
  }
  .start-overlay > span:not(.start-kicker) {
    font-size: 13px;
  }
  .hand-dock {
    padding: 8px;
  }
  .hand {
    gap: 6px;
  }
  .card {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    border-radius: 10px;
  }
  .card > .troop-art {
    padding-top: 12px;
  }
  .card > .troop-art svg {
    max-height: 70px;
    width: 90px;
    max-width: 100%;
  }
  .card-info {
    padding: 4px 4px 7px;
    gap: 2px;
  }
  .card-info strong {
    font-size: 13px;
    line-height: 1.15;
    min-height: 25px;
    display: grid;
    align-items: center;
  }
  .card-power {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .card-stats {
    display: none;
  }
  .card .cost {
    font-size: 13px;
    padding: 3px 5px;
  }
  .next-card b {
    display: none;
  }
  .energy-track > span {
    font-size: 13px;
  }
  .game-nav {
    height: 58px;
    flex-basis: 58px;
    gap: 4px;
    padding: 5px 6px;
  }
  .game-nav .nav {
    font-size: 13px;
  }
  .game-nav svg {
    width: 20px;
    height: 20px;
  }
  .game-nav .nav i {
    display: none;
  }
  .game-nav .nav > span {
    font-size: 20px;
  }
}
@media (max-height: 560px) and (min-width: 600px) {
  .topbar,
  .battle-mode .topbar {
    height: 38px;
    flex-basis: 38px;
  }
  .battle-mode .workspace {
    padding: 7px 10px;
  }
  .battle-grid {
    gap: 10px;
  }
  .hand-dock {
    flex: 0 0 215px;
    height: 100%;
    width: 215px;
    padding: 8px;
  }
  .level-badge {
    flex-direction: row;
    gap: 8px;
    align-items: center;
  }
  .level-badge strong {
    font-size: 13px;
  }
  .battle-hud {
    gap: 3px 8px;
  }
  .wave-display {
    grid-template-columns: 1fr;
  }
  .wave-display > span {
    font-size: 13px;
  }
  .wave-dots {
    display: none;
  }
  .base-health {
    font-size: 13px;
  }
  .base-health b {
    font-size: 13px;
  }
  .deck-heading > strong {
    font-size: 13px;
  }
  .energy-summary {
    display: none;
  }
  .dock-tools {
    gap: 6px;
  }
  #rally {
    padding: 0 8px;
  }
  #pause {
    padding: 0 8px;
  }
  .hand {
    gap: 6px;
  }
  .card {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .card > .troop-art {
    padding-top: 9px;
  }
  .card > .troop-art svg {
    width: 68px;
    max-height: 64px;
  }
  .card-info {
    padding: 3px 4px 6px;
    gap: 1px;
  }
  .card-info strong {
    font-size: 13px;
    line-height: 1.1;
    min-height: 22px;
  }
  .card-power {
    font-size: 13px;
  }
  .card-stats {
    display: none;
  }
  .card .cost {
    font-size: 13px;
    padding: 2px 4px;
  }
  .next-card b {
    display: none;
  }
  .energy-track > span {
    display: none;
  }
  .start-overlay {
    top: 29%;
    padding: 10px 16px;
    max-width: 340px;
  }
  .start-overlay > strong {
    font-size: 25px;
  }
  .start-overlay > span:not(.start-kicker) {
    font-size: 13px;
  }
  .start-overlay .primary {
    min-height: 40px;
    margin-top: 8px;
  }
  .game-nav {
    height: 46px;
    flex-basis: 46px;
    padding: 4px 10px;
  }
  .game-nav .nav {
    flex-direction: row;
    gap: 7px;
  }
}
@media (max-width: 380px) {
  .brand,
  .battle-mode .brand {
    font-size: 13px;
  }
  .arena-mode {
    display: none;
  }
  .level-badge strong {
    font-size: 13px;
  }
  .hand-dock {
    height: 221px;
    flex-basis: 221px;
  }
  .card-info strong {
    font-size: 13px;
  }
}

#account-logout {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 10px;
  color: #7a382d;
  background: #f4dfc6;
  border: 1px solid #bf9d80;
  font-weight: 900;
}
