/* ── UCM Colors: Gold #dbaa00, Blue #0f2d52, Dark #071828 ── */

@font-face {
    font-family: 'PixelPurl';
    src: url('../assets/PixelPurl.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'PixelPurl', 'Segoe UI', system-ui, -apple-system, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 40px 20px;
    box-sizing: border-box;
    background-color: #071828;
    color: #ffffff;
    min-height: 100vh;
}

a.back {
    align-self: flex-start;
    color: #dbaa00;
    text-decoration: none;
    font-size: 1.4rem;
    background: rgba(219, 170, 0, 0.1);
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid rgba(219, 170, 0, 0.35);
    transition: background 0.2s;
    animation: fadeIn 1s ease forwards;
}
a.back:hover { background: rgba(219, 170, 0, 0.2); }

h1 {
    font-size: 4rem;
    color: #dbaa00;
    border-bottom: 2px solid rgba(219, 170, 0, 0.3);
    padding-bottom: 10px;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: floatUp 0.6s ease-out forwards;
}

.games-wrapper {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 900px;
    width: 100%;
    opacity: 0;
    animation: floatUp 0.8s ease-out forwards;
    animation-delay: 0.2s;
}

/* ── Image-only card ── */
.mobile-card {
    display: block;
    width: clamp(260px, 40vw, 380px);
    text-decoration: none;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.18s ease;
}
.mobile-card:hover { transform: scale(1.02); }
.mobile-card:hover .mc-img-wrapper { border-color: rgba(219, 170, 0, 0.7); }

.mc-img-wrapper {
    position: relative;
    width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(219, 170, 0, 0.3);
    overflow: visible;
    line-height: 0;
}

.mc-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    background-color: rgba(0,0,0,0.2);
}

/* ── Info button ── */
.mc-info {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 10;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(7, 24, 40, 0.72);
    border: 1px solid rgba(219, 170, 0, 0.55);
    color: #dbaa00;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
}
.mc-info::before { content: 'i'; }

/* Tooltip (desktop hover only) */
.mc-info::after {
    content: attr(data-desc);
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: rgba(7, 24, 40, 0.96);
    border: 1px solid rgba(219, 170, 0, 0.4);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.85rem;
    line-height: 1.4;
    padding: 8px 10px;
    white-space: normal;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: 100;
}
.mc-info:hover::after { opacity: 1; }

/* ── Mobile info popup (touch) ── */
.mobile-info-popup {
    position: absolute;
    z-index: 9999;
    width: 220px;
    background: rgba(7, 24, 40, 0.97);
    border: 1px solid rgba(219, 170, 0, 0.45);
    border-radius: 9px;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'PixelPurl', 'Segoe UI', system-ui, sans-serif;
    font-size: 0.88rem;
    line-height: 1.4;
    padding: 10px 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.55);
    pointer-events: auto;
}

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

.theme-toggle {
    display: flex;
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 1001;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(219, 170, 0, 0.45);
    background: rgba(255, 255, 255, 0.06);
    color: #dbaa00;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover {
    background: rgba(219, 170, 0, 0.14);
    border-color: rgba(219, 170, 0, 0.75);
    transform: scale(1.08);
}
.theme-toggle svg {
    width: 22px;
    height: 22px;
    pointer-events: none;
}
.icon-sun  { display: block; }
.icon-moon { display: none;  }
.light-mode .icon-sun  { display: none;  }
.light-mode .icon-moon { display: block; }

/* Light mode */
.light-mode body {
    background-color: #e8eef5;
    color: #071828;
}
.light-mode h1 {
    color: #0f2d52;
    border-bottom-color: rgba(15, 45, 82, 0.3);
}
.light-mode a.back {
    color: #0f2d52;
    background: rgba(15, 45, 82, 0.08);
    border-color: rgba(15, 45, 82, 0.3);
}
.light-mode a.back:hover { background: rgba(15, 45, 82, 0.16); }
.light-mode .mc-img-wrapper { border-color: rgba(15, 45, 82, 0.22); }
.light-mode .mobile-card:hover .mc-img-wrapper { border-color: rgba(15, 45, 82, 0.55); }
.light-mode .mc-info {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(15, 45, 82, 0.45);
    color: #0f2d52;
}
.light-mode .mc-info::after {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(15, 45, 82, 0.3);
    color: #071828;
}
.light-mode .theme-toggle {
    border-color: rgba(15, 45, 82, 0.45);
    background: rgba(15, 45, 82, 0.06);
    color: #0f2d52;
}
.light-mode .theme-toggle:hover {
    background: rgba(15, 45, 82, 0.14);
    border-color: rgba(15, 45, 82, 0.75);
}
