/* ==========================================================
   DECKS PAGE - ROYALE PROGRESS
  v11 - Arena Blueprint

   Rebuilt from scratch with mobile-first behavior.
   Compatible with global.css mobile overrides at <= 900px:
   - body padding-top and padding-bottom
   - main horizontal padding (12px)
   ========================================================== */

.deck-page {
  --dk-text: #f7f9ff;
  --dk-muted: rgba(230, 236, 255, 0.74);
  --dk-soft: rgba(188, 203, 236, 0.58);
  --dk-border: rgba(141, 172, 238, 0.28);
  --dk-panel-bg: linear-gradient(165deg, rgba(8, 21, 52, 0.92) 0%, rgba(6, 13, 34, 0.9) 100%);
  --dk-card-bg: linear-gradient(170deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 100%);
  --dk-card-border: rgba(163, 190, 248, 0.22);
  --dk-cyan: #56ccf2;
  --dk-success: #6ee7b7;
  padding-top: 80px;
}

.decks-main {
  width: 100%;
  box-sizing: border-box;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 22px 84px;
}

/* ==========================================================
   Header
   ========================================================== */

.decks-header {
  padding: 28px 0 20px;
}

.decks-header-inner {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 24px;
  padding: clamp(20px, 3.2vw, 34px);
  background:
    radial-gradient(100% 130% at 8% -10%, rgba(86, 204, 242, 0.2) 0%, rgba(86, 204, 242, 0) 58%),
    radial-gradient(90% 90% at 100% 0%, rgba(255, 209, 102, 0.2) 0%, rgba(255, 209, 102, 0) 60%),
    var(--dk-panel-bg);
  border: 1px solid var(--dk-border);
  box-shadow: 0 18px 52px rgba(2, 8, 26, 0.5);
}

.decks-header-inner > * {
  position: relative;
  z-index: 1;
}

.decks-header-inner::after {
  content: "";
  position: absolute;
  right: -12%;
  bottom: -50%;
  width: min(360px, 50vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(86, 204, 242, 0.2) 0%, rgba(86, 204, 242, 0) 68%);
  pointer-events: none;
}

.decks-title {
  margin: 0 0 8px;
  color: var(--dk-text);
  font-family: 'ClashBold', Arial, sans-serif;
  font-size: clamp(1.95rem, 4vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.45);
}

.decks-subtitle {
  margin: 0 0 24px;
  max-width: 68ch;
  color: var(--dk-muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

/* ==========================================================
   Category tabs
   ========================================================== */

.decks-tab-nav {
  position: relative;
  z-index: 2;
  margin: 0 0 8px;
  padding: 0 12px;
  background: rgba(5, 14, 37, 0.82);
  border: 1px solid rgba(138, 167, 227, 0.16);
  border-radius: 16px;
  border-top: 1px solid rgba(138, 167, 227, 0.16);
  border-bottom: 1px solid rgba(138, 167, 227, 0.16);
  overflow: hidden;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.decks-tab-track {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0 11px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.decks-tab-track::-webkit-scrollbar {
  display: none;
}

.dk-tab {
  flex-shrink: 0;
  border: 1.5px solid rgba(164, 190, 247, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(230, 237, 255, 0.66);
  padding: 7px 15px;
  font-family: inherit;
  font-size: 0.81rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1px;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.dk-tab:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.12);
}

@media (hover: hover) {
  .dk-tab:hover {
    border-color: rgba(177, 202, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(243, 247, 255, 0.95);
  }
}

.dk-tab--active {
  border-color: rgba(247, 203, 107, 0.68);
  background: linear-gradient(160deg, rgba(255, 209, 102, 0.26) 0%, rgba(247, 185, 75, 0.14) 100%);
  color: #fff6dd;
}

/* ==========================================================
   Sections
   ========================================================== */

#deckSections {
  padding-top: 24px;
  padding-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dk-section {
  width: 100%;
  box-sizing: border-box;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--dk-border);
  background: var(--dk-panel-bg);
  box-shadow: 0 16px 48px rgba(2, 8, 24, 0.42);
  scroll-margin-top: 74px;
  animation: dk-section-in 0.45s ease both;
}

.dk-section-header {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: var(--cat-gradient, linear-gradient(135deg, #1f4ba5 0%, #2f78d8 100%));
}

.dk-section-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.17) 0%, rgba(255, 255, 255, 0) 42%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.dk-section-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.dk-section-icon {
  flex-shrink: 0;
  font-size: 1.95rem;
  line-height: 1;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.45));
}

.dk-section-texts {
  flex: 1;
  min-width: 0;
}

.dk-section-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.dk-section-title {
  margin: 0;
  flex: 1 1 220px;
  min-width: 0;
  color: #fff;
  font-family: 'ClashBold', Arial, sans-serif;
  font-size: 1.16rem;
  line-height: 1.2;
  text-shadow: 0 2px 9px rgba(0, 0, 0, 0.35);
}

.dk-section-count {
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  padding: 2px 8px;
}

.dk-section-seo {
  margin: 0;
  color: rgba(236, 243, 255, 0.84);
  font-size: 0.81rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.dk-grid {
  padding: 16px;
  display: grid;
  gap: 13px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* ==========================================================
   Deck cards
   ========================================================== */

.dk-card-wrap {
  width: 100%;
  box-sizing: border-box;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: var(--dk-card-bg);
  border: 1px solid var(--dk-card-border);
  box-shadow: 0 8px 24px rgba(2, 9, 28, 0.38);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  animation: dk-card-in 0.36s ease both;
}

.dk-card-wrap:nth-child(2n) { animation-delay: 0.03s; }
.dk-card-wrap:nth-child(3n) { animation-delay: 0.05s; }

@media (hover: hover) {
  .dk-card-wrap:hover {
    transform: translateY(-3px);
    border-color: rgba(196, 216, 255, 0.4);
    box-shadow: 0 16px 34px rgba(1, 6, 22, 0.55);
  }
}

.dk-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 3px;
  background: rgba(5, 11, 29, 0.62);
}

.dk-card {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 9px;
  background: linear-gradient(165deg, #1d3f81 0%, #102652 100%);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Evrim varyantı — mor çerçeve + EVO rozeti */
.dk-card--evolution {
  box-shadow: inset 0 0 0 2px rgba(168, 85, 247, 0.85);
}

.dk-card--evolution::after {
  content: 'EVO';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #d8b4fe;
  background: rgba(0, 0, 0, 0.68);
  border-radius: 3px;
  padding: 1px 3px;
  line-height: 1.3;
  pointer-events: none;
}

/* Hero varyantı — altın çerçeve + HERO rozeti */
.dk-card--hero {
  box-shadow: inset 0 0 0 2px rgba(251, 191, 36, 0.85);
}

.dk-card--hero::after {
  content: 'HERO';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #fde68a;
  background: rgba(0, 0, 0, 0.68);
  border-radius: 3px;
  padding: 1px 3px;
  line-height: 1.3;
  pointer-events: none;
}

/* Kule kartı satırı */
.dk-tower-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(5, 11, 29, 0.42);
  border-top: 1px solid rgba(141, 172, 238, 0.12);
}

.dk-tower-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(200, 220, 244, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dk-tower-card {
  width: 22px;
  aspect-ratio: 0.76;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(186, 214, 246, 0.22);
  flex-shrink: 0;
}

.dk-tower-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.dk-tower-name {
  font-size: 0.64rem;
  color: rgba(208, 225, 245, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dk-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 11px 12px 12px;
}

.dk-name-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.dk-name {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-family: 'ClashBold', Arial, sans-serif;
  font-size: 0.91rem;
  line-height: 1.25;
  color: var(--dk-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dk-elixir {
  --elixir-color: #e8f2ff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(3, 9, 26, 0.72);
  border: 1px solid rgba(176, 202, 255, 0.16);
  line-height: 1;
  white-space: nowrap;
}

.dk-elixir-icon {
  width: 12px;
  height: 12px;
  display: block;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
}

.dk-elixir-value {
  color: var(--elixir-color);
  font-size: 0.71rem;
  font-weight: 800;
  line-height: 1;
}

.dk-desc {
  margin: 0 0 8px;
  color: rgba(221, 230, 252, 0.65);
  font-size: 0.75rem;
  line-height: 1.5;
  overflow: visible;
}

.dk-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.dk-tag {
  border-radius: 999px;
  border: 1px solid rgba(165, 189, 245, 0.24);
  background: rgba(87, 132, 228, 0.16);
  color: rgba(230, 239, 255, 0.8);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  padding: 3px 7px;
}

.dk-actions {
  margin-top: auto;
  display: flex;
}

.dk-copy-btn {
  width: 100%;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 224, 149, 0.34);
  background: linear-gradient(160deg, rgba(255, 209, 102, 0.2) 0%, rgba(255, 169, 66, 0.14) 100%);
  color: #ffeec8;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.dk-copy-btn:active {
  transform: scale(0.98);
}

@media (hover: hover) {
  .dk-copy-btn:hover {
    border-color: rgba(255, 225, 146, 0.6);
    background: linear-gradient(160deg, rgba(255, 214, 123, 0.3) 0%, rgba(255, 174, 74, 0.2) 100%);
    color: #fff4d7;
  }
}

.dk-copy-btn--done {
  border-color: rgba(110, 231, 183, 0.58);
  background: linear-gradient(150deg, rgba(17, 185, 129, 0.32) 0%, rgba(5, 150, 105, 0.22) 100%);
  color: var(--dk-success);
}

/* ==========================================================
   Toast
   ========================================================== */

.decks-toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%) translateY(12px);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  max-width: calc(100vw - 32px);
  border-radius: 999px;
  border: 1px solid rgba(151, 180, 242, 0.25);
  background: rgba(6, 14, 35, 0.95);
  color: var(--dk-text);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-align: center;
  padding: 10px 20px;
  box-shadow: 0 8px 26px rgba(1, 5, 16, 0.62);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.decks-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================
   Focus states
   ========================================================== */

.dk-tab:focus-visible,
.dk-copy-btn:focus-visible {
  outline: 2px solid rgba(120, 179, 255, 0.9);
  outline-offset: 2px;
}

/* ==========================================================
   Responsive
   ========================================================== */

@media (max-width: 1100px) {
  .decks-main {
    padding-left: 18px;
    padding-right: 18px;
  }

  .decks-tab-nav {
    padding-left: 10px;
    padding-right: 10px;
  }

  .dk-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  }
}

@media (max-width: 900px) {
  .decks-main {
    padding-top: 0;
    padding-bottom: 32px;
  }

  .decks-header {
    padding: 14px 0 10px;
  }

  .decks-header-inner {
    border-radius: 18px;
    padding: 16px;
  }

  .decks-header-inner::after {
    opacity: 0.5;
  }

  .decks-title {
    font-size: 1.6rem;
    margin-bottom: 6px;
  }

  .decks-subtitle {
    margin-bottom: 12px;
    font-size: 0.86rem;
    line-height: 1.45;
  }

  .decks-tab-nav {
    margin-bottom: 6px;
    border-radius: 14px;
  }

  .decks-tab-track {
    padding: 8px 0 9px;
  }

  .dk-tab {
    padding: 6px 13px;
    font-size: 0.78rem;
  }

  #deckSections {
    padding-top: 16px;
    gap: 16px;
  }

  .dk-section {
    border-radius: 16px;
    scroll-margin-top: 64px;
  }

  .dk-section-header {
    gap: 10px;
    padding: 13px 14px;
  }

  .dk-section-icon {
    font-size: 1.55rem;
  }

  .dk-section-title {
    font-size: 1.03rem;
  }

  .dk-section-count {
    font-size: 0.66rem;
  }

  .dk-section-seo {
    font-size: 0.77rem;
  }

  .dk-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px;
  }

  .dk-card-wrap {
    border-radius: 12px;
  }

  .dk-cards-grid {
    gap: 2px;
    padding: 2px;
  }

  .dk-card {
    border-radius: 7px;
  }

  .dk-tower-row {
    padding: 4px 8px;
    gap: 5px;
  }

  .dk-tower-card {
    width: 20px;
  }

  .dk-tower-name {
    font-size: 0.6rem;
  }

  .dk-info {
    padding: 9px 9px 10px;
  }

  .dk-name {
    font-size: 0.82rem;
  }

  .dk-elixir {
    padding: 2px 7px;
  }

  .dk-elixir-icon {
    width: 11px;
    height: 11px;
  }

  .dk-elixir-value {
    font-size: 0.65rem;
  }

  .dk-desc {
    font-size: 0.7rem;
    margin-bottom: 7px;
  }

  .dk-tag {
    font-size: 0.61rem;
    padding: 2px 6px;
  }

  .dk-tags {
    margin-bottom: 8px;
  }

  .dk-copy-btn {
    min-height: 36px;
    font-size: 0.74rem;
  }

  .decks-toast {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    font-size: 0.78rem;
    padding: 9px 16px;
    white-space: normal;
  }
}

@media (max-width: 700px) {
  .decks-header {
    padding: 12px 0 8px;
  }

  .decks-title {
    font-size: 1.45rem;
  }

  .decks-subtitle {
    font-size: 0.82rem;
    margin-bottom: 10px;
  }

  .decks-tab-track {
    gap: 5px;
    padding: 7px 0 8px;
  }

  .dk-tab {
    font-size: 0.74rem;
    padding: 6px 11px;
  }

  .dk-section {
    border-radius: 14px;
  }

  .dk-section-header {
    padding: 12px;
  }

  .dk-section-title-row {
    gap: 6px;
  }

  .dk-section-title {
    flex: 1 1 100%;
    font-size: 0.97rem;
    line-height: 1.25;
  }

  .dk-section-count {
    margin-left: 0;
  }

  .dk-section-seo {
    font-size: 0.73rem;
  }

  .dk-grid {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 9px;
  }

  .dk-info {
    padding: 9px;
  }

  .dk-name-row {
    gap: 6px;
  }

  .dk-name {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .dk-copy-btn {
    min-height: 38px;
    font-size: 0.76rem;
  }
}

@media (max-width: 420px) {
  .dk-grid {
    gap: 8px;
    padding: 8px;
  }

  .dk-section-header {
    padding: 11px 12px;
  }

  .dk-section-icon {
    display: none;
  }

  .dk-section-title-row {
    gap: 6px;
  }

  .dk-section-seo {
    font-size: 0.74rem;
  }

  .dk-info {
    padding: 8px;
  }

  .dk-name {
    font-size: 0.77rem;
  }

  .dk-elixir-icon {
    width: 10px;
    height: 10px;
  }

  .dk-elixir-value {
    font-size: 0.61rem;
  }

  .dk-tag {
    font-size: 0.58rem;
  }

  .dk-copy-btn {
    min-height: 34px;
    font-size: 0.71rem;
  }
}

/* ==========================================================
   Animations
   ========================================================== */

@keyframes dk-section-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dk-card-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dk-section,
  .dk-card-wrap {
    animation: none;
  }

  .dk-tab,
  .dk-card-wrap,
  .dk-copy-btn,
  .decks-toast {
    transition: none;
  }
}
