/* -------------------------------------- */
/* 1. BASE STYLES AND LAYOUT              */
/* -------------------------------------- */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    color: #333;
    /* Using a dummy background */
    background-image: url('https://i.ibb.co/XFhY1rW/background-image.jpg'); 
    background-size: cover;
    background-attachment: fixed;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 15px 20px 15px;
}

a { text-decoration: none; color: inherit; }

/* -------------------------------------- */
/* 2. HEADER AND PROFILE ICON             */
/* -------------------------------------- */
.app-header {
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #1e88e5;
}

.profile-icon {
    cursor: pointer;
    font-size: 1.5em;
    color: #555;
    position: relative;
}

.profile-icon .wallet-info {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #ffc107;
    color: #000;
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

/* -------------------------------------- */
/* 3. THEME SELECTION BANNER (Image Style)*/
/* -------------------------------------- */
.theme-header {
    background: linear-gradient(90deg, #ff9800, #ff5722, #ff9800);
    padding: 20px 10px;
    margin: 20px 0;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
}

.theme-header h1 {
    color: white;
    font-size: 1.8em;
    margin: 0;
    font-weight: 800;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

.difficulty-nav {
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-top: 15px;
}

.diff-button {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    font-size: 0.9em;
    background-color: white;
    color: #555;
}

.diff-button.active {
    color: #333;
    background: #ffeb3b; /* Yellow for medium/active */
    border: 2px solid #ffcc00;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.6);
}
/* Style for other difficulty buttons */
.diff-button[data-difficulty="easy"] { background-color: #e0f7fa; color: #00bcd4; }
.diff-button[data-difficulty="hard"] { background-color: #f8bbd0; color: #e91e63; }
.diff-button[data-difficulty="pro"] { background-color: #d1c4e9; color: #673ab7; }

/* -------------------------------------- */
/* 4. THEME GRID AND CARDS                */
/* -------------------------------------- */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding-top: 20px;
}

.theme-card {
    background-color: #fff8e1; /* Light yellow background */
    border-radius: 15px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
    transition: transform 0.2s;
}

.theme-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.card-icon {
    font-size: 3em;
    margin-top: 5px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-title {
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 5px;
}

/* Progress Bar (Top) */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
}

.progress-bar {
    height: 100%;
    background-color: #4CAF50;
    width: 0%; /* Updated by JS */
    transition: width 0.3s ease-in-out;
}

.progress-text {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #4CAF50;
    color: white;
    font-size: 0.7em;
    padding: 1px 4px;
    border-radius: 50%;
    line-height: 1;
    font-weight: bold;
}

/* Coin Unlock Cost (Bottom Right) */
.coin-cost {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #ffc107;
    color: #333;
    font-size: 0.75em;
    padding: 3px 6px;
    border-radius: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    /* Adjust position for the TV shows style */
    right: -5px; 
    top: -5px;
}
.coin-cost i {
    font-size: 1em;
    margin-left: 2px;
}

/* -------------------------------------- */
/* 5. MODAL STYLES (Auth/Guide)           */
/* -------------------------------------- */
.modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background-color: rgba(0, 0, 0, 0.8); 
    display: none; justify-content: center; align-items: center; 
    z-index: 1000; padding: 20px; 
}
.modal-content { 
    background-color: white; padding: 30px; border-radius: 15px; 
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4); width: 90%; max-width: 400px; 
    text-align: center; 
    animation: fadeInScale 0.3s ease-out;
}
.modal-content h2 { color: #1e88e5; margin-bottom: 25px; font-size: 1.8em; font-weight: 700; }
.modal-content input { 
    width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid #ddd; 
    border-radius: 8px; box-sizing: border-box; font-size: 1em; 
}
.modal-content button { 
    width: 100%; padding: 15px; background-color: #1e88e5; color: white; 
    border: none; border-radius: 8px; font-size: 1.1em; font-weight: bold; 
    cursor: pointer; margin-top: 10px; 
}
.switch-mode { margin-top: 20px; font-size: 0.9em; }
.switch-mode a { color: #1e88e5; font-weight: bold; }

/* Guide Styles */
.guide-content { text-align: left; }
.guide-content h3 { color: #ff5722; }
.guide-content ul { list-style-type: none; padding-left: 0; }
.guide-content ul li { margin-bottom: 10px; padding-left: 25px; position: relative; }
.guide-content ul li::before {
    content: '\f058'; /* fas fa-check-circle */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: #4CAF50;
}

/* -------------------------------------- */
/* 6. GAME PLAY MODAL (The Puzzle View)   */
/* -------------------------------------- */
#game-modal {
    /* Full screen modal for game play */
    padding: 0;
    background-color: #f0f2f5; 
}
#game-modal .modal-content {
    max-width: none;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 20px 15px;
    border-radius: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.game-header h3 {
    margin: 0;
    color: #ff5722;
}

#puzzle-area {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

#current-word-display {
    font-size: 2em;
    letter-spacing: 15px;
    margin-bottom: 30px;
    color: #1e88e5;
    font-weight: bold;
}

#letter-options {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.letter-btn {
    background-color: #ffeb3b;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    margin: 5px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.1s;
}
.letter-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.game-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: space-around;
}

.game-buttons button {
    width: 48%;
    background-color: #4CAF50;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
}

/* Coin Reward Notification */
#coin-notification {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffc107;
    color: #333;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 10000;
    animation: bounceIn 0.5s;
}

@keyframes bounceIn {
    0% { transform: translate(-50%, 50px); opacity: 0; }
    60% { transform: translate(-50%, -5px); opacity: 1; }
    100% { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
