:root {
    --bg-color: #F5F0EB;
    --card-bg: #ffffff;
    --primary: #1E2A3A;
    --accent: #C9A84C;
    --correct: #C9A84C;
    --text: #1E2A3A;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    background-size: auto 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text);
    margin: 0; padding: 12px; display: flex; flex-direction: column; align-items: center;
}
.container {
    max-width: 600px; width: 100%; background: var(--card-bg);
    padding: 20px 15px; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.header-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.level-indicator { font-weight: bold; background: var(--primary); color: white; padding: 4px 12px; border-radius: 20px; font-size: 0.85em; }
h1, h2 { margin: 0; color: var(--primary); text-align: center; }
h1 { font-size: 1.5em; margin-bottom: 4px; }
h2 { font-size: 1.1em; color: var(--accent); margin-bottom: 15px; }
.phrases-box {
    background: var(--bg-color); padding: 12px; border-radius: 10px;
    margin-bottom: 20px; border-left: 4px solid var(--accent);
}
.phrase-line { font-size: 0.95em; margin: 10px 0; line-height: 1.4; }
.coptic-text { font-weight: bold; color: #2980b9; font-size: 1.15em; word-break: break-word; }
.game-area { display: flex; flex-direction: column; gap: 20px; margin-bottom: 25px; }
.column { display: flex; flex-direction: column; gap: 10px; }
.column h3 { font-size: 1em; margin: 0 0 4px 0; text-transform: uppercase; letter-spacing: 0.5px; color: #7f8c8d; text-align: center;}
.item {
    background: #fff; border: 2px solid #E8DDCC; padding: 14px;
    border-radius: 12px; cursor: pointer; text-align: center;
    transition: all 0.15s ease; user-select: none; font-size: 1.05em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); touch-action: manipulation;
}
.item.selected { background: #F5EDD6; border-color: var(--accent); color: var(--accent); font-weight: bold; transform: scale(0.98); }
.item.matched { background: #F5EDD6; border-color: var(--correct); color: #A88930; cursor: default; font-weight: bold; opacity: 0.6; }
.word-highlight {
    background-color: rgba(201, 168, 76, 0.18);
    border-bottom: 2px solid var(--accent);
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.btn-next {
    display: none; width: 100%; background: var(--correct); color: white;
    border: none; padding: 15px; border-radius: 12px; font-size: 1.1em;
    font-weight: bold; cursor: pointer; box-shadow: 0 4px 12px rgba(201, 168, 76, 0.3);
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes scaleIn {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(30, 42, 58, 0.7); justify-content: center; align-items: center; z-index: 100; padding: 15px;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.25s ease-out forwards;
}
.modal-content {
    background: white; padding: 25px; border-radius: 16px;
    max-width: 450px; width: 100%; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.modal h2 { color: var(--accent); margin-bottom: 12px; font-size: 1.4em; }
.modal p { line-height: 1.5; color: #555; font-size: 0.95em; margin: 0 0 12px 0; }
.close-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
    transition: background 0.2s ease, transform 0.1s ease;
}
.close-btn:hover {
    background: var(--accent);
}
.close-btn:active {
    transform: scale(0.98);
}
.victory-message {
    text-align: center;
    padding: 30px 10px;
}
.victory-title {
    font-size: 1.25em; color: var(--accent); font-weight: bold; margin-bottom: 10px;
}
.victory-subtitle {
    color: #666; font-size: 1em; line-height: 1.5; margin-bottom: 25px;
}
.resources-box {
    margin-top: 25px; text-align: left; background: #f8fafb;
    border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}
.resources-box h3 {
    margin-top: 0; color: var(--primary); font-size: 1.1em;
    border-bottom: 2px solid #e2e8f0; padding-bottom: 8px; margin-bottom: 15px;
}
.resources-list {
    list-style: none; padding-left: 0; margin: 0; display: flex;
    flex-direction: column; gap: 15px;
}
.resources-list li {
    display: flex; flex-direction: column;
}
.resources-list li.divider {
    border-top: 1px solid #e2e8f0; padding-top: 12px; margin-top: 5px;
}
.resources-list a {
    color: var(--accent); font-weight: bold; text-decoration: none;
    font-size: 1.05em; display: inline-flex; align-items: center; gap: 6px; width: fit-content;
}
.resource-desc {
    color: #555; font-size: 0.9em; margin-top: 2px;
}
.resource-label {
    color: var(--primary); font-size: 0.95em;
}
.resource-book {
    color: #555; font-size: 0.95em; margin-top: 2px; font-style: italic;
}
