/*
 * Le Tabelline - Times Tables learning game for children
 * Copyright (C) 2025  Maurizio Meluzzi
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
 */

/* ============================================================
   BASE
   ============================================================ */

*, *::before, *::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	background-color: #F4C2DF;
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
	color: #821f9d;
}

/* ============================================================
   LANDING PAGE LAYOUT
   ============================================================ */

body {
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: clamp(16px, 4vw, 40px);
	padding: clamp(24px, 5vw, 60px) clamp(16px, 6vw, 80px);
}

.landing-hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(10px, 2.5vw, 28px);
	text-align: center;
}

.landing-hero img {
	width: clamp(80px, 20vw, 220px);
	height: auto;
}

.landing-hero-top {
	display: contents;
}

.landing-title {
	font-size: clamp(2rem, 8vw, 5rem);
	font-weight: bold;
	color: #821f9d;
	line-height: 1.1;
	margin: 0;
}

.landing-subtitle {
	font-size: clamp(1rem, 3vw, 1.6rem);
	color: #555;
	max-width: 560px;
	line-height: 1.5;
	margin: 0;
}

.btn-play {
	display: inline-block;
	padding: clamp(14px, 3vw, 22px) clamp(40px, 8vw, 80px);
	background-color: #821f9d;
	color: #fff;
	font-size: clamp(1.3rem, 4vw, 2.2rem);
	font-weight: bold;
	border-radius: clamp(12px, 3vw, 40px);
	text-decoration: none;
	letter-spacing: 0.05em;
	box-shadow: 0 4px 16px rgba(130, 31, 157, 0.3);
	transition: background-color 0.15s ease, box-shadow 0.15s ease;
	min-width: 44px;
	min-height: 44px;
}

.btn-play:hover,
.btn-play:active {
	background-color: #6a1882;
	box-shadow: 0 6px 24px rgba(130, 31, 157, 0.45);
}

/* ============================================================
   LANGUAGE SELECTOR
   ============================================================ */

#lang-selector {
	display: flex;
	gap: clamp(8px, 2vw, 16px);
	justify-content: center;
	position: fixed;
	top: clamp(12px, 3vw, 24px);
	right: clamp(12px, 3vw, 24px);
}

.lang-flag {
	font-size: clamp(1.22rem, 4vw, 2rem);
	cursor: pointer;
	opacity: 0.45;
	transition: opacity 0.15s ease, transform 0.15s ease;
	user-select: none;
}

.lang-flag.active {
	opacity: 1;
	transform: scale(1.2);
}

.lang-flag:hover {
	opacity: 0.85;
}

/* ============================================================
   FOOTER
   ============================================================ */

.landing-footer {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(6px, 1.5vw, 14px);
	text-align: center;
	font-size: clamp(0.75rem, 2vw, 1rem);
	color: #888;
	margin-top: auto;
}

.landing-footer a {
	color: #821f9d;
	text-decoration: underline;
}

.landing-secondary-link {
	color: #821f9d;
	font-size: clamp(0.9rem, 2.5vw, 1.1rem);
	text-decoration: underline;
	background: none;
	border: none;
	padding: 0;
}

/* ============================================================
   LANDSCAPE COMPACT ADJUSTMENT
   ============================================================ */

@media (orientation: landscape) and (max-height: 500px) {

    body {
        flex-direction: column;
        justify-content: center;
        gap: clamp(6px, 1.5vh, 16px);
        padding: 8px clamp(16px, 4vw, 40px);
    }

    .landing-hero {
        flex-direction: column;
        align-items: center;
        text-align: left;
        gap: clamp(10px, 2vw, 24px);
        justify-content: center;
    }

    .landing-hero-top {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: clamp(10px, 2vw, 24px);
    }

    .landing-hero img {
        width: clamp(70px, 13vh, 140px);
    }

    .landing-title {
        font-size: clamp(1.6rem, 6vh, 3rem);
    }

    .landing-subtitle {
        font-size: clamp(0.85rem, 2.5vh, 1.2rem);
    }

    .landing-footer {
        font-size: clamp(0.65rem, 1.8vh, 0.85rem);
        margin-top: 0;
        gap: 4px;
    }

    .lang-flag {
        font-size: clamp(1rem, 3vh, 1.5rem);
    }
}
