/* ==========================================================================
   Anno Domini - App Website
   Custom styles extending unigrid.css
   ========================================================================== */

:root {
    --ad-primary: #00658C;
    --ad-primary-light: #C3E7FF;
    --ad-secondary: #7D5800;
    --ad-secondary-light: #FFDEA2;
    --ad-bg: #f4f3f0;
    --ad-bg-alt: #eae8e3;
    --ad-surface: #FBFDFD;
    --ad-text: #1a1a1a;
    --ad-text-muted: #595959;
    --ad-brown: #917B4C;
    --ad-brown-dark: #59461f;
    --ad-radius: 0.75rem;
    --ad-radius-lg: 1.25rem;
}

/* Grid — ensure columns work regardless of unigrid.css internals */

.ug-grid {
    display: grid !important;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
}

.ug-col--5 { grid-column: span 5; }
.ug-col--6 { grid-column: span 6; }
.ug-col--7 { grid-column: span 7; }

@media (max-width: 768px) {
    .ug-grid {
        grid-template-columns: 1fr;
    }
    .ug-col--5,
    .ug-col--6,
    .ug-col--7 {
        grid-column: span 1;
    }
}

/* Container */

.ug-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Typography */

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--ad-text);
    background-color: var(--ad-bg);
    line-height: 1.7;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    line-height: 1.2;
}

/* Navbar */

.ug-navbar {
    background-color: var(--ad-brown-dark);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ad-navbar__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 1.25rem;
}

.ad-navbar__icon {
    border-radius: 50%;
}

.ug-navbar__nav {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.ug-navbar__nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
    letter-spacing: 0.02em;
}

.ug-navbar__nav a:hover {
    color: #fff;
}

.ug-navbar .ug-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Hero */

.ad-hero {
    background: linear-gradient(135deg, var(--ad-brown-dark) 0%, var(--ad-brown) 100%);
    color: #fff;
    padding: 6rem 0 5rem;
    overflow: hidden;
}

.ad-hero__title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 900;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
    color: #fff;
}

.ad-hero__subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.ad-hero__description {
    font-size: 1.05rem;
    opacity: 0.8;
    max-width: 520px;
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.ad-hero__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ad-hero__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.ad-hero__visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Buttons */

.ug-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    letter-spacing: 0.01em;
}

.ug-btn--primary {
    background-color: var(--ad-secondary-light);
    color: var(--ad-brown-dark);
    border-color: var(--ad-secondary-light);
}

.ug-btn--primary:hover {
    background-color: #ffe8b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(125, 88, 0, 0.3);
}

.ug-btn--outline {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

.ug-btn--outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

/* Sections — override unigrid.css dark defaults */

.ug-section.ad-section {
    background-color: var(--ad-bg);
    color: var(--ad-text);
    padding: 5rem 0;
}

.ug-section.ad-section--alt {
    background-color: var(--ad-bg-alt);
    color: var(--ad-text);
}

.ad-section__title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin-bottom: 1rem;
    color: var(--ad-brown-dark);
    text-align: center;
}

.ad-section__intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
    color: var(--ad-text-muted);
    font-size: 1.1rem;
    line-height: 1.8;
}

.ad-lead {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--ad-text);
    margin-bottom: 1.5rem;
}

/* Infobox (Spieler, Alter, Dauer, Editionen) */

.ad-infobox {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 2rem;
    background: var(--ad-surface);
    border-radius: var(--ad-radius-lg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.ad-infobox__item {
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--ad-bg);
    border-radius: var(--ad-radius);
}

.ad-infobox__value {
    display: block;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.25rem;
    font-weight: 900;
    color: var(--ad-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.ad-infobox__label {
    font-size: 0.85rem;
    color: var(--ad-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

/* Rules */

.ad-rules {
    max-width: 750px;
    margin: 2rem auto 0;
}

.ad-rule {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    align-items: flex-start;
}

.ad-rule__number {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    background: var(--ad-brown-dark);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.ad-rule__title {
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
    color: var(--ad-brown-dark);
}

.ad-rule__content p {
    color: var(--ad-text-muted);
    line-height: 1.8;
    margin: 0;
}

/* Editions Grid */

.ad-editions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.ad-edition {
    text-align: center;
    transition: transform 0.2s ease;
}

.ad-edition:hover {
    transform: translateY(-4px);
}

.ad-edition__img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--ad-bg-alt);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 0.75rem;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.ad-edition:hover .ad-edition__img {
    border-color: var(--ad-brown);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

.ad-edition__name {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ad-text);
}

/* Features List */

.ad-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2.5rem;
}

.ad-features__item {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 1.05rem;
    line-height: 1.6;
}

.ad-features__item:last-child {
    border-bottom: none;
}

.ad-features__item strong {
    color: var(--ad-primary);
}

/* App Icon */

.ad-app-icon {
    display: block;
    width: 200px;
    height: 200px;
    margin: 0 auto;
    border-radius: 2.5rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* Footer — override unigrid defaults */

.ug-footer.ad-footer {
    background-color: var(--ad-brown-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 3rem 0;
    height: auto;
    max-height: none;
    overflow: visible;
}

.ad-footer__brand {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
}

.ad-footer__credit {
    font-size: 0.9rem;
    line-height: 1.8;
}

.ad-footer__credit a {
    color: var(--ad-secondary-light);
    text-decoration: none;
}

.ad-footer__credit a:hover {
    text-decoration: underline;
}

.ad-footer__right {
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ad-footer__right a {
    color: var(--ad-secondary-light);
    text-decoration: none;
}

.ad-footer__swiss {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.6;
    margin-top: 0.5rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .ug-navbar__nav {
        display: none;
    }

    .ad-hero {
        padding: 4rem 0 3rem;
        text-align: center;
    }

    .ad-hero__description {
        margin-left: auto;
        margin-right: auto;
    }

    .ad-hero__actions {
        justify-content: center;
    }

    .ad-hero__visual {
        margin-top: 3rem;
    }

    .ad-kreisbild-stack {
        width: 260px;
        height: 260px;
        margin: 0 auto;
    }

    .ad-kreisbild {
        width: 160px;
        height: 160px;
    }

    .ug-grid {
        display: block;
    }

    .ad-infobox {
        margin-top: 2rem;
    }

    .ad-editions {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 1rem;
    }

    .ad-edition__img {
        width: 90px;
        height: 90px;
    }

    .ad-footer__right {
        text-align: left;
        margin-top: 2rem;
    }

    .ad-section {
        padding: 3rem 0;
    }

    .ad-rule {
        gap: 1rem;
    }

    .ad-rule__number {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* Focus visible */
:focus-visible {
    outline: 3px solid var(--ad-primary);
    outline-offset: 2px;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* ==========================================================================
   Join page (join.php)
   Landing for share links opened on devices without the app installed.
   Mobile-first: most traffic here is a tap on a share link.
   ========================================================================== */

.ad-join {
    /* Soft gradient echoing the primary teal so the page feels like
       part of the app's brand world, not a generic install page. */
    background:
        linear-gradient(180deg, var(--ad-primary-light) 0%, var(--ad-bg) 55%);
    padding: 3.5rem 0 5rem;
}

.ad-join__container {
    /* Narrower than the marketing container — this is a single-purpose
       conversion page, not a feature-rich landing. Keeps reading
       measure comfortable on tablet/desktop too. */
    max-width: 640px;
    text-align: center;
}

.ad-join__eyebrow {
    display: inline-block;
    margin: 0 0 1rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ad-primary);
    background-color: #fff;
    border-radius: 2rem;
    box-shadow: 0 1px 3px rgba(0, 101, 140, 0.15);
}

.ad-join__title {
    /* Use the hero-title scale but a touch smaller — three lines of
       body text follow right after, don't need to scream. */
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    line-height: 1.15;
    margin: 0 0 1.5rem;
    /* Override the white color inherited from `.ad-hero__title` — that
       rule is designed for index.html's dark-brown hero background,
       but the `.ad-join` section has a light blue → near-white
       gradient. Without this override, the title is white-on-near-
       white and effectively invisible (user-visible as "the section
       title disappears once the page is loaded"). */
    color: var(--ad-text);
}

/* Game-ID card — echoes the Lobby ShareArea visual in the app:
   primary-outlined frame, monospaced digits, wide letter-spacing.
   A user who sees both (this page + the app's lobby) recognises
   the same number presentation. */
.ad-join__gameid {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem auto 2rem;
    padding: 1.25rem 2.5rem;
    background-color: #fff;
    border: 2px solid var(--ad-primary);
    border-radius: var(--ad-radius-lg);
    box-shadow: 0 4px 16px rgba(0, 101, 140, 0.12);
}

.ad-join__gameid-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ad-text-muted);
}

.ad-join__gameid-value {
    font-family: 'Courier New', ui-monospace, monospace;
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.15em;
    color: var(--ad-primary);
}

.ad-join__intro {
    max-width: 36rem;
    margin: 0 auto 2.5rem;
    color: var(--ad-text);
    font-size: 1.05rem;
}

/* Steps list — ordered (install must come before opening),
   presented as a visual process, not a bullet list. */
.ad-join__steps {
    list-style: none;
    padding: 0;
    margin: 0 0 3rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ad-join__step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background-color: #fff;
    border-radius: var(--ad-radius);
    box-shadow: 0 2px 8px rgba(89, 70, 31, 0.06);
}

.ad-join__step-num {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--ad-primary);
    color: #fff;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1;
}

.ad-join__step-body {
    flex: 1 1 auto;
    min-width: 0;
}

.ad-join__step-title {
    /* Override the global h2 style — step titles are small headings,
       not section titles. */
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.35rem;
    color: var(--ad-text);
}

.ad-join__step-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--ad-text-muted);
}

.ad-join__step-text strong {
    color: var(--ad-text);
    font-family: 'Courier New', ui-monospace, monospace;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* CTA block — Play Store badge is primary, "already installed?"
   is the small secondary. */
.ad-join__cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.ad-join__playstore {
    display: inline-block;
    /* Google's brand guidelines: do not add borders, shadows, or
       custom button chrome around the badge. Hover: tiny lift only. */
    transition: transform 0.15s ease;
    border-radius: 0.25rem;
}

.ad-join__playstore:hover {
    transform: translateY(-2px);
}

.ad-join__playstore img {
    display: block;
    width: 260px;
    max-width: 100%;
    height: auto;
}

.ad-join__already {
    margin: 0;
    font-size: 0.9rem;
    color: var(--ad-text-muted);
}

.ad-join__open {
    margin-left: 0.35rem;
    font-weight: 600;
    color: var(--ad-primary);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.ad-join__open:hover {
    color: var(--ad-brown-dark);
}

.ad-join__platform-note {
    margin: 0;
    font-size: 0.85rem;
    color: var(--ad-text-muted);
    font-style: italic;
}

/* Mobile tuning — most of the page is already fluid, this just
   tightens the outer padding so the cards get more breathing room
   on narrow phones. */
@media (max-width: 540px) {
    .ad-join {
        padding: 2.5rem 0 3.5rem;
    }

    .ad-join__gameid {
        padding: 1rem 2rem;
        margin: 0.5rem auto 1.75rem;
    }

    .ad-join__step {
        padding: 1rem;
        gap: 0.85rem;
    }

    .ad-join__step-num {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1.1rem;
    }
}
