@font-face {
    font-family: 'Genty Sans'; 
    src: url('GentySans.ttf') format('truetype');
    font-display: swap;
}

body {
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: #32b1cd;
    margin: 0;
    padding: 0;
    position: absolute;
}

.container {
    transform-origin: center;
    transform: scale(.95); 
    width: 2000px; 
    height: 1200px;
    position: absolute;
    overflow: hidden;
    left: -450px;
    top: -50px;
}

.rack {
    position: absolute;
    width: 685px;
    height: 85px;
    background-color: #ddd;
    border-radius: 8px;
    display: flex;
    justify-content: space-around;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

#player1-rack {
    top: 805px; 
    left: 500px; 
    background-color: #1b6a7c; 
    align-content: center;
}

#player2-rack {
    top: 45px; 
    left: 500px;
    background-color: #1b6a7c; 
    align-content: center;
}

#scrabble-board {
    width: 675px;
    height: 675px; 
    border: 5px solid #1b6a7c;
    background-color: #fff4d5;
    margin-bottom: 20px;
    position: absolute;
    top: 125px;
    left: 500px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.grid-container {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(15, 50px);
    grid-template-rows: repeat(15, 50px);
    z-index: 1;
}

.player2-tile {
    background-color: #d9166c;
    color: #ffd783 !important; 
}
.tile {
    position: relative;
    width: 60px;
    height: 60px;
    border: 3px solid #fff8eb;
    font-family: 'Genty Sans', serif;
    color: #d9166c;
    font-size: 55px;
    line-height: 60px;
    text-align: center;
    margin: 10px 0px 0px 0px;
    cursor: pointer;
    z-index: 3;
    transition: transform 0.3s ease;         
    justify-content: center;   
    align-items: center;      
}

.tile:nth-child(odd) {
    background-color: #ffd783;
}

.tile:nth-child(even) {
    background-color: #f9bb4a; 
}

.player2-tile:nth-child(odd) {
    background-color: #e4488c;
}

.player2-tile:nth-child(even) {
    background-color: #d9166c;
}

#shuffle-tiles:hover {
    background-color: #d9166c;  
    border-color: #fff;     
    transform: scale(1.05);      
}

#shuffle-tiles:focus {
    box-shadow: 0 0 0 4px rgba(217, 22, 108, 0.5); 
}

#submit-word:hover  {
    background-color: #d9166c;  
    border-color: #fff;     
    transform: scale(1.05);      
}

#submit-word:focus  {
    box-shadow: 0 0 0 4px rgba(217, 22, 108, 0.5); 
}

#swap-tiles:hover  {
    background-color: #d9166c;  
    border-color: #fff;     
    transform: scale(1.05);      
}

#swap-tiles:focus  {
    box-shadow: 0 0 0 4px rgba(217, 22, 108, 0.5); 
}

#submit-word {
    z-index: 3;
    top: 700px;
    left: 1225px;
    position: absolute;
    padding: 15px 40px; 
    font-size: 22px;
    cursor: pointer;
    background-color: #f9bb4a;
    border: 3px solid #d9166c;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    outline: none;
    display: inline-block; 
    text-align: center;  
    line-height: 22px;  
}

#shuffle-tiles {
    z-index: 3;
    position: absolute;
    top: 780px;
    left: 1230px;
    padding: 10px 20px; 
    background: none;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
    background-color: #f9bb4a;
    border: 3px solid #d9166c;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#shuffle-tiles .icon-image {
    width: 40px; 
    height: 40px;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease; 
}

#shuffle-tiles:hover .icon-image {
    content: url('img/shuffleWhite.png'); 
}

#swap-tiles {
    z-index: 3;
    top: 780px;
    left: 1350px;
    position: absolute;
    height: 65px;
    width: 120px;
    font-size: 22px;
    cursor: pointer;
    background-color: #f9bb4a;
    border: 3px solid #d9166c;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    outline: none;
    display: inline-block; 
    text-align: center;  
    line-height: 22px;  
}

.child.ui-draggable-dragging {
    transform: scale(0.5);
    z-index: 1000;
}

.grid-cell {
    width: 50px; 
    height: 50px; 
    border: 2px solid #e2cbad;
    background-color: #fff4d5;
    box-sizing: border-box;
    position: relative; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}

.tile .letter-value {
    position: absolute; 
    bottom: -20px;
    right: 5px;
    font-family: "Genty Sans";
    font-size: 14px;
    font-weight: bold;
    z-index: 3; 
}

.grid-cell .tile {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    width: 38px;
    height: 38px;
    position: absolute;
}

.grid-cell .letter-value {
    display: flex;
    font-size: 10px;
    position: absolute;
    top: 0px;
    left: 30px;
}

#word-result {
    margin: 0px 0px;
    padding: 15px 0px 5px 5px;
    background-color: #fff4d5;
    border: 2px solid #1b6a7c;
    border-radius: 5px;
    font-size: 16px;
    color: #137e25;
    text-align: center;
    font-weight: bold;
}

#word-result.invalid {
    color: red;
}

#score-display {
    margin: 20px 10;
    padding: 10px;
    background-color: #fff4d5;
    border: 2px solid #1b6a7c;
    border-radius: 5px;
    font-size: 22px;
    color: #1b6a7c;
    text-align: center;
    font-weight: bold;
}

.blank-tile {
    background-color: #f0e68c; 
    font-weight: bold;
}

.blank-tile input {
    color: red; 
}

.bonus-2xws {
    background-color: #f4b0e9; 
}

.bonus-3xws {
    background-color: #f4bab0; 
}

.bonus-2xls {
    background-color: #c2f4b0; 
}

.bonus-3xls {
    background-color: #87cee9; 
}

.grid-cell {
    padding: 5px;
    box-sizing: border-box;
}

.bonus-star {
    background-color: #e9629c;;
    font-weight: bold;
    text-align: center;
    position: relative; 
    align-self: center;
}

.bonus-star::before {
    content: "★"; 
    position: absolute;
    top: 20px;
    left: 22px;
    transform: translate(-50%, -50%);
    font-size: 40px; 
    color: #f9bb4a;
    z-index: 1;
}

.side-box {
    position: absolute;
    top: 45px;
    left: 1200px;
    width: 250px;
    height: 600px;
    background-color: #dbfacf;
    border: 5px solid #1b6a7c;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.info-box {
    margin: 10px 0px;
    margin-top: 10px;
    padding: 10px;
    background-color: #fff4d5;
    border: 2px solid #1b6a7c;
    border-radius: 5px;
    font-size: 22px;
    color: #1b6a7c;
    text-align: center;
    font-weight: bold;
}

#remaining-tiles-display {
    display: flex;
    flex-wrap: wrap;
    margin-top: 20px;
}

.tile-count {
    margin: 5px;
    padding: 5px;
    border: 2px solid #1b6a7c;
    background-color: #fffef6;
    border-radius: 3px;
    font-size: 14px;
}

.locked {
    pointer-events: none; 
}

#overlay {
    position: absolute;
    top: 125px;
    left: 500px;
    width: 685px;
    height: 680px;
    background-color: rgba(46, 46, 46, 0.7);
    z-index: 1000;
    display: none; 
}

.overlay2 {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(46, 46, 46, 0.7);
    z-index: 1000;
    display: none; 
}

#overlay.active {
    display: block;
}

.tile.selected {
    border: 2px solid red;
    background-color: rgba(255, 0, 0, 0.3);
}

.bonus-label {
    font-family:Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #a7a7a7;
    opacity: 70%;
}

.inactive {
    opacity: 0.5;
    pointer-events: none; 
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    display: none;
}

.winner-modal {
    position: absolute;
    top: 250px;
    left: 550px;
    background-color: transparent;
    text-align: center;
    z-index: 9999;
    display: none;
}

.winner-modal h1 {
    font-size: 80px;
    margin: 0px -200px;
    margin-top: -400px;
    font-family: 'Genty Sans';
    color: #d9166c;
}

.winner-modal p {
    font-size: 40px;
    margin: 10px 0;
    font-family: 'Genty Sans';
    color: #ec5e54;
}

.win-image {
    width: 100%;
    max-width: 600px;
    height: auto;
}

.rematch-button {
    top: 250px;
    left: 200px;
    position: absolute;
    padding: 15px 40px; 
    font-size: 22px;
    cursor: pointer;
    background-color: #f9bb4a;
    border: 3px solid #d9166c;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    outline: none;
    display: inline-block; 
    text-align: center;  
    line-height: 22px;  
}

#instructions-tab {
    position: absolute;
    top: 45px;
    left: 1500px;
    width: 50px;
    height: 50px;
    background-color: #1b6a7c;
    border-radius: 5px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.instruction-page:first-of-type {
    display: block; 
}

.tab-icon {
    font-family: 'Genty Sans';
    font-size: 50px;
    font-weight: bold;
    color: #d9166c;
    pointer-events: none; 
    margin-top: 10px;
}

.tab-icon.collapsed-text {
    font-family: 'Genty Sans';
    font-size: 45px;
    font-weight: bold;
    color: #d9166c;
    pointer-events: none; 
    transition: all 0.3s ease; 
}

.tab-icon.expanded-text {
    font-size: 40px; 
    color: #f9bb4a; 
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.3s ease; 
}

#instructions-tab.open {
    width: 300px;
    height: 400px;
    background-color: #fdf4d6;
    border: 5px solid #1b6a7c;
    border-radius: 8px;
}

#tab-header.closed {
    width: 100%;
    height: 100%;
    background-color: #1b6a7c;
    position: relative;
}

#instructions-panel {
    display: none; 
    width: 100%;
    height: 100%;
    padding: 10px;
    overflow: auto;
}

#instructions-tab.open #instructions-panel {
    display: block; 
}

.instruction-page {
    text-align: left;
    font-family: Arial, sans-serif;
    color: #1b6a7c;
    margin-right: 20px;
    display: none;
}

#instructions-navigation {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-button {
    width: 40px; 
    height: 40px;
    cursor: pointer; 
    transition: transform 0.2s ease; 
}

.nav-button:hover {
    transform: scale(1.1); 
}

.nav-button.disabled {
    opacity: 0.5; 
    pointer-events: none; 
}

#pass-turn {
    margin: 0px 0px 50px 0px;
    padding: 10px 10px 10px 10px;
    background-color: #fff4d5;
    border: 2px solid #1b6a7c;
    border-radius: 5px;
    font-size: 16px;
    color:#ec5e54;
    text-align: center;
    font-weight: bold;
}

#forfeit-game {
    width: 100px; 
    margin: 0px 10px 0px 20px;
    padding: 10px 10px 10px 10px;
    background-color: #fff4d5;
    border: 2px solid #1b6a7c;
    border-radius: 5px;
    font-size: 16px;
    color: #ec5e54;
    text-align: center;
    font-weight: bold;
    box-sizing: border-box; 
}

.play-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: visible; 
}

.play-modal img.background-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80%;
    height: auto;
    z-index: 1;
}

#play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2;
    padding: 0;
}

#play-button img.play-button-image {
    width: 200px; 
    height: auto;
    transition: transform 0.2s ease;
}

#play-button:hover img.play-button-image {
    transform: scale(1.1); 
}

.hidden {
    display: none;
}
