@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&display=swap');

@font-face{
    font-family: "Press Gothic";
    src: url("pressgothic.otf") format("opentype");
}

:root {
    --primary: #8b9556;
    --primary-dark: #6b7342;
    --primary-light: #a8b36d;
    --secondary: #d4763c;
    --accent: #c97536;
    --success: #7a9b5c;
    --danger: #b83c2f;
    --warning: #d4763c;
    --info: #5a7a8c;
    --bg-dark: #1a1612;
    --bg-darker: #0d0b09;
    --bg-light: #2b251f;
    --bg-lighter: #3d3530;
    --text-primary: #e8dfd4;
    --text-secondary: #b8a896;
    --text-muted: #857668;
    --border: #4a4037;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.5);
    --rust: #a65a3a;
    --moss: #6b7a4e;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    padding: 24px;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 50%, var(--bg-light) 100%);
    min-height: 100vh;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(500px circle at 15% 40%, rgba(107, 122, 78, 0.12), transparent 55%),
        radial-gradient(400px circle at 85% 20%, rgba(166, 90, 58, 0.08), transparent 50%),
        radial-gradient(600px circle at 50% 90%, rgba(180, 115, 60, 0.06), transparent 60%);
    z-index: -2;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
    opacity: 0.3;
    z-index: -1;
    pointer-events: none;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent);
}

h1, h2 {
    font-family: "Press Gothic", "Space Grotesk", sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.card-id {
    font-size: 0.85em;
    color: var(--primary-light);
    font-weight: 700;
    margin-bottom: 0.5em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.status-badge {
    margin-left: 0.6em;
    padding: 0.3em 0.7em;
    border-radius: 4px;
    font-size: 0.7em;
    background: var(--danger);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2em;
    margin: 3em 0;
}

.card {
    background: linear-gradient(145deg, var(--bg-light) 0%, rgba(29, 24, 19, 0.95) 100%);
    color: var(--text-primary);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--border);
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139, 149, 86, 0.08), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--primary);
}

.card:hover::before {
    opacity: 1;
}

.card.dead {
    opacity: 0.6;
    filter: grayscale(0.8);
}

.card.dead:hover {
    transform: none;
    border-color: var(--border);
}

.card-image {
    background: linear-gradient(135deg, rgba(107, 122, 78, 0.15), rgba(166, 90, 58, 0.1));
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-bottom: 2px solid var(--border);
    overflow: hidden;
    position: relative;
}

.card-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: brightness(0.9) contrast(1.1) saturate(0.95);
    transition: transform 0.4s ease;
}

.card:hover .card-image img {
    transform: scale(1.08);
}

.no-image {
    color: var(--text-muted);
    font-size: 3em;
    font-weight: 700;
}

.card-content {
    padding: 1.5em;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6em;
    position: relative;
    z-index: 2;
}

.card-content h2 {
    margin: 0;
    font-size: 1.25em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5em;
    flex-wrap: wrap;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.card-content p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9em;
    line-height: 1.5;
}

.rarete {
    font-size: 0.7em;
    padding: 0.35em 0.7em;
    border-radius: 4px;
    background: var(--bg-darker);
    color: var(--text-primary);
    margin-left: auto;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rarete.commun { 
    background: rgba(133, 118, 104, 0.25); 
    color: var(--text-secondary); 
    border: 1px solid rgba(133, 118, 104, 0.4); 
}

.rarete.rare { 
    background: rgba(90, 122, 140, 0.25); 
    color: #7ea8bf; 
    border: 1px solid rgba(90, 122, 140, 0.5); 
}

.rarete.legendaire, .rarete.legendary { 
    background: rgba(201, 117, 54, 0.3); 
    color: #d4a574; 
    border: 1px solid rgba(201, 117, 54, 0.6); 
    box-shadow: 0 0 10px rgba(201, 117, 54, 0.3);
}

.rarete.epique, .rarete.epic { 
    background: rgba(166, 90, 58, 0.3); 
    color: #d49874; 
    border: 1px solid rgba(166, 90, 58, 0.6); 
}

.desc {
    font-style: italic;
    color: var(--text-muted);
}

.stat-bar {
    height: 6px;
    background: var(--bg-darker);
    border-radius: 3px;
    overflow: hidden;
    margin: 0.5em 0;
    border: 1px solid var(--border);
}

.stat-bar span {
    display: block;
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.stat-bar.pv span { 
    background: linear-gradient(90deg, var(--success), #95b673); 
}

.stat-bar.energie span { 
    background: linear-gradient(90deg, var(--info), #7a9aac); 
}

.arena {
    max-width: 1200px;
    margin: 0 auto 3em;
    padding: 2.5em;
    background: linear-gradient(145deg, var(--bg-light) 0%, rgba(29, 24, 19, 0.95) 100%);
    color: var(--text-primary);
    border-radius: 16px;
    border: 2px solid var(--border);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.arena::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(107, 122, 78, 0.12), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.arena::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--rust) 20%, var(--moss) 50%, var(--rust) 80%, transparent);
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
}

.arena-header {
    text-align: center;
    margin-bottom: 2em;
    position: relative;
    z-index: 1;
}

.arena-title {
    margin: 0 0 0.5em;
    font-size: 2.8em;
    color: var(--text-primary);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    position: relative;
}

.arena-title::after {
    content: "";
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--rust), var(--moss));
    margin: 0.4em auto 0;
    opacity: 0.7;
}

.subtitle {
    color: var(--text-secondary);
    margin: 0.5em 0 0;
    font-size: 1em;
}

.page-summary {
    text-align: center;
    margin: 1.5em auto;
    color: var(--text-primary);
    font-size: 0.95em;
    display: inline-flex;
    gap: 1.5em;
    padding: 1em 1.5em;
    border-radius: 8px;
    background: rgba(107, 122, 78, 0.15);
    border: 1px solid var(--border);
}

.resultat {
    max-width: 900px;
    margin: 1.5em auto;
    padding: 1.2em;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    animation: slideDown 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.resultat--success {
    background: rgba(122, 155, 92, 0.2);
    color: #aed38d;
    border: 1px solid rgba(122, 155, 92, 0.5);
}

.resultat--error {
    background: rgba(184, 60, 47, 0.2);
    color: #e89e95;
    border: 1px solid rgba(184, 60, 47, 0.5);
}

.resultat--info {
    background: rgba(90, 122, 140, 0.2);
    color: #9fc2d5;
    border: 1px solid rgba(90, 122, 140, 0.5);
}

.reset-form {
    margin-top: 1em;
    display: flex;
    justify-content: center;
}

.reset-form button {
    padding: 0.7em 1.6em;
    border-radius: 6px;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary-light);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9em;
}

.reset-form button:hover {
    background: var(--primary);
    color: var(--bg-dark);
    box-shadow: 0 4px 12px rgba(139, 149, 86, 0.3);
}

.duel-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5em;
    align-items: stretch;
    margin: 2em 0;
    position: relative;
    z-index: 1;
}

.fighter-card {
    background: rgba(107, 122, 78, 0.08);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5em;
    display: flex;
    flex-direction: column;
    gap: 0.8em;
    min-height: 400px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.fighter-role {
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.75em;
    color: var(--primary-light);
    font-weight: 800;
}

.fighter-image {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(107, 122, 78, 0.15), rgba(166, 90, 58, 0.1));
    border-radius: 12px;
    padding: 0;
    margin-bottom: 0.8em;
    height: 200px;
    border: 2px solid var(--border);
    overflow: hidden;
    position: relative;
}

.fighter-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 100%);
    pointer-events: none;
}

.fighter-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: brightness(0.9) contrast(1.1) saturate(0.95);
}


.fighter-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8em;
}

.fighter-name {
    font-family: "Roboto Condensed", sans-serif;
    font-size: 1.3em;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.fighter-meta {
    font-size: 0.85em;
    color: var(--text-muted);
}

.fighter-placeholder {
    font-style: italic;
    color: var(--text-muted);
    padding: 2em 0;
    text-align: center;
}

.stat-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: var(--text-secondary);
    font-weight: 600;
}

.vs-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1em;
    text-align: center;
}

.vs-badge {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rust), var(--secondary));
    color: var(--text-primary);
    font-weight: 800;
    letter-spacing: 0.15em;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    font-size: 1.6em;
    border: 3px solid var(--border);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.vs-text {
    font-size: 0.9em;
    line-height: 1.6;
    max-width: 200px;
    color: var(--text-secondary);
}

.combat-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2em;
    align-items: flex-end;
    justify-content: center;
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5em;
    background: rgba(107, 122, 78, 0.08);
    border: 2px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
}

.combat-form label {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    z-index: 11;
}

.combat-form select {
    width: 100%;
    padding: 0.8em;
    border-radius: 6px;
    border: 2px solid var(--primary);
    background: var(--bg-light);
    color: var(--text-primary);
    font-size: 1em;
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 500;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a8b36d' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8em center;
    background-size: 12px;
    padding-right: 2.5em;
    position: relative;
    z-index: 12 right 0.8em center;
    background-size: 12px;
    padding-right: 2.5em;
}

.combat-form select option {
    background: var(--bg-light);
    color: var(--text-primary);
    padding: 0.8em;
    font-weight: 500;
}

.combat-form select option:disabled {
    color: var(--text-muted);
    background: var(--bg-darker);
}

.combat-form select:hover,
.combat-form select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(201, 117, 54, 0.25);
    background-color: var(--bg-lighter);
}

.combat-form input[type="submit"] {
    padding: 0.8em 2.2em;
    border-radius: 6px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--bg-dark);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 12;
    font-size: 0.95em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.combat-form input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 149, 86, 0.4);
}

.combat-form input[type="submit"]:active {
    transform: translateY(0);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.combat-active .fighter-card--attacker {
    animation: attackPulse 0.5s ease;
}

.combat-active .fighter-card--defender {
    animation: defendPulse 0.5s ease 0.1s;
}

@keyframes attackPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

@keyframes defendPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

@media (max-width: 1024px) {
    .duel-grid {
        grid-template-columns: 1fr;
    }
    
    .vs-column {
        flex-direction: row;
        order: -1;
    }
}

@media (max-width: 768px) {
    body {
        padding: 16px;
    }
    
    .arena {
        padding: 1.5em;
    }
    
    .card-container {
        grid-template-columns: 1fr;
        gap: 1.5em;
    }
    
    .combat-form {
        flex-direction: column;
    }
    
    .combat-form select,
    .combat-form input[type="submit"] {
        width: 100%;
    }
    
    .arena-title {
        font-size: 2em;
    }
    
    .card-image {
        height: 240px;
    }
    
    .fighter-image {
        height: 160px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
