* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  font-family: "Inter", sans-serif;
  background: #080c14;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}

.page-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
  gap: 0;
}

.app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: radial-gradient(
    ellipse at 50% 120%,
    #0a3d2a 0%,
    #0c1f2e 40%,
    #080c14 70%
  );
}

.app::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: radial-gradient(
    ellipse at 50% 100%,
    rgba(30, 120, 70, 0.35) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}
/* Header */

.hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.hdr-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hdr-logo {
  font-size: 1.6em;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #b4ff00;
  display: flex;
  align-items: center;
  letter-spacing: -1px;
  text-decoration: none;
}

.hdr-logo span {
  font-weight: 400;
}

.hdr-lang {
  position: relative;
}

.fullscreen-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  cursor: pointer;
  transition: all 0.2s;
}

.fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ddd;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.lang-dropdown {
  position: absolute;
  top: 110%;
  left: 0;
  background: #1a1e2e;
  border: 1px solid #2a2e3e;
  border-radius: 8px;
  padding: 6px 0;
  min-width: 200px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.lang-dropdown.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #ccc;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.9em;
  text-decoration: none;
  white-space: nowrap;
}

.lang-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.lang-item.active {
  color: #b4ff00;
  font-weight: 600;
}

.lang-flag-img {
  width: 24px;
  height: 16px;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

.lang-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 0;
}
/* ===== Shared Card Layout (container-query scaled) ===== */

.fc-card {
  position: relative;
  overflow: visible;
  container-type: inline-size;
}

.fc-card .fc-bg {
  width: 100%;
  display: block;
}

.fc-card .fc-ovr {
  position: absolute;
  top: 20%;
  left: 2%;
  width: 28.5%;
  text-align: center;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 16cqi;
  font-weight: 500;
  color: var(--card-side-color, #fff);
  line-height: 1;
}

.fc-card .fc-pos {
  position: absolute;
  top: 33%;
  left: 2%;
  width: 28.5%;
  text-align: center;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 11cqi;
  font-weight: 500;
  color: var(--card-side-color, #fff);
}

.fc-card .fc-salary {
  position: absolute;
  top: 45%;
  left: 2%;
  width: 28.5%;
  text-align: center;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 9cqi;
  font-weight: 400;
  color: var(--card-side-color, #fff);
}

.fc-card .fc-player {
  position: absolute;
  top: 21.5%;
  right: 2%;
  width: 80%;
  z-index: 1;
}

.fc-card .fc-grade {
  position: absolute;
  bottom: 29%;
  left: 6%;
  width: 22%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  border-radius: 1%;
  color: #fff;
  font-size: 10cqi;
  z-index: 2;
}

.fc-card .fc-name-area {
  position: absolute;
  bottom: 10%;
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 2;
}

.fc-card .fc-name {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  max-width: calc(100% - 10px);
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: clip;
  gap: 1.5cqi;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 10cqi;
  font-weight: 700;
  color: var(--card-name-color, #fff);
  text-transform: uppercase;
  letter-spacing: 0.3cqi;
  box-sizing: border-box;
}

.fc-card .fc-name .badged {
  width: 14cqi;
  height: 10cqi;
  flex-shrink: 0;
  display: inline-block;
}

.fc-card .fc-flags {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2%;
  margin-top: 1%;
}

.fc-card .fc-flags img {
  width: 10%;
  height: 5%;
  aspect-ratio: 1;
  object-fit: cover;
}

.fc-card .fc-flags img:first-child {
  aspect-ratio: 2 / 1;
  object-fit: contain;
}
/* Card Area */

.card-area {
  display: flex;
  gap: 16px;
  padding: 20px 16px 10px;
  align-items: flex-start;
  position: relative;
  z-index: 2;
}

.card-wrap {
  width: 140px;
  min-width: 140px;
  flex-shrink: 0;
  border-radius: 8px;
}
/* Grade Colors */

.g1 {
  background: #555;
}

.g2 {
  background: #555;
}

.g3 {
  background: #555;
}

.g4 {
  background: #c08040;
  color: #222 !important;
}

.g5 {
  background: #b8b8b8;
  color: #222 !important;
}

.g6 {
  background: #b8b8b8;
  color: #222 !important;
}

.g7 {
  background: #b8b8b8;
  color: #222 !important;
}

.g8 {
  background: #d48a3c;
  color: #222 !important;
}

.g9 {
  background: #d48a3c;
  color: #222 !important;
}

.g10 {
  background: #daa520;
  color: #222 !important;
}

.g11 {
  background: linear-gradient(
    135deg,
    #c0c0c0 0%,
    #e0e0e0 40%,
    #7ec8e3 70%,
    #4da6d9 100%
  );
  color: #222 !important;
}

.g12 {
  background: linear-gradient(
    135deg,
    #c0c0c0 0%,
    #e0e0e0 40%,
    #7ec8e3 70%,
    #4da6d9 100%
  );
  color: #222 !important;
}
/* Stats */

.stats {
  flex: 1;
  padding-top: 5px;
}

.stat-name {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.stat-name .season-badge {
  background: #8b5e3c;
  color: #fff;
  font-size: 0.6em;
  padding: 1px 5px;
  border-radius: 2px;
  font-weight: 700;
}

.stat-name .pname {
  font-size: 1.15em;
  font-weight: 700;
  color: #e8d5a3;
  text-decoration: none;
}

.stat-name .pname:hover {
  text-decoration: none;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82em;
  padding: 2px 0;
  color: #b0b0b0;
}

.stat-row .sv {
  color: #fff;
  font-weight: 600;
}

.stat-row .sv .delta {
  color: #2ecc71;
  font-size: 0.8em;
  margin-left: 4px;
}

.stars {
  color: #ffd700;
  font-size: 0.9em;
  letter-spacing: 1px;
}

.stars .empty {
  color: #555;
}

.stat-grade-select {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.stat-grade-select .s-input {
  background: #1a1a22;
  color: #fff;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.78em;
  font-family: inherit;
  cursor: pointer;
  margin-top: 10px;
}

.stat-grade-select .s-input:focus {
  outline: 1px solid #00bfff;
}

.grade-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 0.85em;
  color: #fff;
  min-width: 28px;
  text-align: center;
}
/* Panel */

.panel {
  background: rgba(18, 18, 24, 0.95);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  padding: 16px;
  position: relative;
  z-index: 5;
  flex: 1;
}

.panel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85em;
  color: #aaa;
}

.panel-row .pr-val {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #888;
}

.panel-row .pr-val .ico {
  font-size: 1.1em;
}
/* Gauge */

.gauge-section {
  padding: 12px 0;
}

.gauge-label {
  font-size: 0.85em;
  color: #ccc;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gauge-bar {
  display: flex;
  gap: 0;
  height: 38px;
  margin-bottom: 4px;
  position: relative;
  border-radius: 3px;
  overflow: hidden;
  background: repeating-linear-gradient(
    45deg,
    #1a1a22,
    #1a1a22 8px,
    #151520 8px,
    #151520 16px
  );
}

.gauge-seg {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3em;
  font-weight: 300;
  color: #444;
  z-index: 3;
  background: transparent;
  border-right: 2px solid #0a0a12;
}

.gauge-seg:first-child {
  border-radius: 3px 0 0 3px;
}

.gauge-seg:last-child {
  border-radius: 0 3px 3px 0;
  border-right: none;
}

.gauge-seg .seg-fill {
  display: none;
}

.gauge-seg span {
  position: relative;
  z-index: 4;
}

.gauge-seg.filled span {
  color: #0a0a12;
  font-weight: 600;
}
/* Single continuous fill bar */

.gauge-fill-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  z-index: 2;
  transition: width 0.5s ease-out;
  background: repeating-linear-gradient(
    45deg,
    #00bfff,
    #00bfff 8px,
    #009acd 8px,
    #009acd 16px
  );
  box-shadow: 0 0 12px rgba(0, 191, 255, 0.4);
  border-radius: 3px;
  pointer-events: none;
}

.gauge-boost-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  z-index: 1;
  transition: width 0.5s ease-out;
  background: repeating-linear-gradient(
    45deg,
    #f5c842,
    #f5c842 8px,
    #d4a828 8px,
    #d4a828 16px
  );
  box-shadow: 0 0 12px rgba(245, 200, 66, 0.4);
  border-radius: 3px;
  pointer-events: none;
}

.boost-val {
  color: #f5c842;
  font-weight: 600;
}

.boost-select {
  background: #2a2a35;
  color: #f5c842;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.85em;
  font-family: inherit;
  cursor: pointer;
}

.boost-select:focus {
  outline: 1px solid #f5c842;
}

.boost-arrow {
  display: inline-block;
  color: #f5c842;
  font-size: 1.1em;
  margin-right: 4px;
}
/* Material Slots - Card Style */

.mat-area {
  margin: 12px 0;
}

.mat-slots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.mat-slot {
  background: linear-gradient(160deg, #22252e 0%, #181a22 50%, #1a1c24 100%);
  border: none;
  border-radius: 6px;
  aspect-ratio: 3/4.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
  transition: all 0.3s;
  cursor: pointer;
  clip-path: polygon(50% 0%, 100% 8%, 100% 92%, 50% 100%, 0% 92%, 0% 8%);
}

.mat-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 12px,
    rgba(255, 255, 255, 0.015) 12px,
    rgba(255, 255, 255, 0.015) 24px
  );
  pointer-events: none;
}
/* Empty state: + icon */

.mat-slot .plus {
  font-size: 1.8em;
  color: #444;
  line-height: 1;
}
/* Editing state: visible input */

.mat-slot .mat-edit {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 90%;
}

.mat-slot .mat-edit-label {
  font-size: 0.5em;
  color: #888;
  letter-spacing: 1px;
}

.mat-slot .mat-edit-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid #00bfff;
  color: #fff;
  font-size: 1.3em;
  font-weight: 800;
  text-align: center;
  padding: 2px 0;
  font-family: inherit;
  outline: none;
}

.mat-slot .mat-edit-input::placeholder {
  color: #555;
  font-weight: 400;
  font-size: 0.7em;
}
/* Filled state: card display */

.mat-slot .mat-content {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 6px 4px;
}

.mat-slot .mat-ovr-label {
  font-size: 0.55em;
  color: #888;
  font-weight: 500;
  letter-spacing: 1px;
  margin-bottom: 1px;
}

.mat-slot .mat-ovr-num {
  font-size: 1.5em;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.mat-slot .mat-bar-wrap {
  width: 80%;
  height: 5px;
  background: #333;
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}

.mat-slot .mat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2ecc71, #27ae60);
  width: 0%;
  transition: width 0.3s;
  border-radius: 3px;
}

.mat-slot .mat-pct {
  font-size: 0.9em;
  color: #2ecc71;
  margin-top: 2px;
  font-weight: 600;
}
/* Delete button — inside hex bounds */

.mat-slot .mat-del {
  position: absolute;
  top: 8%;
  right: 2px;
  width: 18px;
  height: 18px;
  background: rgba(231, 76, 60, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 0.6em;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  line-height: 1;
  padding: 0;
}
/* State management */

.mat-slot.editing .plus {
  display: none;
}

.mat-slot.editing .mat-edit {
  display: flex;
}

.mat-slot.editing {
  filter: drop-shadow(0 0 6px rgba(0, 191, 255, 0.8));
  background: linear-gradient(160deg, #1a2030 0%, #141822 50%, #161a24 100%);
  cursor: default;
}

.mat-slot.has-val .plus {
  display: none;
}

.mat-slot.has-val .mat-edit {
  display: none;
}

.mat-slot.has-val .mat-content {
  display: flex;
}

.mat-slot.has-val .mat-del {
  display: flex;
}

.mat-slot.has-val {
  border-color: #3a4050;
  background: linear-gradient(160deg, #272b36 0%, #1e2028 50%, #1c1e26 100%);
  cursor: default;
}

.mat-hint {
  text-align: center;
  font-size: 0.72em;
  color: #666;
  margin-top: 6px;
}
/* Bottom Buttons */

.bottom-btns {
  display: flex;
  gap: 10px;
  margin: 14px 0 8px;
}

.btn-protect {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  background: #1a1a22;
  border: 1px solid #333;
  border-radius: 10px;
  color: #aaa;
  font-size: 0.82em;
  cursor: pointer;
  transition: all 0.3s;
  user-select: none;
}

.btn-protect.active {
  border-color: #2ecc71;
  color: #2ecc71;
  background: linear-gradient(160deg, #1a2a1e 0%, #1a1a22 100%);
}

.btn-protect .bico {
  font-size: 1.2em;
}

.btn-stats {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  background: #1a1a22;
  border: 1px solid #333;
  border-radius: 10px;
  color: #aaa;
  font-size: 0.82em;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-stats:hover {
  border-color: #00bfff;
  color: #00bfff;
  background: linear-gradient(160deg, #0a1a2a 0%, #1a1a22 100%);
}

.btn-stats .bico {
  font-size: 1.2em;
}
/* ===== STATS MODAL ===== */

.stats-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.stats-modal-overlay.show {
  display: flex;
}

.stats-modal {
  background: linear-gradient(160deg, #1a1e2e 0%, #12141c 100%);
  border: 1px solid #2a2e3e;
  border-radius: 16px;
  width: 92%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.stats-modal::-webkit-scrollbar {
  width: 4px;
}

.stats-modal::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 2px;
}

.stats-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.stats-modal-title {
  font-size: 1.15em;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-modal-close {
  background: none;
  border: none;
  color: #666;
  font-size: 1.4em;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.stats-modal-close:hover {
  color: #e74c3c;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82em;
}

.stats-table th {
  color: #888;
  font-weight: 500;
  text-align: center;
  padding: 8px 4px;
  border-bottom: 1px solid #2a2e3e;
  font-size: 0.9em;
  white-space: nowrap;
}

.stats-table td {
  text-align: center;
  padding: 7px 4px;
  color: #ccc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.stats-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.stats-table .grade-col {
  font-weight: 700;
  color: #fff;
}

.stats-table .success-col {
  color: #2ecc71;
}

.stats-table .fail-col {
  color: #e74c3c;
}

.stats-rate-bar {
  width: 100%;
  height: 4px;
  background: #2a1a1a;
  border-radius: 2px;
  margin-top: 3px;
  overflow: hidden;
}

.stats-rate-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

.stats-total-row td {
  border-top: 1px solid #2a2e3e;
  font-weight: 700;
  color: #fff;
  padding-top: 10px;
}

.stats-empty {
  text-align: center;
  color: #555;
  padding: 30px 0;
  font-size: 0.95em;
}

.stats-clear-btn {
  width: 100%;
  padding: 10px;
  margin-top: 16px;
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: 8px;
  color: #e74c3c;
  font-size: 0.85em;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.stats-clear-btn:hover {
  background: rgba(231, 76, 60, 0.2);
  border-color: #e74c3c;
}
/* Upgrade Button */

.upgrade-btn-wrap {
  padding: 8px 0 20px;
  position: relative;
  z-index: 10;
}

.upgrade-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 30px;
  font-size: 1.15em;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  background: linear-gradient(180deg, #2ecc71 0%, #1a9c54 100%);
  box-shadow: 0 4px 20px rgba(46, 204, 113, 0.35);
  transition:
    transform 0.1s,
    opacity 0.2s;
}

.upgrade-btn:active {
  transform: scale(0.97);
}

.upgrade-btn:disabled {
  background: #333;
  color: #666;
  box-shadow: none;
  cursor: not-allowed;
}
/* Settings Row */

.settings-row {
  display: none;
}

.s-input {
  flex: 1;
  background: #1a1a22;
  border: 1px solid #333;
  color: #fff;
  padding: 8px;
  border-radius: 6px;
  font-size: 0.85em;
  text-align: center;
  font-family: inherit;
}

.s-input:focus {
  outline: none;
  border-color: #00bfff;
}

select.s-input {
  appearance: auto;
}
/* Prob Display */

.prob-display {
  text-align: right;
  font-size: 0.78em;
  color: #888;
  margin-bottom: 6px;
}

.prob-display .real {
  color: #00bfff;
}
/* ===== LIGHT BURST OVERLAY ===== */

.burst-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9998;
  display: none;
  justify-content: center;
  align-items: center;
  background: #000;
  flex-direction: column;
  overflow: hidden;
}

.burst-overlay.show {
  display: flex;
}

.burst-overlay .burst-card {
  width: 200px;
  position: relative;
  z-index: 5;
  overflow: visible;
  transition: filter 0.1s;
}

.burst-overlay .burst-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 60%,
    #0a2a3a 0%,
    #060c16 60%,
    #000 100%
  );
}

.burst-overlay .burst-bg::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: radial-gradient(
    ellipse at 50% 100%,
    rgba(30, 120, 70, 0.3) 0%,
    transparent 70%
  );
}
/* Spotlight from above */

.burst-spotlight {
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 350px;
  height: 75%;
  z-index: 3;
  opacity: 0;
  background: linear-gradient(
    180deg,
    rgba(180, 220, 255, 0.6) 0%,
    rgba(100, 200, 255, 0.25) 25%,
    rgba(100, 200, 255, 0.08) 50%,
    transparent 80%
  );
  clip-path: polygon(35% 0%, 65% 0%, 90% 100%, 10% 100%);
  filter: blur(25px);
}
/* Side spotlight glow */

.burst-spot-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 55%;
  z-index: 2;
  opacity: 0;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(150, 210, 255, 0.18) 0%,
    rgba(100, 180, 255, 0.06) 40%,
    transparent 70%
  );
  filter: blur(10px);
}
/* Vertical light beams - from top */

.burst-beam {
  position: absolute;
  left: 50%;
  top: -5%;
  width: 4px;
  height: 110%;
  background: linear-gradient(
    180deg,
    rgba(100, 200, 255, 0.6) 0%,
    rgba(100, 200, 255, 0.3) 40%,
    transparent 100%
  );
  z-index: 3;
  opacity: 0;
}

.burst-beam.b1 {
  width: 3px;
  margin-left: 0;
}

.burst-beam.b2 {
  width: 2px;
  margin-left: -40px;
}

.burst-beam.b3 {
  width: 1px;
  margin-left: 50px;
}

.burst-beam.b4 {
  width: 3px;
  margin-left: -80px;
}

.burst-beam.b5 {
  width: 1px;
  margin-left: 70px;
}

.burst-beam.b6 {
  width: 2px;
  margin-left: 30px;
}

.burst-beam.b7 {
  width: 1px;
  margin-left: -25px;
}
/* Card shake animation - progressive */

@keyframes card-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10% {
    transform: translateX(-2px);
  }
  20% {
    transform: translateX(2px);
  }
  30% {
    transform: translateX(-4px);
  }
  40% {
    transform: translateX(4px);
  }
  50% {
    transform: translateX(-6px);
  }
  60% {
    transform: translateX(7px);
  }
  70% {
    transform: translateX(-9px);
  }
  80% {
    transform: translateX(11px);
  }
  90% {
    transform: translateX(-14px);
  }
  95% {
    transform: translateX(14px);
  }
}

.burst-card.shaking {
  animation: card-shake 0.4s ease-in-out infinite;
}

.burst-card.shaking-intense {
  animation: card-shake 0.15s linear infinite;
}
/* Purple chromatic aberration shadow */

.burst-card.purple-shadow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
  z-index: -1;
  opacity: 0.6;
  filter: brightness(0) drop-shadow(0 0 20px rgba(200, 50, 255, 0.8));
  mix-blend-mode: screen;
}
/* Skip button */

.burst-skip {
  position: absolute;
  bottom: 30px;
  right: 20px;
  color: #e74c3c;
  font-weight: 700;
  font-size: 0.9em;
  cursor: pointer;
  z-index: 20;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}
/* ===== RESULT OVERLAY ===== */

.result-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: flex-start;
  background: radial-gradient(
    ellipse at 50% 60%,
    #0a2a3a 0%,
    #060c16 60%,
    #000 100%
  );
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}

.result-overlay::-webkit-scrollbar {
  display: none;
}

.result-overlay.show {
  display: flex;
}

.result-overlay::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 250px;
  background: radial-gradient(
    ellipse at 50% 100%,
    rgba(30, 120, 70, 0.4) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.result-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 420px;
  padding: 20px;
  position: relative;
  z-index: 2;
  margin: auto;
}
/* Result Card Wrapper */

.result-card-wrapper {
  position: relative;
  width: 200px;
  margin: 20px auto;
  z-index: 5;
}
/* Result Card */

.result-card {
  width: 100%;
  height: auto;
  position: relative;
  opacity: 0;
  transform: scale(1.08);
  transition:
    opacity 0.5s ease,
    transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.result-card.card-visible {
  opacity: 1;
  transform: scale(1);
}
/* Glow effect for success */

.result-overlay.success .result-card.card-visible::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140%;
  height: 140%;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.3) 20%,
    rgba(0, 255, 234, 0.15) 45%,
    transparent 70%
  );
  border-radius: 50%;
  z-index: -1;
  animation: glow-pulse 2s infinite alternate;
}

.result-overlay.success .result-card.card-settled {
  animation: card-float 3s ease-in-out infinite;
}

.result-overlay.fail .result-card.card-settled {
  filter: grayscale(0.8) brightness(0.5);
}

@keyframes glow-pulse {
  0% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
}

@keyframes card-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}
/* Result text sections - fade in */

.result-text-wrap {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 1.2s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.6s ease;
  width: 100%;
}

.result-text-wrap.expand {
  max-height: 600px;
  opacity: 1;
  overflow: visible;
}

.result-title {
  font-size: 1.6em;
  font-weight: 700;
  margin: 10px 0 16px;
  text-align: center;
  opacity: 0;
  transform: translateY(15px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.result-title.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.result-overlay.success .result-title {
  color: #e8d5a3;
  text-shadow: 0 0 20px rgba(232, 213, 163, 0.5);
}

.result-overlay.fail .result-title {
  color: #e74c3c;
  text-shadow: 0 0 20px rgba(231, 76, 60, 0.4);
}
/* Result Stats Card */

.result-stats {
  background: rgba(18, 18, 24, 0.9);
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: translateY(15px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.result-stats.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.rs-name {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.rs-name .season-badge {
  background: #8b5e3c;
  color: #fff;
  font-size: 0.6em;
  padding: 1px 5px;
  border-radius: 2px;
  font-weight: 700;
}

.rs-name .pname {
  font-size: 1em;
  font-weight: 700;
  color: #e8d5a3;
}

.rs-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82em;
  padding: 3px 0;
  color: #b0b0b0;
}

.rs-row .sv {
  color: #fff;
  font-weight: 600;
}

.rs-row .delta {
  color: #2ecc71;
  font-size: 0.78em;
  margin-left: 4px;
}
/* Result bottom */

.result-bottom {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  width: 100%;
  align-items: center;
  opacity: 0;
  transform: translateY(15px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.result-bottom.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.result-stats-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #aaa;
  font-size: 0.82em;
  cursor: pointer;
  transition: color 0.2s;
}

.result-stats-btn:hover {
  color: #00bfff;
}

.result-stats-btn .ico {
  font-size: 1.1em;
}

.result-select-btn {
  margin-left: auto;
  padding: 10px 28px;
  background: #2a6049;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9em;
}

.result-retry-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #aaa;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85em;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s;
  margin-left: auto;
}

.result-retry-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.result-next-btn {
  width: 100%;
  padding: 14px 0;
  border: none;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(to bottom, #2ecc71, #27ae60);
  cursor: pointer;
  margin-top: 15px;
  font-family: inherit;
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
  opacity: 0;
  transform: translateY(15px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease,
    box-shadow 0.2s,
    background 0.2s;
}

.result-next-btn:hover {
  background: linear-gradient(to bottom, #27ae60, #219150);
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.6);
  transform: translateY(0) scale(1.02);
}

.result-next-btn:active {
  transform: translateY(1px);
}

.result-next-btn.fade-in {
  opacity: 1;
  transform: translateY(0);
}
/* Short screens: scale down result to fit */

@media (max-height: 640px) {
  .result-card-wrapper {
    width: 160px;
    margin: 10px auto;
  }
  .result-inner {
    padding: 10px 16px;
  }
  .result-title {
    font-size: 1.3em;
    margin: 6px 0 10px;
  }
  .result-stats {
    padding: 10px;
    margin-top: 6px;
  }
  .result-bottom {
    margin-top: 10px;
  }
  .result-next-btn {
    padding: 10px;
    margin-top: 8px;
  }
}
/* Particles */

.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.9),
    rgba(255, 255, 255, 0.4)
  );
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
  /* Increased blur */
  filter: blur(5px);
  /* Slight blur for "fuzzy" edges */
  z-index: 100;
}
/* Rain particles for burst */

.rain-particle {
  position: absolute;
  width: 1px;
  background: linear-gradient(180deg, rgba(150, 200, 255, 0.8), transparent);
  z-index: 3;
  pointer-events: none;
}
/* Smoke particles for fail */

.smoke-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10;
  background: radial-gradient(
    circle,
    rgba(80, 80, 80, 0.6) 0%,
    rgba(40, 40, 40, 0.3) 40%,
    transparent 70%
  );
  filter: blur(4px);
}
/* Shatter Effect */

.shatter-effect {
  position: absolute;
  transform: translate(-50%, -50%) scale(1.5);
  width: 256px;
  height: 256px;
  background-image: url("images/shatter_sprite.webp");
  background-size: 2048px auto;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 100;
  display: none;
}

.shatter-effect.animate {
  display: block;
  animation:
    shatter-play 0.8s step-end forwards,
    shatter-scale 0.8s ease-out forwards;
  filter: brightness(2) contrast(1.2) drop-shadow(0 0 25px #fff);
  mix-blend-mode: screen;
}

@keyframes shatter-scale {
  0% {
    transform: translate(-50%, -50%) scale(2.7);
  }
  100% {
    transform: translate(-50%, -50%) scale(2.7);
    opacity: 0;
  }
}

@keyframes shatter-scale-mobile {
  0% {
    transform: translate(-50%, -50%) scale(2.1);
  }
  100% {
    transform: translate(-50%, -50%) scale(2.1);
    opacity: 0;
  }
}

@keyframes shatter-play {
  /* Row 1 */
  0% {
    background-position: 0px 0px;
  }
  5.5% {
    background-position: -256px 0px;
  }
  11.1% {
    background-position: -512px 0px;
  }
  16.6% {
    background-position: -768px 0px;
  }
  22.2% {
    background-position: -1024px 0px;
  }
  27.7% {
    background-position: -1280px 0px;
  }
  33.3% {
    background-position: -1536px 0px;
  }
  38.8% {
    background-position: -1792px 0px;
  }
  /* Row 2 */
  44.4% {
    background-position: 0px -256px;
  }
  50.0% {
    background-position: -256px -256px;
  }
  55.5% {
    background-position: -512px -256px;
  }
  61.1% {
    background-position: -768px -256px;
  }
  66.6% {
    background-position: -1024px -256px;
  }
  72.2% {
    background-position: -1280px -256px;
  }
  77.7% {
    background-position: -1536px -256px;
  }
  83.3% {
    background-position: -1792px -256px;
  }
  /* Row 3 */
  88.8% {
    background-position: 0px -512px;
  }
  94.4% {
    background-position: -256px -512px;
  }
  100% {
    background-position: -256px -512px;
  }
}

.hex-badge {
  position: absolute;
  top: 45%;
  left: 4%;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--card-side-color, #fff);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 22px;
  font-weight: bold;
}

.hex-badge::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--card-side-color, #fff);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 173.2'%3E%3Cpath d='M50 0 L150 0 L200 86.6 L150 173.2 L50 173.2 L0 86.6 Z' fill='none' stroke='white' stroke-width='12'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 173.2'%3E%3Cpath d='M50 0 L150 0 L200 86.6 L150 173.2 L50 173.2 L0 86.6 Z' fill='none' stroke='white' stroke-width='12'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  z-index: -1;
}

.hex-badge span {
  margin-top: 2px;
}
/* Plus Animation */

.mat-slot .plus {
  font-size: 2em;
  color: #4a5568;
  transition: color 0.2s;
  display: block;
  animation: plus-pulse 2s infinite ease-in-out;
  line-height: 1;
}

@keyframes plus-pulse {
  0%,
  100% {
    color: #4a5568;
    opacity: 0.6;
  }
  50% {
    color: #a0aec0;
    opacity: 1;
  }
}

.mat-slot:hover .plus {
  color: #fff !important;
  opacity: 1 !important;
}
/* ===== AD SLOTS ===== */

.ad-slot {
  display: block;
  text-align: center;
  width: auto;
}

.ad-slot ins {
  margin-left: auto;
  margin-right: auto;
}

.ad-placeholder {
  color: #555;
  font-size: 0.7em;
  border: 1px dashed #333;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
}

.ad-mobile {
  padding: 8px 16px 0;
}

.ad-mobile .ad-placeholder {
  width: 320px;
  max-width: 100%;
  height: 50px;
}
/* ===== RESPONSIVE ===== */
/* Mobile: smaller card size */

@media (max-width: 539px) {
  .card-wrap {
    width: 120px;
    min-width: 120px;
  }
  .fc-card {
    min-width: 120px;
  }
  .result-card-wrapper {
    width: 160px;
    margin: 10px auto;
  }
  .burst-overlay .burst-card {
    width: 160px;
  }
  .shatter-effect.animate {
    animation:
      shatter-play 0.8s step-end forwards,
      shatter-scale-mobile 0.8s ease-out forwards;
  }
}
/* Tablet: slightly wider, allow scroll */

@media (min-width: 540px) {
  .app {
    max-width: 540px;
  }
  .card-wrap {
    width: 160px;
    min-width: 160px;
  }
}
/* Desktop: centered app, wider allowed */

@media (min-width: 1025px) {
  .app {
    max-width: 540px;
    overflow-x: visible;
  }
  .ad-mobile {
    margin-left: -80px;
    margin-right: -80px;
    padding: 12px 0 0;
  }
  .ad-mobile .ad-placeholder {
    width: 728px;
    max-width: 100%;
    height: 90px;
  }
}
/* 2K+ screens: large rectangle ad */

@media (min-width: 2560px) {
  .ad-mobile .ad-placeholder {
    width: 336px;
    height: 280px;
  }
}

.adsbygoogle.adsbygoogle-noablate {
  z-index: 2147483647 !important;
  pointer-events: none !important;
  background: transparent !important;
}

.adsbygoogle.adsbygoogle-noablate .adsbygoogle-primary-ad,
.adsbygoogle.adsbygoogle-noablate iframe,
.adsbygoogle.adsbygoogle-noablate .adsbygoogle-close-button {
  pointer-events: auto !important;
}
/* Right Desktop Ad */

.ad-desktop-right {
  display: none;
}
/* Show right ad on wide screens (enough space for app + ad) */

@media (min-width: 1150px) {
  .ad-desktop-right {
    display: block;
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    z-index: 90;
  }
}

@media (min-width: 1500px) {
  .ad-desktop-right {
    width: 300px;
    right: 40px;
  }
}
