/* ============================================
   Crononauta — Minijuego
   Paleta: negro + dorado (#c9a84c)
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0a;
    overflow: hidden;
    font-family: 'Courier New', 'Lucida Console', monospace;
    color: #c9a84c;
    -webkit-user-select: none;
    user-select: none;
}

/* ---------- Container & Canvas ---------- */

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ---------- Overlays ---------- */

.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(10, 10, 10, 0.92);
    z-index: 10;
    animation: overlayIn 0.4s ease-out;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    max-width: 420px;
    padding: 2rem 1.5rem;
}

/* ---------- Logo ---------- */

.overlay-logo {
    width: 72px;
    height: auto;
    margin-bottom: 1.8rem;
    opacity: 0.85;
    animation: logoPulse 3s ease-in-out infinite;
}

/* ---------- Typography ---------- */

.overlay h1 {
    font-size: 1.6rem;
    font-weight: normal;
    letter-spacing: 0.18em;
    margin-bottom: 0.25rem;
    color: #c9a84c;
    text-transform: uppercase;
}

.overlay h2 {
    font-size: 1.4rem;
    font-weight: normal;
    letter-spacing: 0.12em;
    margin-bottom: 0.6rem;
    color: #c9a84c;
}

.subtitle {
    font-size: 0.8rem;
    color: #a8893a;
    letter-spacing: 0.22em;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

/* ---------- Instructions ---------- */

.instructions {
    margin-bottom: 2rem;
    line-height: 2;
    font-size: 0.82rem;
    color: #e0c97f;
    opacity: 0.75;
}

.instruction-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.key {
    display: inline-block;
    border: 1px solid #c9a84c;
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    font-size: 0.8rem;
    color: #c9a84c;
    min-width: 2rem;
    text-align: center;
}

.instructions strong {
    color: #c9a84c;
}

/* ---------- Buttons ---------- */

.game-btn {
    background: transparent;
    border: 1px solid #c9a84c;
    color: #c9a84c;
    padding: 0.7rem 2.8rem;
    font-family: inherit;
    font-size: 0.95rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s ease;
}

.game-btn:hover,
.game-btn:focus {
    background: #c9a84c;
    color: #0a0a0a;
    outline: none;
}

/* ---------- Score ---------- */

.final-score {
    font-size: 2.2rem;
    letter-spacing: 0.08em;
    margin-bottom: 0.3rem;
    color: #e0c97f;
}

.final-echoes {
    font-size: 0.8rem;
    color: #a8893a;
    margin-bottom: 1.8rem;
    letter-spacing: 0.1em;
}

/* ---------- Hint ---------- */

.hint {
    font-size: 0.65rem;
    color: #6b6359;
    margin-top: 1rem;
    letter-spacing: 0.08em;
}

/* ---------- Animations ---------- */

/* ---------- Button group ---------- */

.btn-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.game-btn--secondary {
    border-color: #6b6359;
    color: #6b6359;
}

.game-btn--secondary:hover,
.game-btn--secondary:focus {
    background: #6b6359;
    color: #0a0a0a;
    border-color: #6b6359;
}

/* ---------- Back link ---------- */

.back-link {
    display: inline-block;
    margin-top: 2.4rem;
    font-size: 0.72rem;
    color: #6b6359;
    text-decoration: none;
    letter-spacing: 0.1em;
    transition: color 0.25s ease;
}

.back-link:visited {
    color: #6b6359;
}

.back-link:hover,
.back-link:focus {
    color: #c9a84c;
}

/* ---------- Mobile swipe hint ---------- */

.swipe-hint {
    position: absolute;
    bottom: 1.4rem;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 5;
    font-size: 0.7rem;
    color: rgba(201, 168, 76, 0.35);
    letter-spacing: 0.15em;
    pointer-events: none;
    animation: hintFade 4s ease-out forwards;
}

.swipe-hint.hidden {
    display: none;
}

.swipe-arrow {
    display: inline-block;
    margin: 0 0.4rem;
    animation: swipeSlide 2s ease-in-out infinite alternate;
}

.swipe-arrow:first-child {
    animation-direction: alternate-reverse;
}

@keyframes hintFade {
    0%, 60% { opacity: 1; }
    100%    { opacity: 0; }
}

@keyframes swipeSlide {
    from { transform: translateX(-4px); }
    to   { transform: translateX(4px); }
}

/* ---------- Animations ---------- */

@keyframes overlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes logoPulse {
    0%, 100% { opacity: 0.85; filter: drop-shadow(0 0 4px transparent); }
    50%      { opacity: 1;    filter: drop-shadow(0 0 12px rgba(130, 190, 255, 0.45)); }
}
