/* ============ FONT ============ */
@font-face {
  font-family: "gothambold";
  src: url("../media/fonts/gothambold.woff2") format("woff2"),
       url("../media/fonts/gothambold.woff") format("woff"),
       url("../media/fonts/gothambold.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "gothamblack";
  src: url('../media/fonts/gothamblack.woff') format('woff'),
    url('../media/fonts/gothamblack.ttf') format('truetype'),
    url('../media/fonts/gothamblack.eot'),
    url('../media/fonts/gothamblack.eot?#iefix') format('embedded-opentype'),
    url('../media/fonts/gothamblack.woff2') format('woff2'),
    url('../media/fonts/gothamblack.svg#gothamblack') format('svg');
  font-display: swap;
}

/* -------------------------------------------------- */
/*  SHARED BASE STYLES  (used by preview + export)    */
/* -------------------------------------------------- */

:root {
  --title-size: clamp(1.8rem, 5vw, 3rem);
  --text-h1: clamp(1.4rem, 4vw, 2.3rem);
  --text-h2: clamp(1.1rem, 3vw, 1.8rem);
  --text-chara-name: clamp(0.55rem, 1.5vw, 0.9rem);
}

.card {
  box-sizing: border-box;
  background: #9B0023;
  border: 20px solid #5A0017;
  overflow: hidden;

  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 32px;
  color: #fff;
}

/* ------ Title ------ */
.card-title {
  padding-top: 2%;
  padding-bottom: 1.5%;
  font-family: "gothambold", sans-serif;
  font-size: var(--title-size);
  text-align: center;
  line-height: 1;
  margin: 0;
  text-shadow:
    2px 2px 0 #000,
    -2px 2px 0 #000,
    2px -2px 0 #000,
    -2px -2px 0 #000;
}

/* Horizontal content */
.card-inner {
  flex: 1;
  display: grid;
  grid-template-columns: 34% 1fr;   /* image | text */
  align-items: center;
  gap: 32px;
}

/* Image container */
.card-image {
  flex: 0 0 34%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card-image img {
  width: 100%;
  max-height: 80%;
  object-fit: contain;
}

/* Character name under avatar */
.card-name {
  margin-top: 8px;
  font-family: "gothamblack", sans-serif;
  font-size: var(--text-chara-name);
  text-align: center;
  line-height: 1;

  color: #fff;
  text-shadow:
    2px 2px 0 #000,
    -2px 2px 0 #000,
    2px -2px 0 #000,
    -2px -2px 0 #000;

  /* white-space: nowrap; */
}

/* Text side */
.card-text {
  justify-content: center;
  flex: 1;
  text-align: center;
}

.score-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}

.score-icon {
  width: var(--text-h1);
  height: var(--text-h1);
  object-fit: contain;
}

/* Score text */
.card-text h1 {
  margin: 0;
  font-family: "gothambold", sans-serif;
  font-size: var(--text-h1);
  line-height: 1;
  text-shadow:
    2px 2px 0 #000,
    -2px 2px 0 #000,
    2px -2px 0 #000,
    -2px -2px 0 #000;
}

.card-text h2 {
  margin: 0;
  font-family: "gothambold", sans-serif;
  font-size: var(--text-h2);
  line-height: 1;
  text-shadow:
    2px 2px 0 #000,
    -2px 2px 0 #000,
    2px -2px 0 #000,
    -2px -2px 0 #000;
}

/* -------------------------------------------------- */
/*  PREVIEW CARD (user sees)                          */
/* -------------------------------------------------- */
.card-preview {
  position: fixed;
  z-index: 1000;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: clamp(320px, 80vw, 520px);
  max-height: 85vh;
}

.card-preview.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* -------------------------------------------------- */
/*  EXPORT CARD (1080×1080 output)                    */
/* -------------------------------------------------- */
.card-export {
  width: 1080px !important;
  height: 1080px !important;
  padding: 80px !important;
  border-width: 40px !important;

  /* Use large readable export typography */
  --title-size: 110px;
  --text-h1: 80px;
  --text-h2: 64px;
  --text-chara-name: 32px;
}
