/* Ants & Atlases · Print Quiz · Animals of the World */

@page {
    size: letter portrait;
    margin: 0.5in;
}

* { box-sizing: border-box; }

body {
    font-family: 'Outfit', system-ui, sans-serif;
    color: #1a1a1a;
    background: #ece3d4;
    margin: 0;
    padding: 0 0 60px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* ---- Screen control bar -------------------------------------------- */
.page-controls {
    position: sticky;
    top: 0;
    background: #0a0c10;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 32px;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.back-link {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.85;
    transition: opacity 0.2s;
}
.back-link:hover { opacity: 1; }
.ctrl-title {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #94a3b8;
}
.print-btn {
    background: #f59e0b;
    color: #1a1a1a;
    border: none;
    padding: 10px 22px;
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    letter-spacing: 1.5px;
    transition: background 0.2s, transform 0.2s;
}
.print-btn:hover { background: #fbbf24; transform: translateY(-1px); }

/* ---- Worksheet sheet ----------------------------------------------- */
.worksheet {
    background: #fff;
    width: 8.5in;
    min-height: 11in;
    margin: 28px auto;
    padding: 0.5in;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

@media print {
    body { background: #fff; padding: 0; }
    .page-controls { display: none !important; }
    .worksheet {
        width: 100%;
        min-height: 0;
        margin: 0;
        padding: 0;
        box-shadow: none;
        gap: 14px;
    }
}

/* ---- Header --------------------------------------------------------- */
.ws-tag {
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #888;
    text-align: center;
    margin-bottom: 4px;
}
.ws-header h1 {
    font-family: 'Patrick Hand', cursive;
    font-size: 2.6rem;
    font-weight: 400;
    text-align: center;
    margin: 0 0 2px;
    letter-spacing: 1.5px;
}
.ws-sub {
    text-align: center;
    font-size: 1rem;
    color: #555;
    margin: 0;
    font-family: 'Patrick Hand', cursive;
}

/* ---- Matching layout ----------------------------------------------- */
.ws-match {
    border: 3px solid #1a1a1a;
    border-radius: 14px;
    padding: 18px 16px;
    display: grid;
    grid-template-columns: 1fr 1.1fr 1fr;
    gap: 0 8px;
    flex: 1;
    background: #fff;
}

/* ---- Animal & continent columns ------------------------------------ */
.match-col {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 6px;
}

.match-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 2px solid #e0d8cc;
    border-radius: 10px;
    background: #fffbf4;
    position: relative;
}

.animal-item { justify-content: flex-start; }
.continent-item { justify-content: flex-start; }

.animal-icon {
    font-size: 1.9rem;
    line-height: 1;
    flex-shrink: 0;
}
.animal-label {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.05rem;
    line-height: 1.2;
    flex: 1;
}

.cont-flag {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}
.cont-label {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.05rem;
    line-height: 1.2;
    flex: 1;
    font-weight: 600;
}

/* Connection dots at edges of each card */
.match-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2.5px solid #1a1a1a;
    background: #fff;
    flex-shrink: 0;
}
.match-dot.right { margin-left: auto; }
.match-dot.left  { margin-right: 2px; order: -1; }

/* ---- Center drawing area ------------------------------------------- */
.match-lines-area {
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 2px dashed #ccc;
    border-right: 2px dashed #ccc;
    margin: 0 4px;
    position: relative;
}
.lines-hint {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #bbb;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* ---- Fun facts strip ----------------------------------------------- */
.ws-facts {
    border: 2px dashed #1a1a1a;
    border-radius: 12px;
    padding: 12px 16px;
    background: #fffbf2;
}
.facts-tag {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 10px;
}
.facts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
}
.fact-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-family: 'Patrick Hand', cursive;
    font-size: 0.88rem;
    color: #444;
    line-height: 1.35;
}
.fact-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ---- Upside-down answer key ---------------------------------------- */
.ws-answer-key {
    display: flex;
    justify-content: center;
    padding: 6px 0 2px;
}
.answer-key-inner {
    transform: rotate(180deg);
    font-family: 'Patrick Hand', cursive;
    font-size: 0.72rem;
    color: #999;
    text-align: center;
    line-height: 1.5;
    border-top: 1px dashed #ccc;
    padding-top: 5px;
    max-width: 100%;
}
.ak-label {
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-right: 6px;
    color: #bbb;
}

/* ---- Footer --------------------------------------------------------- */
.ws-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #aaa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ws-meta {
    display: flex;
    gap: 32px;
    font-family: 'Patrick Hand', cursive;
    font-size: 1.05rem;
}
.meta-line {
    display: inline-block;
    border-bottom: 2px solid #1a1a1a;
    width: 140px;
    height: 1.4em;
    margin-left: 4px;
    vertical-align: bottom;
}
.ws-credit {
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #888;
}
