
body {
    margin: 0;
    padding: 0;
    font-family: 'TwojaCzcionka', 'Arial', sans-serif;
    background-color: #001428;
    color: #ecf0f1;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
}

#app {
    width: 95%;
    height: 95%;
    max-width: 1800px; 
    max-height: 980px;
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: center;
    text-align: center;
}

.screen {
    display: flex; 
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    padding: 30px;
    box-sizing: border-box;
    position: absolute; 
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out; 
    transform: translateY(20px); 
}

.screen.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
    z-index: 10; 
}

h1 {
    color: #00bcd4 ;
    font-size: 3.5em;
    margin-bottom: 20px; 
    margin-top: 0; 
}

button {
    padding: 20px 40px;
    font-size: 1.8em;
    margin: 15px;
    cursor: pointer;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    transition: background-color 0.3s, transform 0.1s;
    min-width: 250px;
}
button:active {
    transform: scale(0.98);
}
button:hover, button:focus {
    background-color: #2980b9;
    outline: 4px solid #0077FF ;
    outline-offset: 2px;
}

#game-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;   
    padding: 15px;
}

.game-content-wrapper {
    display: flex;         
    flex-direction: row;    
    justify-content: center; 
    align-items: center;    
    width: 100%;             
    height: 100%;           
    max-width: 1800px;    
    gap: 30px;             
}

#game-board-container {
    flex: 3 1 auto; 
    display: flex;
    justify-content: center; 
    align-items: center;
    height: 100%; 
    overflow: auto; 
    padding: 10px;
    box-sizing: border-box;
}

#game-board {
    display: grid;
    row-gap: 15px;  
    column-gap: 15px;
    perspective: 1000px;
}

.card {
    background-color: transparent;
    width: var(--card-size);
    height: var(--card-size);
    cursor: pointer;
    border-radius: 12px;
    transition: transform 0.2s ease-in-out, opacity 0.3s ease;
}
:root {
    --card-size: 170px;
}

#game-controls-container {
    flex: 1 1 250px; 
    display: flex;
    flex-direction: column; 
    justify-content: center; 
    align-items: center;    
    height: 80%; 
    padding: 20px;
    box-sizing: border-box;
}

#game-info {
    font-size: 2.8em;
    margin-bottom: 40px; 
    color: #f1c40f;
    font-weight: bold;
    text-align: center;
}
#game-info #timer {
    display: block; 
    margin-top: 5px;
}

.card:hover {
    transform: scale(1.03);
}
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    transform: translateZ(0);
    will-change: transform;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    padding: calc(var(--card-size) * 0.08);  
    box-sizing: border-box;
}

.card-face img {
    display: block; 
    max-width: 100%;
    max-height: 100%; 
    width: auto; 
    height: auto; 
    object-fit: contain; 
}


.card-front {
    background-color: #ffffff; 
    transform: rotateY(180deg);
}

.card-back {
      background-color: #0077FF;
    color: #ecf0f1;
}

.card.matched {
    opacity: 0.6;
    box-shadow: none;
    cursor: default;
}
.card.matched .card-inner {
    box-shadow: none;
}

#trivia-screen {
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: center;
    padding: 20px; 
}

#trivia-screen h1 { /* styl z ogólnego h1 */ }
#trivia-screen h2 { /* styl z ogólnego h2 */ }
.trivia-content-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: space-around; 
    align-items: stretch; 
    width: 100%;
    max-width: 1700px;
    flex-grow: 1; 
    gap: 40px; 
    margin-bottom: 20px; 
}
.trivia-info-container {
    flex: 1 1 55%; 
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.1); 
    border-radius: 10px;
}

.trivia-info-container h1 {
    color: #2ecc71; 
    font-size: 3.8em; 
    margin-bottom: 25px;
}

.your-time-section {
    margin-bottom: 30px;
    padding: 15px 25px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid #f1c40f; 
    width: 80%;
    max-width: 450px;
}
.your-time-section h2 {
    font-size: 1.8em;
    color: #f1c40f; 
    margin-top: 0;
    margin-bottom: 5px;
}
#your-final-time {
    font-size: 3.0em; 
    color: #ffffff;
    font-weight: bold;
    margin: 0;
}

.trivia-info-container h2 { 
    color: #bdc3c7;
    font-size: 2.0em;
    margin-bottom: 15px;
    margin-top: 0; 
}

#trivia-text { 
    font-size: 1.7em; 
    color: #ecf0f1;
    background-color: transparent;
    padding: 0 15px; 
    border-radius: 0;
    max-width: 90%;
    min-height: auto; 
    margin-bottom: 0; 
    line-height: 1.5;
    flex-grow: 1;
}

.trivia-ranking-container {
    flex: 1 1 40%; 
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.1); 
    border-radius: 10px;
}

#trivia-ranking-title { 
    color: #f1c40f;
    font-size: 2.2em; 
    margin-bottom: 5px;
    margin-top: 0;
    flex-shrink: 0;
}
.ranking-date { 
    font-size: 1.1em;
    color: #bdc3c7;
    margin-bottom: 20px;
    flex-shrink: 0;
}

#trivia-score-list { 
    width: 100%; 
    max-width: 450px;
    max-height: none; 
    overflow-y: auto; 
    margin-bottom: 0; 
    flex-grow: 1; 
    list-style-type: decimal;
    padding-left: 40px; 
    font-size: 1.6em; 
    background-color: rgba(0, 0, 0, 0.15); 
    border-radius: 5px;
    padding-top: 15px;
    padding-bottom: 15px;
}

#trivia-score-list li {
    margin-bottom: 10px;
    padding: 5px 10px;
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.08);
}

.trivia-buttons {
    margin-top: 20px; 
    flex-shrink: 0; 
}

#trivia-text {
    font-size: 1.8em;
    color: #ecf0f1;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 25px;
    border-radius: 8px;
    max-width: 80%;
    min-height: 80px;
    margin-bottom: 25px;
    line-height: 1.5; 
}
#trivia-ranking-title {
    color: #f1c40f;
    font-size: 2.0em;
    margin-bottom: 5px;
}
.ranking-date {
    font-size: 1.1em;
    color: #bdc3c7;
    margin-bottom: 15px;
}
#trivia-score-list {
    max-height: 220px; 
    overflow-y: auto;
    margin-bottom: 25px; 
}


#score-screen h1 { /* styl z ogólnego h1 */ }
.ranking-section {
    margin-bottom: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ranking-section h2 {
    color: #00bcd4;
    font-size: 2.2em; 
    margin-bottom: 10px;
}


.score-list-container {
    list-style-type: decimal;
    padding-left: 50px;
    max-width: 500px;
    width: 85%;
    text-align: left;
    font-size: 1.7em; 
    margin-left: auto;
    margin-right: auto;
    background-color: rgba(0, 0, 0, 0.15); 
    border-radius: 5px;
    padding-top: 15px;
    padding-bottom: 15px;
}
.score-list-container li {
    margin-bottom: 12px;
    padding: 8px 12px; 
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.08); 
}


.button-container {
    margin-top: auto; 
    padding-top: 15px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    flex-shrink: 0; 
}

#start-screen {
    justify-content: center; 
    align-items: center;   
}

.start-content-wrapper {
    display: flex;         
    flex-direction: row;    
    justify-content: center; 
    align-items: center;    
    width: 90%;             
    max-width: 1600px;      
    gap: 50px;              
    padding: 20px;
}

.start-logo-container {
    flex: 1 1 60%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.start-logo-container img {
    max-width: 100%;
    max-height: 800px; 
    height: auto;    
}

.start-buttons-container {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column; 
    align-items: center;    
    padding: 20px;
}

.start-buttons-container h1 {
    font-size: 3em; 
    margin-bottom: 30px;
    color: #0077FF ; 
}

.level-buttons-group {
    display: flex;
    flex-direction: column; 
    align-items: center;
    margin-bottom: 40px; 
    width: 100%; 
}

.level-buttons-group .level-button {
    width: 80%; 
    max-width: 400px; 
    margin-top: 10px; 
    margin-bottom: 10px; 
    margin-left: 0; 
    margin-right: 0;
}

.ranking-button {
    background-color: #0077FF;
    width: 80%;
    max-width: 400px;
    margin-top: auto;
}
.ranking-button:hover, .ranking-button:focus {
    background-color: #0660c7 ;
}

button {
    background-color: #0077FF;
    color: #ecf0f1;
}
button:hover, button:focus {
    background-color: #005bb5;
    outline: 4px solid #00bcd4;
}

button {
    transition: background-color 0.3s, transform 0.2s, outline 0.2s;
}
button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
button:active {
    transform: translateY(1px);
}



#score-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around; 
    padding: 20px;
}

#score-screen h1 {
    margin-bottom: 20px;
    flex-shrink: 0; 
}

.rankings-wrapper {
    display: flex;          
    flex-direction: row;   
    justify-content: space-around; 
    align-items: flex-start; 
    width: 100%;             
    max-width: 1700px;      
    padding: 20px 0;       
    flex-grow: 1;          
    overflow-y: auto;       
}

.ranking-section {
    display: flex;          
    flex-direction: column; 
    align-items: center;    
    flex: 1 1 30%;          
    max-width: 550px;       
    padding: 10px 15px;     
    box-sizing: border-box;
    margin-bottom: 0;       
}

.ranking-section h2 {
    color: #3498db;
    font-size: 2.2em;
    margin-bottom: 15px;
    text-align: center; 
}

.ranking-section .score-list-container {
    width: 100%;          
    max-width: none;       
    padding-left: 40px;    
    font-size: 1.6em;     
    margin-left: 0;        
    margin-right: 0;
}

#score-screen .button-container {
     margin-top: 20px; 
     flex-shrink: 0; 
}

