:root {
    --bg-blur: rgba(255, 255, 255, 0.1);
    --bg-hover: rgba(255, 255, 255, 0.2);
    --border-light: rgba(255, 255, 255, 0.2);
    --border-hover: rgba(255, 255, 255, 0.3);
    --shadow-default: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.2);
    --blur-amount: 8px;
    --danger-bg: rgba(220, 53, 69, 0.3);
    --success-bg: rgba(75, 181, 67, 0.3);
    --primary-bg: rgba(67, 97, 238, 0.3);
    --radius: 15px;
    --transition: 0.3s ease;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    color: white;
}

.background-wrapper {
    min-height: 100vh;
    background: url('../img/fond.webp') center/cover fixed;
    display: flex;
    flex-direction: column;
}

.digicode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(8px, 2vw, 15px);
    width: 100%;
    max-width: min(90vw, 600px);
    margin: 0 auto;
}

.navbar {
    margin-bottom: 2rem;
    background: var(--bg-blur);
    backdrop-filter: blur(var(--blur-amount));
    border-bottom: 1px solid var(--border-light);
}

.navbar-brand,
.navbar-nav .nav-link.active,
.navbar-nav .nav-link:hover {
    color: white !important;
}

.navbar-brand {
    font-size: 1.4em;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    transition: var(--transition);
}

.digicode-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    padding: 0.8rem 2rem;
    font-size: 1.1em;
    border: 1px solid var(--border-light);
    background: var(--bg-blur);
    backdrop-filter: blur(var(--blur-amount));
    color: white;
    transition: var(--transition);
    border-radius: var(--radius);
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-hover);
}

.btn-danger { background: var(--danger-bg); }
.btn-success { background: var(--success-bg); }
.btn-primary { background: var(--primary-bg); }

.digicode-btn {
    padding: 20px;
    font-size: 1.2em;
    box-shadow: var(--shadow-default);
}

#digicodeContainer {
    padding: 2rem;
}

.digicode-display {
    background: var(--bg-blur);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-light);
    border-radius: 15px;
    padding: clamp(20px, 4vw, 30px);
    margin: clamp(20px, 4vw, 30px) auto;
    min-height: 70px;
    text-align: center;
    font-size: clamp(1.2em, 4vw, 1.5em);
    box-shadow: var(--shadow-default);
    max-width: min(90vw, 600px);
}


.treasure-chest {
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.chest-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

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

@keyframes success-animation {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.container {
    position: relative;
    z-index: 1;
}

.success-animate {
    animation: success-animation 1s ease;
}

#successMessage {
    font-size: clamp(1.8em, 5vw, 2.5em);
    text-align: center;
    padding: 2rem;
    margin: 2rem auto;
    max-width: min(90vw, 800px);
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.palmares-content {
    background: var(--bg-blur);
    backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-default);
}

.table {
    color: white;
    margin: 0;
}

.table thead {
    border-color: var(--border-light);
}

.table td, .table th {
    border-color: var(--border-light);
    padding: 1rem;
}

.form-select {
    background-color: var(--bg-blur);
    backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--border-light);
    color: white;
    border-radius: var(--radius);
    padding: 0.8rem;
    transition: var(--transition);
}

.form-select:focus {
    border-color: var(--border-hover);
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.1);
    background-color: var(--bg-hover);
}

.form-select option {
    background-color: #2c3e50;
    color: white;
}

.form-label {
    font-size: 1.1em;
    margin-bottom: 0.5rem;
}

#pseudoForm input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2em;
    padding: 1rem;
    border-radius: 15px;
    backdrop-filter: blur(8px);
    margin: 1rem auto;
    max-width: min(90vw, 400px);
    width: 100%;
}

#pseudoForm input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#pseudoForm input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.1);
    outline: none;
}

#pseudoForm .btn {
    background: rgba(67, 97, 238, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2em;
    padding: 1rem 2rem;
    border-radius: 15px;
    backdrop-filter: blur(8px);
    margin: 1rem auto;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#pseudoForm .btn:hover {
    background: rgba(67, 97, 238, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.coffre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.coffre-item {
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-blur);
    backdrop-filter: blur(var(--blur-amount));
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-default);
}

.coffre-item:hover {
    transform: translateY(-5px);
    background: var(--bg-hover);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-hover);
}

.coffre-item img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.coffre-item h3 {
    margin: 0;
    font-size: 1.2em;
}
