* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans Armenian', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease-in-out;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
}

.header.scrolled .nav {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    transition: padding 0.3s ease-in-out;
}

.logo h1 {
    color: #764ba2;
    font-size: 1.8rem;
    font-weight: 700;
}

.logo span {
    font-size: 0.9rem;
    color: #666;
    font-weight: 300;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: #764ba2;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: #764ba2;
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.main {
    padding: 80px 5% 0; /* Add top padding to account for fixed header */
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 90vh;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

.hero-content {
    flex: 1;
    color: white;
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-description {
    font-size: 1.2rem;
    line-height: 1.8;
    opacity: 0.9;
}

.featured-game {
    flex: 1;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 1s ease-out 0.2s both;
}

.featured-game h3 {
    color: #764ba2;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
}

/* --- WORD SCRAMBLE GAME STYLES --- */

.word-scramble-game {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.game-stats {
    display: flex;
    justify-content: space-around;
    background-color: #f7f5ff;
    padding: 0.75rem;
    border-radius: 12px;
}

.stat-item {
    font-size: 1.1rem;
    color: #555;
}

.stat-item span:last-child {
    font-weight: 700;
    color: #764ba2;
    margin-left: 0.5rem;
}

.word-display p {
    color: #666;
    margin-bottom: 0.5rem;
}

.word-display h2#scrambledWord {
    font-size: 2.5rem;
    font-weight: 700;
    color: #764ba2;
    letter-spacing: 0.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 0.5rem;
    min-height: 50px;
}

.game-input {
    display: flex;
    gap: 1rem;
}

.game-input input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.1rem;
    font-family: 'Noto Sans Armenian', sans-serif;
    transition: border-color 0.3s ease;
    text-transform: uppercase;
}

.game-input input:focus {
    outline: none;
    border-color: #764ba2;
}

.game-input button {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-input button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4);
}

.game-controls .skip-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.game-controls .skip-btn:hover {
    color: #f44336;
}

.feedback {
    min-height: 30px;
    font-weight: 600;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: center;
}

.feedback.success {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

.feedback.error {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}


/* --- SECTIONS (Games, About, Footer) --- */

.games-preview, .about-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    margin: 4rem auto;
    max-width: 1200px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.games-preview h2, .about-section h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #764ba2;
    margin-bottom: 3rem;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.game-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.game-card h3 {
    color: #764ba2;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.game-card p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.play-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.play-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.play-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.3);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature {
    text-align: center;
    padding: 1rem;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature h3 {
    color: #764ba2;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.feature p {
    color: #666;
    line-height: 1.6;
}

.footer {
    background: #1a1a2e;
    color: white;
    margin-top: 4rem;
    padding: 0 5%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.footer-section p {
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #667eea;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
    text-align: center;
    opacity: 0.6;
}

/* --- NEW MODAL AND GAME STYLES --- */

.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 650px;
    border-radius: 15px;
    position: relative;
    animation: slideDown 0.5s ease-out;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #333;
}

#modal-game-content {
    text-align: center;
}

#modal-game-content h2 {
    color: #764ba2;
    margin-bottom: 1.5rem;
}

/* History Quiz Styles */
.quiz-question {
    font-size: 1.3rem;
    margin-bottom: 2rem;
}
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.option-btn {
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: white;
    text-align: left;
    font-size: 1rem;
}
.option-btn:hover {
    border-color: #764ba2;
    background-color: #f7f5ff;
}
.option-btn.correct {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}
.option-btn.wrong {
    background-color: #f44336;
    color: white;
    border-color: #f44336;
}
.quiz-feedback {
    margin-top: 1.5rem;
    font-weight: bold;
}

/* Riddle Game Styles */
.riddle-text {
    font-size: 1.2rem;
    font-style: italic;
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}
.riddle-input-group {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}
#riddleAnswer {
    flex-grow: 1;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
}
.modal-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #764ba2;
    color: white;
    font-weight: bold;
    transition: background 0.3s;
}
.modal-btn:hover {
    background: #667eea;
}

/* Guess The Word Styles */
.guess-word-display {
    font-size: 2.5rem;
    letter-spacing: 0.5rem;
    margin: 1.5rem 0;
    color: #764ba2;
    font-weight: bold;
}
.guess-word-chances {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}
.guess-word-letters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
.letter-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    background: white;
}
.letter-btn:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

/* --- ANIMATIONS --- */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

@keyframes shake-light {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(1px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-1px, 0, 0); }
    40%, 60% { transform: translate3d(1px, 0, 0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.shake { animation: shake 0.6s cubic-bezier(.36,.07,.19,.97) both; }
.shake-light { animation: shake-light 0.6s cubic-bezier(.36,.07,.19,.97) both; }
.pulse { animation: pulse 0.5s ease-in-out; }


/* --- RESPONSIVENESS --- */

@media (max-width: 992px) {
    .hero {
        flex-direction: column;
        text-align: center;
        gap: 3rem;
        min-height: auto;
        padding-top: 4rem;
    }

    .featured-game {
        width: 100%;
        max-width: 550px;
    }
}

@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .game-input {
        flex-direction: column;
    }

    .games-grid, .features, .footer-content {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 90%;
        margin: 20% auto;
        padding: 20px;
    }
}
/* --- PASTE THIS AT THE END OF YOUR EXISTING styles.css FILE --- */

/* --- NEW STYLES FOR GAME PAGES --- */

.page-content {
    padding-top: 120px; /* More space for page title */
}

.game-page-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    margin: 0 auto 4rem auto;
    max-width: 1200px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.page-title {
    text-align: center;
    font-size: 2.8rem;
    color: #764ba2;
    margin-bottom: 1rem;
}

.page-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 3rem;
}

.game-grid-page {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.game-instance {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.game-instance.placeholder {
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    color: #aaa;
}


.game-instance h3 {
    text-align: center;
    color: #764ba2;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.game-instance .game-description {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.game-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-feedback {
    min-height: 24px;
    margin-top: 1rem;
    font-weight: bold;
}

.game-feedback.success { color: #4CAF50; }
.game-feedback.error { color: #f44336; }

/* General Game Element Styles */
.modal-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #764ba2;
    color: white;
    font-weight: bold;
    transition: background 0.3s;
    margin-top: 1rem;
}
.modal-btn:hover { background: #667eea; }

/* Guess The Word Styles */
.guess-word-display {
    font-size: 2rem; letter-spacing: 0.5rem; margin: 1rem 0; color: #764ba2; font-weight: bold;
}
.guess-word-chances { margin-bottom: 1rem; }
.guess-word-letters {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1.5rem; max-width: 400px;
}
.letter-btn {
    width: 40px; height: 40px; border: 1px solid #ccc; border-radius: 5px; cursor: pointer; font-size: 1rem; background: white;
}
.letter-btn:disabled { background: #e0e0e0; color: #999; cursor: not-allowed; }

/* Riddle Styles */
.riddle-text { font-size: 1.2rem; font-style: italic; color: #555; margin-bottom: 1.5rem; line-height: 1.7; text-align: center;}
.riddle-input-group { display: flex; gap: 10px; width: 100%; max-width: 400px;}
.riddle-input-group input { flex-grow: 1; padding: 0.8rem; border-radius: 8px; border: 1px solid #ccc; font-size: 1rem;}

/* History Quiz Styles */
.quiz-question { font-size: 1.3rem; margin-bottom: 2rem; text-align: center;}
.quiz-options { display: flex; flex-direction: column; gap: 0.75rem; width: 100%;}
.option-btn {
    padding: 1rem; border: 2px solid #ddd; border-radius: 10px; cursor: pointer; transition: all 0.2s ease; background-color: white; text-align: left; font-size: 1rem;
}
.option-btn:hover:not(:disabled) { border-color: #764ba2; background-color: #f7f5ff; }
.option-btn:disabled { cursor: not-allowed; }
.option-btn.correct { background-color: #4CAF50 !important; color: white; border-color: #4CAF50 !important; }
.option-btn.wrong { background-color: #f44336 !important; color: white; border-color: #f44336 !important;}
.quiz-progress { text-align: right; color: #888; margin-bottom: 1rem; }
#quiz-final-score p { font-size: 1.5rem; margin-bottom: 1rem; }

/* Make play-btn link look like a button */
a.play-btn {
    display: inline-block;
    text-decoration: none;
}

/* --- STYLES FOR 2048 GAME --- */

.game-instance#arm-2048-game .game-description {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

#game-container {
  position: relative;
  width: 420px; /* Adjusted for padding */
  height: 420px; /* Adjusted for padding */
  margin-top: 1rem;
  outline: none; /* Remove focus outline */
}

#grid-container {
  background: #bbada0;
  border-radius: 6px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 10px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.cell {
  background: #cdc1b4;
  border-radius: 3px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 40px;
  font-weight: bold;
  transition: background-color 0.3s;
}

#score-container {
  margin-top: 20px;
  font-size: 24px;
}