@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap");

/* =========================================
   APACHLAND — DESIGN SYSTEM
   ========================================= */

:root {
    --page-bg: #eef8f1;
    --text-color: #234b3a;

    --card-bg: #fffdf5;
    --card-border: #c9dfbe;

    --avatar-bg: #d8ebc3;
    --avatar-border: #a8c880;

    --corner-radius: 16px;

    --soft-shadow:
        0 4px 12px rgba(35, 75, 58, 0.06);
}

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

* {
    box-sizing: border-box;
}

html {
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    padding: 8px clamp(16px, 1.8vw, 40px) 20px;

    background: var(--page-bg);
    color: var(--text-color);

    font-family: "Nunito", "Trebuchet MS", sans-serif;
}

h1,
h2,
h3,
p {
    overflow-wrap: break-word;
}

/* =========================================
   MAIN LAYOUT
   ========================================= */

main {
    width: 100%;
    /* No max-width: use the available monitor width. */
    margin: 0 auto;

    display: grid;
    grid-template-columns:
        minmax(0, 3fr)
        minmax(300px, 1fr);

    column-gap: clamp(16px, 1.5vw, 32px);
    row-gap: 0;

    align-items: start;
}

/* =========================================
   PAGE TITLE
   ========================================= */

main > h1 {
    grid-column: 1 / -1;
    margin: 0 0 8px;

    font-size: clamp(27px, 2.2vw, 44px);
    font-weight: 700;
    line-height: 1.25;
}

/* =========================================
   LEFT COLUMN
   ========================================= */

.world-column {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* =========================================
   GAME MAP
   ========================================= */

#world {
    position: relative;

    width: 100%;
    min-width: 0;

    overflow: hidden;

    border: none;
    border-radius: var(--corner-radius);

    background: #dcefe2;
}

#world-canvas {
    display: block;
    width: 100%;
    height: auto;

    /* Preserve map and resident coordinates on every screen. */
    aspect-ratio: 1753 / 897;
}

/* =========================================
   WORLD DESCRIPTION
   ========================================= */

#about {
    min-width: 0;
    font-family: inherit;
}

#about summary {
    color: var(--text-color);
    font-size: clamp(16px, 1vw, 20px);
    font-weight: 700;
    cursor: pointer;
}

#about p {
    margin: 2px 0 0;
    font-size: clamp(14px, 0.9vw, 18px);
    font-weight: 400;
    line-height: 1.5;
}

/* =========================================
   RIGHT COLUMN
   ========================================= */

#residents {
    min-width: 0;
}

#residents h2 {
    margin: 0 0 12px;
    font-size: clamp(22px, 1.65vw, 32px);
    font-weight: 700;
    line-height: 1.3;
}

/* =========================================
   RESIDENT CARDS
   ========================================= */

.resident-card {
    display: flex;
    align-items: center;

    gap: clamp(12px, 1.2vw, 24px);

    min-width: 0;
    min-height: clamp(120px, 9vw, 200px);

    padding: clamp(12px, 1vw, 22px);
    margin-bottom: 12px;

    background: var(--card-bg);

    border: 1px solid var(--card-border);
    border-radius: var(--corner-radius);

    box-shadow: var(--soft-shadow);
}

.resident-card:last-child {
    margin-bottom: 0;
}

/* =========================================
   RESIDENT AVATARS
   ========================================= */

.resident-avatar {
    display: block;

    width: clamp(76px, 6.1vw, 138px);
    height: clamp(76px, 6.1vw, 138px);
    flex: 0 0 clamp(76px, 6.1vw, 138px);

    object-fit: contain;

    border-radius: 50%;
    border: 3px solid var(--avatar-border);

    background:
        radial-gradient(
            circle,
            #f5fae9,
            var(--avatar-bg)
        );

    box-shadow:
        0 3px 10px rgba(35, 75, 58, 0.12);
}

/* =========================================
   RESIDENT INFORMATION
   ========================================= */

.resident-info {
    min-width: 0;
    flex: 1 1 auto;
}

.resident-info h3 {
    margin: 0 0 8px;
    font-size: clamp(18px, 1.2vw, 26px);
    font-weight: 700;
}

.resident-info p {
    margin: 0;
    font-size: clamp(12px, 0.88vw, 17px);
    line-height: 1.4;
}

/* =========================================
   TABLETS AND SMALL SCREENS
   ========================================= */

@media (max-width: 900px) {
    body {
        padding: 16px;
    }

    main {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 16px;
    }

    main > h1 {
        grid-column: 1;
        margin: 0;
        font-size: clamp(24px, 5vw, 34px);
    }

    .world-column {
        width: 100%;
        gap: 8px;
    }

    #residents {
        width: 100%;
    }

    #residents h2 {
        margin: 0 0 12px;
        font-size: 24px;
    }

    .resident-card {
        min-height: 0;
        gap: 12px;
        padding: 12px;
    }

    .resident-avatar {
        width: 76px;
        height: 76px;
        flex-basis: 76px;
    }

    .resident-info h3 {
        font-size: 18px;
    }

    .resident-info p {
        font-size: 13px;
    }
}
