body {
    min-height: 100dvh;     
    display: flex;                    
    flex-direction: column;           
    font-family: "jali-greek-variable", "Jali Greek", sans-serif;
    margin: 0;
    background: radial-gradient(1200px 800px at 20% -10%, #1b2245, transparent 60%),
                radial-gradient(900px 700px at 120% 20%, #082b42, transparent 60%),
                var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

main {
    flex: 1;                        
    display: flex;
    justify-content: center;
    align-items: center;
}
#card-preview {
    position: relative;
    width: 372px;
    height: 520px;
    overflow: hidden;
}

/* --- Illustration : la couche la plus basse --- */
.card-illustration {
    position: absolute;
    top: 0;
    left: 0;
    width: 372px;
    height: 520px;
    z-index: 1;
}

#preview-illustration {
    position: absolute;
    inset: 0;
    width: 372px;
    height: 520px;
    object-fit: cover;
    display: block;
}

/* --- Fond transparent / cadre décoratif --- */
.back-card {
    position: relative;
    z-index: 3; /* au-dessus de l’illustration et des stats*/
    pointer-events: none;
}

#card-background {
    object-fit: cover;
    display: block;
    position: absolute;
}

/* --- Contenu textuel et symboles --- */
.card-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Texte et stats */
.card-name {
    position: absolute;
    top: 30px;
    width: 100%;
    text-align: center;
    color: #fff;
    font-weight: bold;
    font-size: 18px;
    z-index: 4;
}

.emoji {
    width: 1em;
    height: 1em;
    vertical-align: middle;
}

.zone-effect {
    line-height: 1.2em;
    position: absolute;
    top: 365px;
    left: 30px;
    right: 30px;
    color: #000;
    font-size: 15px;
    height: 300px;
    z-index: 4;
}

.card-bonus {
    line-height: 1.2em;
    position: absolute;
    top: 433px;
    left: 25px;
    right: 20px;
    color: #FFF;
    font-size: 13px;
    height: 300px;
    z-index: 4;
}

.card-type {
    position: absolute;
    top: 55px;
    width: 100%;
    text-align: center;
    color: #000;
    font-size: 14px;
    z-index: 4;
}

.card-undermark {
    position: absolute;
    top: 488px;
    width: 100%;
    text-align: center;
    color: #FFF;
    font-size: 10px;
    z-index: 4;
}

.card-hand-cost,
.card-reserve-cost,
.card-earth,
.card-leaf,
.card-ocean {
    position: absolute;
    color: #fff;
    text-shadow: 1 1 4px #000;
}

.card-hand-cost { 
    top: 19px; 
    left: 32px; 
    font-size: 32px;
    font-weight: bold;
    z-index: 4;
}
.card-reserve-cost { 
    top: 42px; left: 56px; 
    font-size: 27px;
    font-weight: bold;
    z-index: 4;
}
.card-earth {
    text-shadow: 0 0 4px #000;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.45));
    font-size: 24px;
    top: 141px; left: 27px; 
    z-index: 2;
}
.card-leaf { 
    text-shadow: 0 0 4px #000;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.45));
    font-size: 24px;
    top: 108px; left: 27px; 
    z-index: 2;
}
.card-ocean { 
    text-shadow: 0 0 4px #000;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.45));
    font-size: 24px;
    top: 174px; left: 27px; 
    z-index: 2;
}

#preview-earth{
  font-weight: 530;
  position: absolute;
  left: 13px;
  top: -1px;
}

#preview-leaf{
  font-weight: 530;
  position: absolute;
  left: 13px;

}

#preview-ocean {
  font-weight: 530;
  top: -2px;
  position: absolute;
  left: 13px;
}

#preview-lore {

  font-style: italic;
}

#leaf-background, #earth-background, #ocean-background {
  position: absolute;
}
/* =========================
   Thème & mise en page
   ========================= */
:root{
  --bg: #0f1220;
  --panel: rgba(255,255,255,0.07);
  --panel-border: rgba(255,255,255,0.12);
  --text: #e9ecf1;
  --muted: #a9b0c3;
  --accent: #6ea8ff;
  --accent-2:#8ef0ff;
  --success:#36d399;
  --shadow: 0 12px 30px rgba(0,0,0,.35);
}

html,body{
  height:100%;
}


/* conteneur 2 colonnes */
#form{
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(8px);
  padding: 20px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  width: 800px;
  display: grid;
  grid-template-columns: 1fr;      /* mobile: 1 col */
  gap: 16px 24px;
  align-items: start;
}

label{
  display:block;
  margin: 8px 0 6px;
  font-size: 14px;
  color: var(--muted);
}

input[type="text"],
input[type="number"],
select,
textarea{
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.type {
  display: flex;
  gap: 2%;
}

#card-type {
  width: 30%;
}

.faction, .rarity {
  width: 49%;
}

.selects {
  width: 100%;
  display: flex;
  gap: 2%;
}

#hand-cost-div, #reserve-cost-div {
  width: 49%;
}

.cost-div {
  display: flex;
  gap: 2%;
}

textarea{
  min-height: 70px;
  resize: vertical;
}

input[type="text"]::placeholder,
textarea::placeholder{
  color: #cbd4e0;
  opacity: .6;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus{
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(142,240,255,.15);
  background: rgba(255,255,255,0.09);
}

/* input fichier */
input[type="file"]{
  border: 1px dashed rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.04);
  padding: 10px;
  border-radius: 12px;
}

/* bouton */
#create-card-form input[type="submit"],
input[type="submit"]{
  margin-top: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #08111a;
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, filter .2s ease;
}
#create-card-form input[type="submit"]:hover{
  filter: saturate(1.15);
  transform: translateY(-1px);
}
#create-card-form input[type="submit"]:active{
  transform: translateY(0);
}

/* petites puces / radios mieux alignées */
#form .radios, #form .inline, #form .radio-group{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
}

#form input[type="radio"] {
  margin-right: 4px;
  accent-color: var(--accent); /* jolie couleur bleue */
}

#form label[for^="earth"],
#form label[for^="leaf"],
#form label[for^="ocean"] {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#card-preview:hover{
  transform: translateY(-2px);
  transition: transform .15s ease;
}

/* micro décor autour de la carte */
#card-preview::after{
  content:"";
  position:absolute;
  inset:-1px;
  pointer-events:none;
  border-radius: 18px;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.06),
    0 10px 30px rgba(0,0,0,.35);
}

select option {
  background-color: #1c243a;  /* fond du menu */
  color: #e9ecf1;
}

footer, header {
    background-color: #222;
    color: #eee;
    text-align: center;
    padding: 20px 0;
    font-size: 1em;
    margin-top: auto;
}

.button-symbole {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin: 15px 0;
}

.button-symbole button {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 6px 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.button-symbole button:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.button-symbole button:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.button-symbole img {
  width: 24px;
  height: 24px;
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.4));
}

h1 {
  margin-left: auto;
  margin-right: auto;
  color: lightgray;
  font-size: 3em;
}