@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Spectral:wght@300;400;600&display=swap');




* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Spectral', serif;
    background: linear-gradient(135deg, #1a0b2e 0%, #2d1b3d 50%, #1a0b2e 100%);
    color: #f0e6d2;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(138, 43, 226, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 69, 0, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 40px;
    position: relative;
}

h1 {
    font-family: 'Cinzel', serif;
    font-size: 3.5em;
    color: #d4af37;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5),
        0 0 40px rgba(212, 175, 55, 0.3);
    margin-bottom: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 20px rgba(212, 175, 55, 0.5), 0 0 40px rgba(212, 175, 55, 0.3);
    }

    to {
        text-shadow: 0 0 30px rgba(212, 175, 55, 0.8), 0 0 60px rgba(212, 175, 55, 0.5);
    }
}

.subtitle {
    font-size: 1.2em;
    color: #c9a05c;
    font-style: italic;
}

.view-toggle {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.view-btn {
    font-family: 'Cinzel', serif;
    padding: 15px 40px;
    background: linear-gradient(135deg, #8b4513 0%, #654321 100%);
    border: 2px solid #d4af37;
    color: #f0e6d2;
    font-size: 1.1em;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.view-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, #a0522d 0%, #8b4513 100%);
}

.view-btn.active {
    background: linear-gradient(135deg, #d4af37 0%, #c9a05c 100%);
    color: #1a0b2e;
    font-weight: 600;
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.character-card {
    background: linear-gradient(135deg, rgba(61, 30, 83, 0.8) 0%, rgba(45, 27, 61, 0.9) 100%);
    border: 2px solid #d4af37;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
    transition: left 0.5s ease;
}

.character-card:hover::before {
    left: 100%;
}

.character-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.4);
    border-color: #ffd700;
}

.char-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.char-name {
    font-family: 'Cinzel', serif;
    font-size: 1.8em;
    color: #ffd700;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
}

.char-level {
    background: linear-gradient(135deg, #8b0000 0%, #dc143c 100%);
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1em;
    box-shadow: 0 3px 10px rgba(220, 20, 60, 0.5);
}

.char-info {
    margin-bottom: 20px;
    color: #c9a05c;
    font-size: 1.1em;
}

.stats-mini {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.stat-box {
    background: rgba(26, 11, 46, 0.6);
    border: 1px solid #d4af37;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.stat-name {
    font-size: 0.85em;
    color: #c9a05c;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.8em;
    color: #ffd700;
    font-weight: 600;
    margin-top: 5px;
}

.add-character-btn {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, rgba(61, 30, 83, 0.4) 0%, rgba(45, 27, 61, 0.6) 100%);
    border: 3px dashed #d4af37;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cinzel', serif;
    font-size: 1.5em;
    color: #d4af37;
}

.add-character-btn:hover {
    background: linear-gradient(135deg, rgba(61, 30, 83, 0.7) 0%, rgba(45, 27, 61, 0.9) 100%);
    transform: scale(1.05);
    border-color: #ffd700;
}

.add-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.character-sheet {
    display: none;
    background: linear-gradient(135deg, rgba(61, 30, 83, 0.95) 0%, rgba(45, 27, 61, 0.95) 100%);
    border: 3px solid #d4af37;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #d4af37;
}

.back-btn {
    font-family: 'Cinzel', serif;
    padding: 12px 25px;
    background: linear-gradient(135deg, #654321 0%, #8b4513 100%);
    border: 2px solid #d4af37;
    color: #f0e6d2;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 100%);
    transform: translateX(-5px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: rgba(26, 11, 46, 0.7);
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.3);
}

.stat-card .stat-name {
    font-size: 1em;
}

.stat-card .stat-value {
    font-size: 2.5em;
}

.modifier {
    font-size: 1.2em;
    color: #90ee90;
    margin-top: 5px;
}

.info-section {
    background: rgba(26, 11, 46, 0.5);
    border: 1px solid #d4af37;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
}

.info-section h3 {
    font-family: 'Cinzel', serif;
    color: #ffd700;
    font-size: 1.8em;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

.hp-bar {
    background: rgba(26, 11, 46, 0.8);
    border: 2px solid #d4af37;
    border-radius: 10px;
    height: 40px;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.hp-fill {
    background: linear-gradient(90deg, #dc143c 0%, #ff6347 100%);
    height: 100%;
    transition: width 0.5s ease;
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.6);
}

.hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    font-size: 1.2em;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Character Creation Styles */
.creation-wizard {
    display: none;
    background: linear-gradient(135deg, rgba(61, 30, 83, 0.95) 0%, rgba(45, 27, 61, 0.95) 100%);
    border: 3px solid #d4af37;
    border-radius: 20px;
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    animation: slideIn 0.5s ease;
}

.wizard-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #d4af37;
}

.wizard-title {
    font-family: 'Cinzel', serif;
    font-size: 2.5em;
    color: #ffd700;
    margin-bottom: 10px;
}

.step-indicator {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.step-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.3);
    transition: all 0.3s ease;
}

.step-dot.active {
    background: #d4af37;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
    transform: scale(1.3);
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-title {
    font-family: 'Cinzel', serif;
    font-size: 2em;
    color: #ffd700;
    margin-bottom: 20px;
    text-align: center;
}

.input-group {
    margin-bottom: 25px;
}

.input-label {
    display: block;
    color: #d4af37;
    font-size: 1.2em;
    margin-bottom: 10px;
    font-weight: 600;
}

.text-input {
    width: 100%;
    padding: 15px;
    background: rgba(26, 11, 46, 0.6);
    border: 2px solid #d4af37;
    border-radius: 10px;
    color: #f0e6d2;
    font-size: 1.1em;
    font-family: 'Spectral', serif;
    transition: all 0.3s ease;
}

.text-input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.option-card {
    background: rgba(26, 11, 46, 0.6);
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.3);
    border-color: #ffd700;
}

.option-card.selected {
    background: rgba(212, 175, 55, 0.2);
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
}

.option-card.selected::before {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5em;
    color: #90ee90;
    animation: checkmark 0.3s ease;
}

@keyframes checkmark {
    from {
        transform: scale(0) rotate(45deg);
    }

    to {
        transform: scale(1) rotate(0deg);
    }
}

.option-title {
    font-family: 'Cinzel', serif;
    font-size: 1.5em;
    color: #ffd700;
    margin-bottom: 10px;
}

.option-desc {
    color: #c9a05c;
    font-size: 1em;
    line-height: 1.5;
}

.dice-roller {
    background: rgba(26, 11, 46, 0.6);
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    text-align: center;
}

.dice-button {
    font-family: 'Cinzel', serif;
    padding: 20px 40px;
    background: linear-gradient(135deg, #8b0000 0%, #dc143c 100%);
    border: 2px solid #ffd700;
    color: #fff;
    font-size: 1.5em;
    cursor: pointer;
    border-radius: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(220, 20, 60, 0.5);
    margin: 10px;
}

.dice-button:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 30px rgba(220, 20, 60, 0.7);
}

.dice-button:active {
    transform: scale(0.95);
}

.dice-result {
    font-size: 3em;
    color: #ffd700;
    font-weight: 700;
    margin: 20px 0;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    animation: diceRoll 0.5s ease;
}

@keyframes diceRoll {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.2) rotate(10deg);
    }

    75% {
        transform: scale(1.2) rotate(-10deg);
    }
}

.stat-assignment {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-assign-box {
    background: rgba(26, 11, 46, 0.6);
    border: 2px solid #d4af37;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.stat-assign-box select {
    width: 100%;
    padding: 10px;
    background: rgba(26, 11, 46, 0.8);
    border: 1px solid #d4af37;
    border-radius: 5px;
    color: #f0e6d2;
    font-size: 1.1em;
    margin-top: 10px;
    cursor: pointer;
}

.rolled-values {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.rolled-value {
    background: linear-gradient(135deg, #8b0000 0%, #dc143c 100%);
    border: 2px solid #ffd700;
    border-radius: 10px;
    padding: 15px 25px;
    font-size: 2em;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 5px 15px rgba(220, 20, 60, 0.5);
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #d4af37;
}

.nav-btn {
    font-family: 'Cinzel', serif;
    padding: 15px 40px;
    background: linear-gradient(135deg, #654321 0%, #8b4513 100%);
    border: 2px solid #d4af37;
    color: #f0e6d2;
    font-size: 1.2em;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-btn.primary {
    background: linear-gradient(135deg, #d4af37 0%, #c9a05c 100%);
    color: #1a0b2e;
    font-weight: 600;
}

.hidden {
    display: none;
}










.hp-controls button.lose {
    background: linear-gradient(to bottom, #e63946, #9b1c22);
    box-shadow: 0 0 12px #e63946;
}

.hp-controls button.heal {
    background: linear-gradient(to bottom, #2a9d8f, #1f5f4f);
    box-shadow: 0 0 12px #2a9d8f;
}


.hp-bar {
  position: relative;
  width: 100%;
  height: 35px;
  background: linear-gradient(to bottom, #444, #222);
  border-radius: 12px;
  border: 2px solid #000;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: inset 0 0 10px #000;
}

.hp-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(to right, #ffd166, #ffb800);
  border-radius: 12px 0 0 12px;
  transition: width 0.6s ease, background 0.3s ease;
  z-index: 0;
}

.hp-text {
  text-align: center;
  margin-top: 4px;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 3px #000;
}

/* Boutons PV */
.hp-controls button {
  padding: 6px 12px;
  margin: 4px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(to bottom, #444, #222);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  transition: transform 0.2s, background 0.2s;
}

.hp-controls button:hover {
  transform: scale(1.1);
  background: linear-gradient(to bottom, #666, #333);
}

/* Animation PV */
.hp-float {
  position: absolute;
  font-weight: bold;
  font-size: 18px;
  pointer-events: none;
  opacity: 0;
  animation: floatAnim 1.2s forwards;
  text-shadow: 2px 2px 4px #000;
}

.hp-float.damage {
  color: #ff5555;
}

.hp-float.heal {
  color: #28ff7f;
}

@keyframes floatAnim {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  50% { transform: translateY(-25px) scale(1.2); opacity: 1; }
  100% { transform: translateY(-50px) scale(1); opacity: 0; }
}

/* Popup PV */
.hp-popup {
  position: absolute;
  font-weight: bold;
  font-size: 16px;
  color: #fff;
  text-shadow: 2px 2px 5px #000;
  pointer-events: none;
  animation: popupAnim 1s forwards;
}

@keyframes popupAnim {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  20% { opacity: 1; }
  80% { transform: translateY(-30px) scale(1.1); opacity: 1; }
  100% { transform: translateY(-50px) scale(1); opacity: 0; }
}



.parchment {
  background: rgba(80,40,20,0.9);
  border: 2px solid #c9a35e;
  border-radius: 12px;
  box-shadow: 0 0 15px #000 inset;
  padding: 20px;
}

.btn-wood {
  background: linear-gradient(180deg, #7b3f00, #4b2500);
  border: 2px solid #d9b46f;
  color: #f8f1d0;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}
.btn-wood:hover {
  background: #a86b1d;
  transform: scale(1.05);
}

.level-popup {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(80,40,20,0.95);
  color: #ffd65b;
  padding: 20px;
  border: 2px solid #d9b46f;
  border-radius: 12px;
  font-size: 1.5em;
  animation: fadeInOut 2.5s ease;
}

.hp-float {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5em;
  font-weight: bold;
  text-shadow: 1px 1px 3px #000;
  animation: floatUp 1.2s ease forwards;
}
.hp-float.gain { color: #4CAF50; }
.hp-float.loss { color: #f44336; }

@keyframes floatUp {
  0% { top: 0; opacity: 1; }
  100% { top: -50px; opacity: 0; }
}
@keyframes fadeInOut {
  0%, 100% { opacity: 0; transform: translateX(-50%) scale(0.95); }
  10%, 90% { opacity: 1; transform: translateX(-50%) scale(1); }
}

.dice-popup {
  position: fixed;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.5em;
  color: #fff7d0;
  text-shadow: 2px 2px 5px #000;
  animation: bounceDice 1.5s ease-out;
}
@keyframes bounceDice {
  0% { transform: translateX(-50%) translateY(50px) scale(0.8); opacity: 0; }
  50% { transform: translateX(-50%) translateY(0) scale(1.2); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-30px) scale(1); opacity: 0; }
}










.character-sheet {
  display: none;
  padding: 20px;
}

.character-card {
  cursor: pointer;
  transition: transform 0.2s;
}

.character-card:hover {
  transform: scale(1.03);
}






.spell-card {
  width: 200px;
  height: 260px;
  perspective: 1000px;
  margin: 10px;
  cursor: pointer;
  position: relative;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  background: linear-gradient(145deg, #8b5cf6, #a78bfa);
  color: #fff;
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  box-sizing: border-box;
}

.card-front h4 {
  font-size: 1.1em;
  margin-bottom: 5px;
}

.card-back {
  transform: rotateY(180deg);
  background: #7c3aed;
  color: #fff;
  font-size: 0.9em;
  text-align: center;
  overflow-y: auto;
}

.spell-info {
  font-size: 0.85em;
}

.use-spell-btn {
  background: #e879f9;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.use-spell-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 8px #f9a8d4;
}

.spell-uses {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 6px;
}

.spell-uses .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c4b5fd; /* violet clair */
  border: 1px solid #fff;
}

.spell-uses .dot.used {
  background: #fff;
}
