* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Press Start 2P', 'Courier New', monospace;
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #000;
    position: fixed;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.screen {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    padding-bottom: 60px;
    overflow-y: auto;
    background-image: url('DunamasePix1.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.screen.active {
    display: flex;
}

#loading {
    background: #000;
    justify-content: center;
}

.logo-zoom {
    max-width: 80%;
    animation: zoomIn 2s ease-in-out;
}

@keyframes zoomIn {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.main-logo {
    max-width: 80%;
    margin: 20px 0;
    image-rendering: pixelated;
}

.button-stack {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 90%;
    max-width: 400px;
    margin-bottom: 40px;
}

.menu-btn {
    padding: 15px 20px;
    font-size: 12px;
    background: #8b4513;
    color: #fff;
    border: 4px solid #654321;
    cursor: pointer;
    text-align: center;
    box-shadow: 4px 4px 0 #000;
    transition: transform 0.1s;
}

.menu-btn.instructions-btn {
    background: #2e7d32;
    border-color: #1b5e20;
}

.menu-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

.back-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 10px 15px;
    font-size: 10px;
    background: #444;
    color: #fff;
    border: 3px solid #222;
    cursor: pointer;
    box-shadow: 3px 3px 0 #000;
}

h2 {
    font-size: 16px;
    color: #fff;
    text-shadow: 3px 3px 0 #000;
    margin: 60px 0 20px 0;
    text-align: center;
}

.instructions-content {
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.instruction-item {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border: 4px solid #000;
    box-shadow: 4px 4px 0 #000;
}

.instruction-item h3 {
    font-size: 11px;
    margin-bottom: 10px;
    color: #8b4513;
}

.instruction-item p {
    font-size: 9px;
    line-height: 1.6;
    color: #000;
}

.word-puzzle {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 20px auto;
}

.domhnall-face {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    image-rendering: pixelated;
    z-index: 10;
}

.letter-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.letter-box {
    position: absolute;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 3px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 3px 3px 0 #000;
}

.clue-text {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    margin: 10px 20px;
    border: 3px solid #000;
    font-size: 10px;
    color: #000;
    box-shadow: 3px 3px 0 #000;
}

.answer-input {
    width: 90%;
    max-width: 300px;
    padding: 15px;
    font-size: 14px;
    border: 4px solid #000;
    background: #fff;
    text-align: center;
    text-transform: uppercase;
    margin: 20px 0;
    box-shadow: 3px 3px 0 #000;
}

.game-buttons {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.game-btn {
    padding: 12px 25px;
    font-size: 11px;
    background: #4a90e2;
    color: #fff;
    border: 3px solid #2e5fa3;
    cursor: pointer;
    box-shadow: 3px 3px 0 #000;
}

.game-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #000;
}

.result-message {
    min-height: 40px;
    padding: 15px 20px;
    font-size: 12px;
    text-align: center;
    margin: 10px 0;
    border: 4px solid #000;
    box-shadow: 4px 4px 0 #000;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    display: none;
}

.result-message.show {
    display: block;
}

.result-message.correct {
    background: rgba(76, 175, 80, 0.95);
    border-color: #2e7d32;
}

.result-message.incorrect {
    background: rgba(244, 67, 54, 0.95);
    border-color: #c62828;
}

.question-list {
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.question-item {
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid #000;
    cursor: pointer;
    font-size: 10px;
    box-shadow: 3px 3px 0 #000;
    transition: transform 0.1s;
}

.question-item:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #000;
}

.question-detail-container {
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.question-content {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border: 4px solid #000;
    font-size: 11px;
    line-height: 1.6;
    box-shadow: 4px 4px 0 #000;
}

.question-content .question-text {
    font-size: 11px;
    margin-bottom: 15px;
    color: #000;
    font-weight: bold;
}

.option {
    margin: 10px 0;
    padding: 10px;
    background: #f0f0f0;
    border: 2px solid #666;
    cursor: pointer;
    transition: all 0.2s;
}

.option:hover {
    background: #e0e0e0;
}

.option.selected {
    background: #4a90e2;
    color: #fff;
    border-color: #2e5fa3;
}

.option.correct {
    background: #4caf50;
    color: #fff;
    border-color: #2e7d32;
}

.option.incorrect {
    background: #f44336;
    color: #fff;
    border-color: #c62828;
}

.option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.submit-answer-btn {
    padding: 15px 30px;
    font-size: 12px;
    background: #ff9800;
    color: #fff;
    border: 4px solid #f57c00;
    cursor: pointer;
    box-shadow: 4px 4px 0 #000;
    transition: transform 0.1s;
}

.submit-answer-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

.submit-answer-btn:disabled {
    background: #999;
    border-color: #666;
    cursor: not-allowed;
}

.answer-feedback {
    min-height: 30px;
    padding: 15px;
    font-size: 11px;
    text-align: center;
    width: 100%;
}

.answer-feedback.correct {
    background: rgba(76, 175, 80, 0.9);
    color: #fff;
    border: 3px solid #2e7d32;
    box-shadow: 3px 3px 0 #000;
}

.answer-feedback.incorrect {
    background: rgba(244, 67, 54, 0.9);
    color: #fff;
    border: 3px solid #c62828;
    box-shadow: 3px 3px 0 #000;
}

.explanation-box {
    width: 100%;
    background: rgba(255, 235, 205, 0.95);
    padding: 20px;
    border: 4px solid #8b4513;
    box-shadow: 4px 4px 0 #000;
    font-size: 10px;
    line-height: 1.7;
    color: #000;
}

.explanation-box::before {
    content: '📖 Explanation:';
    display: block;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #8b4513;
}

.domhnall-speech {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
}

.domhnall-small {
    width: 80px;
    height: 80px;
    image-rendering: pixelated;
    flex-shrink: 0;
}

.speech-bubble {
    background: #fff;
    padding: 15px;
    border: 3px solid #000;
    border-radius: 10px;
    font-size: 9px;
    position: relative;
    box-shadow: 3px 3px 0 #000;
    flex: 1;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: -15px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-right-color: #000;
    border-left: 0;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    bottom: 10px;
    left: -10px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-right-color: #fff;
    border-left: 0;
    z-index: 1;
}

.matchmaker-form {
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.matchmaker-form input {
    padding: 12px;
    font-size: 11px;
    border: 3px solid #000;
    background: #fff;
    box-shadow: 3px 3px 0 #000;
}

.match-result {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#heartSVG {
    filter: drop-shadow(4px 4px 0px #000);
}

#heartFillRect {
    transition: y 1s ease-out, height 1s ease-out;
}

.match-percentage {
    font-size: 24px;
    color: #fff;
    text-shadow: 3px 3px 0 #000;
}

.hug-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hug-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.domhnall-hug {
    width: 150px;
    height: 150px;
    image-rendering: pixelated;
}

.hug-speech-bubble {
    background: #fff;
    padding: 20px;
    border: 4px solid #000;
    border-radius: 15px;
    font-size: 12px;
    position: relative;
    box-shadow: 4px 4px 0 #000;
    max-width: 300px;
    text-align: center;
}

.hug-speech-bubble::after {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border: 12px solid transparent;
    border-bottom-color: #000;
    border-top: 0;
}

.hug-speech-bubble::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border: 12px solid transparent;
    border-bottom-color: #fff;
    border-top: 0;
    z-index: 1;
}

@media (max-width: 600px) {
    .menu-btn { font-size: 10px; padding: 12px 15px; }
    h2 { font-size: 14px; }
    .word-puzzle { width: 280px; height: 280px; }
    .domhnall-face { width: 90px; height: 90px; }
    .letter-box { width: 38px; height: 38px; font-size: 18px; }
    .instruction-item h3 { font-size: 10px; }
    .instruction-item p { font-size: 8px; }
    .submit-answer-btn { font-size: 10px; padding: 12px 25px; }
    .explanation-box { font-size: 9px; }
}