/* Memory Training Games - Frontend Styles */
/* Optimized for accessibility and dementia patients */

html{
  margin: 0 !important;
}
body.kegne-main-screen {
    overflow-y: auto;
}

#page{
  background: url('../images/kegnebg.jpg') no-repeat center center;
  background-size: cover;
}

.kegne-main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* Hidden utility class */
.kegne-hidden {
    display: none !important;
}

/* Game Menu / Selection Screen */
.kegne-game-menu {
    text-align: center;
}

.kegne-welcome {
    margin-bottom: 40px;
}

.kegne-welcome h1 {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 10px;
}

.kegne-welcome p {
    font-size: 1.2em;
    color: #2c3e50;
    margin: 0;
}

.kegne-welcome .kegne-fullscreen-btn {
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 1.1em;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    position: absolute;
    top: 0;
    right: 15px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.kegne-welcome .kegne-fullscreen-btn:hover {
    background: #2980b9;
    transform: scale(1.05);
}

.kegne-welcome .kegne-fullscreen-btn:focus,
.kegne-welcome .kegne-fullscreen-btn:focus-visible {
    background: #3498db;
    outline: none;
    box-shadow: none;
}

.kegne-welcome .kegne-fullscreen-btn:active {
    background: #2980b9;
    transform: scale(0.95);
    outline: none;
}

.kegne-game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 30px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom:30px;
}

.kegne-game-card {
    background: rgba(255,255,255,0.5);
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 260px; /* Ensure consistent card height */
}

.kegne-game-card:hover {
    transform: translateY(-5px);
    border-color: #3498db;
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.2);
}

.kegne-game-card .game-icon {
    font-size: 4em;
    margin-bottom: 15px;
    height:80px;
}

.kegne-game-card .game-icon .greek-letters {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    width: 75px;
    font-size: 30px;
    height: 75px;
    display: flex;
    padding: 0;
    border-radius: 12px;
    font-weight: bold;
    align-items: center;
    text-align: center;
    justify-content: center;
    line-height: 1;
    margin:0 auto;
}

.kegne-game-card h2 {
    font-size: 1.5em;
    color: #2c3e50;
    margin-bottom: 10px;
}

.kegne-game-card p {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.kegne-start-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: bold;
    margin-top: auto;
}

.kegne-start-btn:hover {
    background: #2980b9;
}

/* Game Start Screen */
.kegne-game-start {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.kegne-start-content {
    text-align: center;
    max-width: 500px;
    background: white;
    padding: 60px 40px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    position: relative;
}

.kegne-start-back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.kegne-start-back-btn:hover {
    background: #7f8c8d;
}

.kegne-start-content h2 {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 20px;
}

.kegne-start-content p {
    font-size: 1.4em;
    color: #7f8c8d;
    margin-bottom: 40px;
}

.kegne-big-start-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 25px 60px;
    font-size: 2em;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(39, 174, 96, 0.3);
    min-width: 250px;
}

.kegne-big-start-btn:hover {
    background: #229954;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.4);
}

.kegne-big-start-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3);
}

.kegne-big-start-btn:disabled {
    background: #95a5a6 !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
}

.start-instructions {
    margin-top: 30px;
}

.start-instructions .game-instructions {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    font-size: 1.1em;
    color: #495057;
    line-height: 1.5;
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

/* Numbers Settings Screen */
.kegne-numbers-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Letters Settings Screen */
.kegne-letters-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Images Settings Screen */
.kegne-images-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Numbers and Letters Settings Screen */
.kegne-numbers-letters-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Operations Settings Screen */
.kegne-operations-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Words Settings Screen */
.kegne-words-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Sentences Settings Screen */
.kegne-sentences-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Reverse Sequence Settings Screen */
.kegne-reverse-sequence-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Position Recall Settings Screen */
.kegne-position-recall-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Radio button group in settings */
.kegne-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0;
}

.kegne-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1em;
    cursor: pointer;
}

.kegne-radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Audio Sequence Settings Screen */
.kegne-audio-sequence-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.kegne-settings-content {
    max-width: 1000px;
    background: white;
    padding: 30px 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    position: relative;
    text-align: center;
}

.kegne-settings-back-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #95a5a6;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.9em;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.kegne-settings-back-btn:hover {
    background: #7f8c8d;
}

.kegne-settings-content h2 {
    font-size: 1.8em;
    color: #2c3e50;
    margin-bottom: 15px;
}

.kegne-settings-content p {
    font-size: 1.1em;
    color: #7f8c8d;
    margin-bottom: 25px;
}

.kegne-settings-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

.kegne-settings-fields-row {
    display: flex;
    flex-direction: row;
    gap: 15px;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.kegne-settings-bottom-row {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
    justify-content: space-between;
}

.kegne-setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    flex: 1;
    min-width: 180px;
}

.kegne-settings-instructions {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    font-size: 0.95em;
    color: #495057;
    line-height: 1.4;
    text-align: left;
    flex: 1;
    max-width: 60%;
}

.kegne-settings-instructions h3 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 1.1em;
    text-align: center;
}

.kegne-setting-item label {
    font-size: 0.95em;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
}

.kegne-setting-item input {
    width: 100%;
    padding: 10px;
    font-size: 1em;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    transition: border-color 0.3s;
}

.kegne-setting-item input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.kegne-setting-description {
    font-size: 0.8em;
    color: #7f8c8d;
    text-align: center;
    margin: 0;
    line-height: 1.3;
}

.kegne-settings-start-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 25px 50px;
    font-size: 1.4em;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(39, 174, 96, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.kegne-settings-start-btn:hover {
    background: #229954;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.4);
}

.kegne-settings-start-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3);
}

/* Preparing message during game delay */
.preparing-message {
    font-size: 2em;
    color: #7f8c8d;
    text-align: center;
    font-weight: 300;
    animation: fadeInOut 1.5s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Game Play Area */
.kegne-game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0 10px;
}

.kegne-game-header {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-bottom: 2px solid #e0e0e0;
    min-height: 60px; /* Ensure proper height for absolutely positioned elements */
}

.kegne-game-header .kegne-back-btn {
    position: absolute;
    left: 20px;
}

.kegne-game-header h2 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    color: #2c3e50;
}

.kegne-game-header .kegne-fullscreen-btn {
    position: absolute;
    right: 20px;
}

.kegne-back-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.kegne-back-btn:hover {
    background: #7f8c8d;
}

.kegne-fullscreen-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 16px;
    font-size: 1.2em;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    min-width: 50px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.kegne-fullscreen-btn:hover {
    background: #2980b9;
    transform: scale(1.05);
}

.kegne-fullscreen-btn:focus,
.kegne-fullscreen-btn:focus-visible {
    background: #3498db;
    outline: none;
    box-shadow: none;
}

.kegne-fullscreen-btn:active {
    background: #2980b9;
    transform: scale(0.95);
    outline: none;
}

.kegne-game-header h2 {
    font-size: 2em;
    color: #2c3e50;
    margin: 0;
    flex: 1;
    text-align: center;
}

/* Sequence Display */
.kegne-sequence-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 40px;
    margin: 0;
    min-height: 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
}

.sequence-item {
    text-align: center;
    width: 100%;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.sequence-number {
    font-size: 6em;
    font-weight: bold;
    color: #2c3e50;
    padding: 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 300px;
    min-height: 300px;
}

.sequence-number.operation {
    font-size: 4em;
    padding: 30px 50px;
    min-height: 100px;
}

.sequence-img {
    max-width: 100%;
    max-height: 500px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    display: block;
    margin: 0 auto;
}

.sequence-item img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: block;
}

.sequence-complete {
    font-size: 8em;
    color: #2c3e50;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* Game Controls */
.kegne-game-controls {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: auto;
    /* Reserve fixed space so buttons appearing doesn't shift the display box above */
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.kegne-solution-btn,
.kegne-next-set-btn,
.kegne-next-btn {
    padding: 20px 50px;
    font-size: 1.5em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin: 0 10px;
    transition: all 0.3s;
}

.kegne-replay-btn,
.kegne-settings-restart-btn {
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.kegne-controls-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.kegne-controls-right {
    position: absolute;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.kegne-solution-btn {
    background: #e74c3c;
    color: white;
}

.kegne-solution-btn:hover {
    background: #c0392b;
}

.kegne-next-set-btn {
    background: #27ae60;
    color: white;
}

.kegne-next-set-btn:hover {
    background: #229954;
}

.kegne-next-btn {
    background: #27ae60;
    color: white;
}

.kegne-next-btn:hover {
    background: #229954;
}

.kegne-replay-btn {
    background: #2980b9;
    color: white;
    padding: 12px;
    border-radius: 50%;
    line-height: 0;
}

.kegne-replay-btn:hover {
    background: #2471a3;
    transform: scale(1.1);
}

.kegne-settings-restart-btn {
    background: #7f8c8d;
    color: white;
    padding: 12px;
    border-radius: 50%;
    line-height: 0;
}

.kegne-settings-restart-btn:hover {
    background: #6d7b7c;
    transform: scale(1.1);
}

.solution-text {
    font-size: 3em;
    font-weight: bold;
    color: #2c3e50;
    padding: 20px;
}

.solution-formula {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 15px;
}

.solution-result {
    font-size: 4em;
    font-weight: bold;
    color: #27ae60;
}

.solution-numbers {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.solution-sequence {
    font-size: 5em;
    color: #2c3e50;
    padding: 10px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #3498db;
}

.solution-sequence .sequence-label {
    font-weight: bold;
    color: #3498db;
}

.solution-sequence .sequence-numbers {
    font-weight: bold;
    color: #2c3e50;
}

.solution-images {
    display: flex;
    gap: 20px;
    justify-content: center;
    overflow-x: auto;
}

.solution-images .solution-sequence{
  display:flex;
}

.solution-image-item {
    text-align: center;
    position: relative;
    margin: 5px 3px;
    display: flex;
}

.solution-image-item img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #3498db;
}

.solution-image-item .image-number {
    position: absolute;
    top: -10px;
    left: -10px;
    background: #3498db;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
}

/* Loading Spinner */
.kegne-loading {
    text-align: center;
    padding: 60px;
}

.loading-spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.kegne-loading p {
    font-size: 1.5em;
    color: #7f8c8d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .kegne-welcome h1 {
        font-size: 2em;
    }
    
    .kegne-game-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .kegne-game-card {
        min-height: 240px; /* Slightly smaller for mobile */
    }
    
    .kegne-start-content {
        padding: 40px 20px;
        margin: 20px;
    }
    
    .kegne-start-content h2 {
        font-size: 2em;
    }
    
    .kegne-big-start-btn {
        padding: 20px 40px;
        font-size: 1.5em;
        min-width: 200px;
    }
    
    .sequence-number {
        font-size: 4em;
        min-width: 150px;
        padding: 30px;
        min-height: 90px;
    }
    
    .sequence-number.operation {
        font-size: 2.5em;
        padding: 20px 30px;
        min-height: 70px;
    }
    
    .sequence-item img {
        max-width: 100%;
        max-height: 100%;
    }
    
    .kegne-game-controls {
        padding-right: 90px;
    }

    .kegne-controls-center {
        flex-direction: column;
        width: 100%;
    }

    .kegne-solution-btn,
    .kegne-next-set-btn,
    .kegne-next-btn {
        display: block;
        width: 100%;
        margin: 10px 0;
    }
    
    .solution-text {
        font-size: 2em;
    }
    
    .solution-formula {
        font-size: 1.8em;
    }
    
    .solution-result {
        font-size: 3em;
    }
}

/* Fullscreen mode styles */
.kegne-main-container:fullscreen {
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 30px; /* Increased padding to prevent shadow clipping */
    box-sizing: border-box;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.kegne-main-container:fullscreen .kegne-game-header {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-height: 50px; /* Ensure proper height for absolutely positioned elements */
}

.kegne-main-container:fullscreen .kegne-game-header .kegne-back-btn {
    position: absolute;
    left: 20px;
}

.kegne-main-container:fullscreen .kegne-game-header h2 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    color: #2c3e50;
}

.kegne-main-container:fullscreen .kegne-game-header .kegne-fullscreen-btn {
    position: absolute;
    right: 20px;
}

.kegne-main-container:fullscreen .kegne-game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    gap: 20px;
    overflow: hidden;
    margin-bottom: 10px; /* Add space for controls shadow */
}

.kegne-main-container:fullscreen .kegne-sequence-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 40px;
    margin: 0;
    min-height: 0; /* Allow flex shrinking */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
}

.kegne-main-container:fullscreen .kegne-game-controls {
    flex-shrink: 0;
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: auto;
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.kegne-main-container:fullscreen .kegne-input-area {
    margin-top: 20px;
}

.kegne-main-container.kegne-fullscreen-mode {
    max-width: none !important;
    margin: 0 !important;
    padding: 30px !important; /* Increased padding to prevent shadow clipping */
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    overflow: auto;
}

.kegne-main-container.kegne-fullscreen-mode .kegne-game-header {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-bottom: none;
    min-height: 65px; /* Ensure proper height for absolutely positioned elements */
}

.kegne-main-container.kegne-fullscreen-mode .kegne-game-header .kegne-back-btn {
    position: absolute;
    left: 20px;
}

.kegne-main-container.kegne-fullscreen-mode .kegne-game-header h2 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    color: #2c3e50;
}

.kegne-main-container.kegne-fullscreen-mode .kegne-game-header .kegne-fullscreen-btn {
    position: absolute;
    right: 20px;
}

.kegne-main-container.kegne-fullscreen-mode .kegne-game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    gap: 20px;
    overflow: hidden;
    min-height: auto;
    margin-bottom: 10px; /* Add space for controls shadow */
    margin-left:auto;
    margin-right:auto;
}

.kegne-main-container.kegne-fullscreen-mode .kegne-sequence-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 40px;
    margin: 0;
    min-height: 0; /* Allow flex shrinking */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
}

.kegne-main-container.kegne-fullscreen-mode .kegne-game-controls {
    flex-shrink: 0;
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: auto;
    margin-bottom: 10px;
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Fullscreen button hover/active/focus effects — duplicated here for specificity in fullscreen context */
.kegne-fullscreen-btn:hover {
    background: #2980b9;
    transform: scale(1.05);
}

/* Audio Sequence Styles */
.audio-indicator {
    font-size: 4em;
    color: #3498db;
    animation: pulse 2s infinite;
}

.audio-indicator.speaking {
    color: #e74c3c;
    animation: speaking-pulse 0.5s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes speaking-pulse {
    0% { transform: scale(1); color: #e74c3c; }
    100% { transform: scale(1.2); color: #c0392b; }
}

/* Disabled Game Cards */
.kegne-disabled {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.kegne-disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1;
}

.kegne-disabled-btn {
    background: #95a5a6 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.kegne-no-sequences {
    color: #e74c3c;
    font-weight: bold;
    font-size: 0.9em;
    margin: 5px 0;
}

/* Admin Gallery Styles */
.kegne-gallery-container {
    margin-top: 20px;
}
.kegne-gallery-actions {
    margin-bottom: 15px;
}
.kegne-gallery-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 120px;
    padding: 15px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    background: #f9f9f9;
}
.kegne-gallery-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    background: #fff;
    flex: 0 0 auto;
    width: 110px;
}
.kegne-gallery-item img {
    display: block;
}
.kegne-remove-image {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #dc3232;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}
.kegne-remove-image:hover {
    background: #c62828;
}
.kegne-gallery-empty {
    margin: 40px 0;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Video Game Styles */
.video-container {
    text-align: center;
    margin: 20px 0;
}

.video-container iframe {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.video-questions-display {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.video-questions-display h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.question-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.question-item p {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #2c3e50;
}

.answer-placeholder {
    min-height: 30px;
}

.answer {
    color: #27ae60;
    font-weight: 500;
    margin-top: 10px;
    padding: 10px;
    background: #f0f9f0;
    border-radius: 4px;
    border-left: 3px solid #27ae60;
}

.question-answer {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.question-answer:focus {
    outline: none;
    border-color: #3498db;
}

.kegne-submit-btn {
    display: block;
    margin: 20px auto;
    padding: 12px 24px;
    font-size: 1.1em;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.kegne-submit-btn:hover {
    background: #229954;
}

.solution-video {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.question-answer-pair {
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
}

.question {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.answer {
    color: #27ae60;
    font-weight: 500;
}
