/**
 * INSCRYPCARDS - Styles fidèles à Inscryption Act 2
 */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

:root {
    --color-card: #2a2a2a;
    --color-text: #c4b89a;
    --color-text-muted: #7a7a5a;
    --font-main: 'Press Start 2P', monospace;
    --font-ui: 'VT323', monospace;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    cursor: none !important;
}

/* =============================================
   BODY - Fond image pixelisé, repeat-x
   ============================================= */
body {
    font-family: var(--font-ui);
    background-color: #5a6a5a;
    background-image: url('/assets/images/startscreen_background_PART2.png');
    background-size: auto 100vh;
    background-position: center;
    background-repeat: repeat-x;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    color: var(--color-text);
    min-height: 100vh;
    overflow-x: hidden;
    cursor: none;
}

/* Curseur personnalisé (élément JS) */
.custom-cursor {
    position: fixed;
    width: 32px;
    height: 32px;
    pointer-events: none;
    z-index: 99999;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    transform: translate(-2px, -2px);
    display: none;
}

/* Scanlines légères */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.05) 2px,
        rgba(0, 0, 0, 0.05) 4px
    );
    pointer-events: none;
    z-index: 10000;
}

img {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* =============================================
   PAGE ACCUEIL - Titre en haut, boutons en bas
   ============================================= */
.home-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    overflow: hidden;
}

.home-title {
    position: fixed;
    top: 8vh;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-main);
    font-size: 1.5vw;
    color: var(--color-text);
    text-align: center;
    letter-spacing: 0.5vw;
    text-transform: uppercase;
    white-space: nowrap;
}

.home-title::before {
    content: '- ';
    color: var(--color-text-muted);
}

.home-title::after {
    content: ' -';
    color: var(--color-text-muted);
}

/* =============================================
   GROUPE CENTRAL (slot + icône placée)
   ============================================= */
.center-group {
    position: fixed;
    left: 50%;
    top: 20.4vh;
    height: calc(63.3vh - 20.4vh);
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: left 0.5s ease, transform 0.5s ease;
}

.center-group.slid-left {
    left: 12.5vw;
    transform: translateX(0);
}

/* Menu inactif après placement (visible mais non cliquable) */
.home-menu.menu-hidden {
    pointer-events: none;
}

/* =============================================
   PANNEAUX INLINE - Style Inscryption Act 2
   ============================================= */
.panel-content {
    position: fixed;
    top: 20.4vh;
    right: 5vw;
    width: 50vw;
    height: calc(63.3vh - 20.4vh);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transform: translateX(30px);
    transition: opacity 0.4s ease 0.3s, transform 0.4s ease 0.3s;
}

.panel-content.panel-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.panel-inner {
    width: 100%;
    max-width: 480px;
    max-height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #5a6a5a transparent;
    background-color: #b8ad8e;
    border: 4px solid #2a2a1a;
    box-shadow: inset 0 0 0 2px #9a8e6e, 6px 6px 0 rgba(0,0,0,0.25);
    image-rendering: pixelated;
    padding: 0;
}

.panel-title {
    font-family: var(--font-main);
    font-size: clamp(8px, 1vw, 14px);
    color: #2a2a1a;
    text-align: center;
    letter-spacing: 0.2vw;
    text-transform: uppercase;
    padding: 0.8rem 1rem;
    margin: 0;
    border-bottom: 3px solid #2a2a1a;
    background-color: #a89e7e;
}

.panel-body {
    font-family: var(--font-ui);
    font-size: clamp(12px, 1.1vw, 18px);
    color: #2a2a1a;
    padding: 1rem 1.2rem;
}

/* Groupes d'options */
.panel-body .option-group {
    margin-bottom: 1rem;
    border-bottom: 2px solid #9a8e6e;
    padding-bottom: 0.8rem;
}

.panel-body .option-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.panel-body .option-group h3 {
    font-family: var(--font-main);
    font-size: clamp(7px, 0.6vw, 10px);
    color: #2a2a1a;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1vw;
}

.panel-body .option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: clamp(12px, 1vw, 16px);
    color: #3a3a2a;
}

.panel-body .option-item input[type="range"] {
    width: 90px;
    accent-color: #5a6a5a;
    height: 6px;
}

/* Toggle Switch Inscryption style */
.toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}
.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #8a7e5e;
    transition: 0.3s;
    border: 2px solid #2a2a1a;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background-color: #2a2a1a;
    transition: 0.3s;
}
.toggle input:checked + .toggle-slider {
    background-color: #6a8a5a;
}
.toggle input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

/* Crédits dans les panneaux */
.panel-body .credit-section {
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid #9a8e6e;
}

.panel-body .credit-section:last-child {
    border-bottom: none;
}

.panel-body .credit-section h4 {
    font-family: var(--font-main);
    font-size: clamp(7px, 0.6vw, 10px);
    color: #2a2a1a;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}

.panel-body .credit-section p {
    margin: 0.2rem 0;
    color: #3a3a2a;
}

.panel-body .credit-section small {
    color: #5a5a4a;
}

.panel-body .credit-section a {
    color: #4a6a4a;
    text-decoration: underline;
}

/* Formulaires dans les panneaux */
.panel-body .form-group {
    margin-bottom: 0.8rem;
}

.panel-body .form-group label {
    font-family: var(--font-main);
    font-size: clamp(6px, 0.5vw, 9px);
    color: #2a2a1a;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.3rem;
}

.panel-body .form-group input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    font-size: clamp(12px, 1vw, 16px);
    background-color: #a89e7e;
    border: 2px solid #2a2a1a;
    color: #2a2a1a;
    font-family: var(--font-ui);
}

.panel-body .form-group input:focus {
    outline: none;
    background-color: #c8bd9e;
}

.panel-body .form-group input::placeholder {
    color: #6a6a5a;
}

/* Boutons dans les panneaux */
.panel-body .btn {
    font-family: var(--font-main);
    font-size: clamp(7px, 0.6vw, 10px);
    text-transform: uppercase;
    padding: 0.6rem 1.2rem;
    border: 3px solid #2a2a1a;
    background-color: #a89e7e;
    color: #2a2a1a;
    letter-spacing: 0.1vw;
    transition: background-color 0.15s ease;
}

.panel-body .btn:hover {
    background-color: #c8bd9e;
}

.panel-body .btn-primary {
    background-color: #6a8a5a;
    color: #e8e0c8;
    border-color: #2a2a1a;
}

.panel-body .btn-primary:hover {
    background-color: #7a9a6a;
}

.panel-body .btn-full {
    width: 100%;
    text-align: center;
}

/* Lien discret dans les panneaux */
.panel-body .panel-link {
    display: block;
    text-align: center;
    margin-top: 0.8rem;
    font-family: var(--font-main);
    font-size: clamp(5px, 0.45vw, 8px);
    color: #5a5a4a;
    text-decoration: none;
    text-transform: uppercase;
}

.panel-body .panel-link:hover {
    color: #2a2a1a;
}

.home-center-slot {
    height: calc((33vh - 5vh) * 1.1);
    width: auto;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Slot actif (cliquable après sélection d'un bouton) */
.home-center-slot.slot-active {
    cursor: none;
}

/* Icône placée dans le groupe (superposée sur le slot) */
.placed-icon {
    position: absolute;
    pointer-events: none;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    z-index: 2;
}

/* =============================================
   MENU CARTES - Position fixe, texte collé au bas
   ============================================= */
.home-menu {
    position: fixed;
    top: 65vh;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 2vw;
    padding: 0 0 2vh 0;
    margin: 0;
    transition: opacity 0.4s ease;
}

.menu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: none;
    text-decoration: none;
    background: none;
    border: none;
    outline: none;
    box-shadow: none;
    padding: 0;
    transition: transform 0.15s ease;
}

/* Carte sélectionnée : lévitation */
.menu-card.card-selected {
    transform: translateY(-15px);
}

.menu-card.card-selected:hover .icon-wrap::before {
    opacity: 0;
    animation: none;
}

.menu-card:hover {
    background: none;
}

.menu-card.card-selected:hover {
    transform: translateY(-15px);
}

.menu-card:focus {
    outline: none;
}

.menu-card {
    max-height: 100%;
    overflow: visible;
}

.menu-card-icon {
    width: auto;
    height: calc(33vh - 5vh);
    max-width: 15vw;
    min-height: 50px;
    object-fit: contain;
    display: block;
    cursor: pointer;
}

/* Wrapper pour l'effet marching ants */
.icon-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 0.5vh;
}

.icon-wrap::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    background:
        linear-gradient(90deg, #04090f 50%, transparent 50%) 0 0 / 16px 4px repeat-x,
        linear-gradient(90deg, transparent 50%, #04090f 50%) 0 100% / 16px 4px repeat-x,
        linear-gradient(0deg, #04090f 50%, transparent 50%) 0 0 / 4px 16px repeat-y,
        linear-gradient(0deg, transparent 50%, #04090f 50%) 100% 0 / 4px 16px repeat-y;
}

.menu-card:hover .icon-wrap::before {
    opacity: 1;
    animation: marching-ants 0.8s linear infinite;
}

@keyframes marching-ants {
    to {
        background-position:
            16px 0,
            -16px 100%,
            0 -16px,
            100% 16px;
    }
}

.menu-card-label {
    display: none;
}

/* Label partagé affiché sous le titre au hover */
.hover-label {
    position: fixed;
    top: calc(8vh + 3vw);
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-main);
    font-size: 1vw;
    text-align: center;
    color: #c4b89a;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
}

.hover-label.visible {
    opacity: 1;
}

/* =============================================
   ÉCRAN NOUVELLE PARTIE
   ============================================= */
.starter-deck-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding-top: 0;
}

.screen-header {
    width: 100%;
    text-align: center;
    padding: 2rem 0;
    border-bottom: 2px solid #04090f;
    margin-bottom: 3rem;
}

.screen-title {
    font-family: var(--font-main);
    font-size: 20px;
    color: var(--color-text);
    letter-spacing: 4px;
    text-transform: uppercase;
}

.screen-title::before {
    content: '- ';
    color: var(--color-text-muted);
}

.screen-title::after {
    content: ' -';
    color: var(--color-text-muted);
}

.deck-preview-zone {
    width: 140px;
    height: 190px;
    background-color: var(--color-card);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0 3rem;
    /* PAS DE BORDURE */
    border: none;
}

.deck-preview-icon {
    width: 60px;
    height: 60px;
    opacity: 0.5;
}

.scribe-selection-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: auto;
    padding-bottom: 4rem;
}

.scribe-card-mini {
    width: 100px;
    height: 140px;
    background-color: var(--color-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /* PAS DE BORDURE */
    border: none;
    outline: none;
}

.scribe-card-mini:hover {
    background-color: #04090f;
}

.scribe-card-mini.selected {
    background-color: #04090f;
}

.scribe-card-mini.locked {
    opacity: 0.4;
    cursor: default;
}

.scribe-card-mini.locked:hover {
    background-color: var(--color-card);
}

.scribe-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

/* =============================================
   FORMULAIRES AUTH
   ============================================= */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-box {
    background-color: var(--color-card);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.auth-box h1 {
    font-family: var(--font-main);
    font-size: 14px;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--color-text);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--font-main);
    font-size: 8px;
    color: var(--color-text);
    text-transform: uppercase;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    background-color: #1a1a1a;
    border: none;
    color: var(--color-text);
    font-family: var(--font-ui);
    font-size: 1.3rem;
}

.form-group input:focus {
    outline: none;
    background-color: #222;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    font-family: var(--font-main);
    font-size: 9px;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    background: var(--color-card);
    border: none;
    color: var(--color-text);
}

.btn:hover {
    background-color: #353535;
}

.btn-primary {
    background-color: #5a7a5a;
    color: #1a1a1a;
}

.btn-primary:hover {
    background-color: #6a8a6a;
}

.btn-full {
    width: 100%;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.alert-error {
    background-color: rgba(180, 60, 60, 0.3);
    color: #f99;
}

.alert-success {
    background-color: rgba(60, 140, 60, 0.3);
    color: #9f9;
}

/* =============================================
   HEADER UTILISATEUR
   ============================================= */
.user-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(30, 30, 30, 0.95);
    border-bottom: 2px solid #3a3a3a;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
}

.user-name {
    font-family: var(--font-main);
    font-size: 9px;
    color: var(--color-text);
    text-transform: uppercase;
}

.user-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 1.1rem;
    color: var(--color-text-muted);
}

.user-coins {
    color: #d4a020;
}

/* =============================================
   LIEN RETOUR
   ============================================= */
.back-link {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    font-family: var(--font-main);
    font-size: 9px;
    color: var(--color-text-muted);
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    background: var(--color-card);
    z-index: 50;
}

.back-link:hover {
    background-color: #353535;
}

.hidden {
    display: none !important;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .menu-card-icon {
        width: 22vw;
        height: 22vw;
        min-width: 80px;
        min-height: 80px;
    }
    
    .home-center-slot {
        height: calc(22vw * 1.1);
        min-height: 88px;
    }
    
    .menu-card-label {
        font-size: 1.8vw;
        color: #c4b89a;
    }
    
    .home-menu {
        gap: 2vw;
        bottom: 4vh;
    }
    
    .home-title {
        font-size: 2.5vw;
        top: 6vh;
    }
    
    .scribe-card-mini {
        width: 85px;
        height: 115px;
    }
    
    .scribe-icon {
        width: 52px;
        height: 52px;
    }
    
    .screen-title {
        font-size: 16px;
    }
}

@media (min-width: 1400px) {
    .menu-card-icon {
        width: 18vw;
        height: 18vw;
        max-width: 300px;
        max-height: 300px;
    }
    
    .home-center-slot {
        height: calc(18vw * 1.1);
        max-height: 330px;
    }
    
    .menu-card-label {
        font-size: 1vw;
        color: #c4b89a;
    }
    
    .home-menu {
        gap: 2vw;
        bottom: 4vh;
    }
    
    .home-title {
        font-size: 1.8vw;
    }
    
    .scribe-card-mini {
        width: 120px;
        height: 165px;
    }
    
    .scribe-icon {
        width: 80px;
        height: 80px;
    }
}
