@import url('https://fonts.googleapis.com/css?family=Open+Sans:300,700|Quattrocento:700');

/**
 * SYSTÈME DE VARIABLES CSS
 *
 * Ce système de variables permet de changer facilement les couleurs
 * de tout le site en modifiant uniquement ces valeurs.
 * 
 * Le système comprend deux ensembles de variables:
 * 1. Variables standard (--*): pour compatibilité avec le code existant
 * 2. Variables CRT (--crt-*): spécifiques à l'effet CRT
 * 
 * En mode CRT permanent, nous utilisons principalement les variables CRT,
 * mais nous synchronisons les deux ensembles pour éviter tout problème.
 */
:root {
    /* Variables standard - maintenues pour compatibilité avec le code existant */
    --background-color: white;     /* Couleur d'arrière-plan */
    --text-color: #888;            /* Couleur de texte principale */
    --link-color: #b97c2c;         /* Couleur des liens */
    --subtitle-color: #BBB;        /* Couleur des sous-titres */
    
    /* Variables pour l'effet CRT - celles-ci sont modifiées par les thèmes */
    --crt-background-color: #001100;  /* Fond vert foncé */
    --crt-text-color: #00ff41;        /* Texte vert phosphorescent */
    --crt-link-color: #ffff00;        /* Liens en jaune */
    --crt-subtitle-color: #00cc33;    /* Sous-titres en vert plus doux */
}

body {
    font-family: 'Open Sans', sans-serif;
    font-weight: lighter;
    background: var(--background-color);
    color: var(--text-color);
    overflow: hidden;
}

body.switched {
    transition: color 0.6s, background-color 0.6s;
}

h1,
h2 {
    text-align: center;
    font-family: "Quattrocento", Georgia, 'Times New Roman', Times, serif;
    margin: 0;
    padding: 0;
}

h1 {
    font-size: 30pt;
    margin-bottom: 10px;
}

h2 {
    font-size: 14pt;
    font-style: italic;
    font-family: sans-serif;
    font-weight: lighter;
    color: var(--subtitle-color);
}

.header {
    padding-top: 3em;
    padding-bottom: 3em;
}

/*
  Built-in class:
    # author: Name
*/
.byline {
    font-style: italic;
}

.shelby {
    z-index: 3;
    font-size: 9pt;
    font-family: sans-serif;
    text-align: center;
    font-weight: 700;
    position: fixed;
    display: block;
    width: 100%;
    background: white;
    transition: color 0.6s, background 0.6s;
    margin: 0;
    padding-top: 6px;
    padding-bottom: 6px;
    height: 14px;
    top: 0;
}

/* 
  Enables <iframe> support work on itch.io when using mobile iOS
*/
.outerContainer {
    position: absolute;
    display: block;
    margin: 0;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    overflow: scroll;
    overflow-x: hidden;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    margin-top: 24px;
    background-size: cover;
    background-repeat: no-repeat;
}

@media screen and (max-width: 980px) {
    .outerContainer {
        margin-top: 44px;
        background-size: cover;
        background-repeat: no-repeat;
    }
}

.container {
    display: block;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 4em;
    background: white;
}

.switched .container {
    transition: background-color 0.6s;
}

p {
    font-size: 20pt;
    color: #888;
    line-height: 1.7em;
}

a {
    font-weight: 700;
    color: var(--link-color);
    font-family: sans-serif;
    transition: color 0.6s;
    text-decoration: none;
}

a:hover {
    color: black;
    transition: color 0.1s;
}

strong {
    color: black;
    font-weight: bold;
}

img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

.container .hide {
    opacity: 0.0;
}

.container .invisible {
    display: none;
}

.container>* {
    opacity: 1.0;
    transition: opacity 1.0s;
}

/*
  Class applied to all choices
  (Will always appear inside <p> element by default.)
*/
.choice {
    text-align: center;
    line-height: 1.7em;
}

/* 
  Class applied to first choice
*/
:not(.choice)+.choice {
    padding-top: 1em;
}

/*
  Class applied to choice links
*/
.choice a {
    font-size: 15pt;
}

/* 
  Built-in class:
    The End # CLASS: end
*/
.end {
    text-align: center;
    font-weight: bold;
    color: black;
    padding-top: 20px;
    padding-bottom: 20px;
}

#controls {
    z-index: 4;
    font-size: 9pt;
    text-align: center;
    padding-bottom: 6px;
    position: fixed;
    right: 14px;
    top: 4px;
    user-select: none;
    background: white;
    transition: color 0.6s, background 0.6s;
}

#controls [disabled] {
    color: #ccc;
}

#controls>*:not(:last-child):after {
    content: " | ";
}

@media screen and (max-width: 980px) {
    #controls {
        z-index: 2;
        padding-top: 24px;
        top: 0;
        left: 0;
        right: 0;
    }
}

/* 
  Dark Theme (Added in Inky 0.10.0)
    # theme: dark
*/

body.dark {
    background: black;
    color: white;
}

.dark h2 {
    color: #666;
}

.dark .container {
    background: black;
}

.dark .shelby {
    background: black;
}

.dark a {
    color: #cc8f1a;
    transition: color 0.6s;
}

.dark a:hover {
    color: white;
}

.dark strong {
    color: white;
}

.dark #controls [disabled] {
    color: #444;
}

.dark .end {
    color: white;
}

.dark #controls {
    background: black;
}

/**
 * STYLES CRT PAR DÉFAUT
 * 
 * Ces styles remplacent les styles originaux pour créer l'apparence
 * d'un terminal CRT (moniteur à tube cathodique). Les styles sont appliqués
 * directement aux éléments sans avoir besoin d'une classe spécifique,
 * car le mode CRT est maintenant le mode par défaut et unique.
 * 
 * Caractéristiques du style CRT:
 * - Police monospace (comme sur les vieux terminaux)
 * - Couleurs phosphorescentes sur fond sombre
 * - Ombres et effets de lueur pour simuler l'éclairage du tube
 */
body {
    background: var(--crt-background-color);
    color: var(--crt-text-color);
    font-family: 'Courier New', monospace;
}

.outerContainer {
    background: var(--crt-background-color);
}

.container {
    background: var(--crt-background-color);
    color: var(--crt-text-color);
    font-family: 'Courier New', monospace;
    border: 1px solid var(--crt-text-color);
    box-shadow: inset 0 0 50px rgba(0, 255, 65, 0.1); /* Effet de lueur intérieure */
}

h1 {
    color: var(--crt-text-color);
    text-shadow: 0 0 10px var(--crt-text-color);
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

h2 {
    color: var(--crt-subtitle-color);
    font-family: 'Courier New', monospace;
}

p {
    color: var(--crt-text-color);
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 2px var(--crt-text-color);
}

a {
    color: var(--crt-link-color);
    text-shadow: 0 0 5px var(--crt-link-color);
    font-family: 'Courier New', monospace;
}

a:hover {
    color: #ffffff;
    text-shadow: 0 0 8px #ffffff;
}

.shelby {
    background: var(--crt-background-color);
    color: var(--crt-text-color);
    border-bottom: 1px solid var(--crt-text-color);
    font-family: 'Courier New', monospace;
}

#controls {
    background: var(--crt-background-color);
    color: var(--crt-text-color);
    font-family: 'Courier New', monospace;
    border: 1px solid var(--crt-text-color);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Style des boutons dans le panneau de contrôle */
#controls a {
    color: var(--crt-link-color);
    text-shadow: 0 0 5px var(--crt-link-color);
    font-family: 'Courier New', monospace;
    padding: 2px 5px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

#controls a:hover {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 10px var(--crt-text-color);
    color: #ffffff;
}

/* Style du bouton de thème en particulier */
#theme-switch {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid var(--crt-link-color);
    padding: 2px 5px !important;
}

#controls [disabled] {
    color: rgba(0, 255, 65, 0.3);
}

strong {
    color: var(--crt-text-color);
    text-shadow: 0 0 5px var(--crt-text-color);
}

.choice a {
    background: var(--crt-subtitle-color);
    border: 1px solid var(--crt-link-color);
    padding: 8px 16px;
    display: inline-block;
    margin: 4px;
    border-radius: 3px;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.choice a:hover {
    background: var(--crt-text-color);
    box-shadow: 0 0 15px var(--crt-link-color);
}

/**
 * ANIMATIONS DE TRANSITION ENTRE THÈMES
 * 
 * Ces classes permettent de créer une transition fluide et élégante
 * lors du changement de thème CRT (au clic sur le bouton "theme").
 * 
 * La classe .theme-transition est ajoutée temporairement au body lors
 * du changement de thème, puis retirée une fois la transition terminée.
 * 
 * Propriétés animées:
 * - Couleurs d'arrière-plan et de texte
 * - Couleurs des bordures
 * - Ombres de texte
 * - Boîtes d'ombre
 */
.theme-transition {
    transition: background-color 0.5s ease, color 0.5s ease;
}

.theme-transition * {
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, text-shadow 0.5s ease, box-shadow 0.5s ease;
}
