/* General Reset & Layout */
body {
    margin: 0;
    font-family: 'Quicksand', sans-serif;
    background: linear-gradient(to top, #fff1f2, #d0f0ff);
    overflow-x: hidden;
}

/* Player Mode Screen */
#btb-player-mode-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: radial-gradient(circle at center, #f3faff, #d4ecff);
    padding: 2rem;
    text-align: center;
    animation: fadeIn 0.8s ease-in-out;
	border-radius: 24px;
    border: 0.5px solid #74c2ff;
    box-shadow: 0 8px 16px rgba(0, 61, 102, 0.1);
}

#btb-player-mode-screen h2 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    color: #336699;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.btb-player-mode-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.btb-player-mode-options button {
    background: linear-gradient(145deg, #aee6ff, #74c2ff);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: 12px;
    color: #003d66;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 61, 102, 0.2);
	margin-bottom: 40px;
}

.btb-player-mode-options button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 61, 102, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Multiplayer Room Creation */
#btb-multiplayer-room-screen {
	background: #f0faff;
	border-radius: 24px;
	padding: 2rem;
	text-align: center;
	box-shadow: 0 0 12px rgba(0,0,0,0.1);
	max-width: 500px;
	margin: 3rem auto;
	border: 3px solid #6dc2ff;
}

#btb-multiplayer-room-screen h2 {
	font-size: 2rem;
	margin-bottom: 1rem;
	color: #0077cc;
}

.btb-info-text {
	font-size: 1.1rem;
	color: #444;
	margin-bottom: 2rem;
	line-height: 1.6;
}

.btb-create-room-wrapper {
	margin-top: 2rem;
}

#btb-create-room-button {
	background: #0077cc;
	color: white;
	font-size: 1.2rem;
	border: none;
	border-radius: 8px;
	padding: 0.75rem 1.5rem;
	cursor: pointer;
	transition: background 0.3s;
}

#btb-create-room-button:hover {
	background: #005fa3;
}

/* Multiplayer Mode Instructions */
#btb-multiplayer-instructions-screen {
	background: #fff4f9;
	border-radius: 24px;
	padding: 2rem;
	text-align: center;
	max-width: 500px;
	margin: 3rem auto;
	border: 3px solid #ff9ccc;
	box-shadow: 0 0 12px rgba(0,0,0,0.08);
}

#btb-multiplayer-instructions-screen h2 {
	font-size: 2rem;
	color: #d63384;
	margin-bottom: 1.2rem;
}

.btb-mp-instructions p {
	font-size: 1.1rem;
	color: #333;
	margin: 0.8rem 0;
}

.btb-mp-controls {
	margin-top: 2rem;
}

#btb-host-start-game {
	background: #d63384;
	color: white;
	border: none;
	font-size: 1.2rem;
	padding: 0.8rem 2rem;
	border-radius: 10px;
	cursor: pointer;
	transition: background 0.3s;
	animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 119, 204, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 10px 15px rgba(0, 119, 204, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 119, 204, 0); }
}

#btb-host-start-game:hover {
	background: #aa296a;
}

/* Room Creation & Waiting Room */
#btb-room-created-screen,
#btb-waiting-room-screen,
#btb-multiplayer-name-screen {
    max-width: 500px;
    margin: 50px auto;
    padding: 30px;
    background: radial-gradient(circle at center, #ffffff 0%, #f0f8ff 100%);
    border: 4px solid #87cefa;
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    animation: fadeInUp 0.6s ease;
}

#btb-room-created-screen h2,
#btb-waiting-room-screen h2 {
    font-size: 1.8rem;
    color: #0077cc;
    margin-bottom: 20px;
}

#btb-room-created-screen button,
#btb-waiting-room-screen button,
#btb-submit-player-name {
    background-color: #0077cc;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    margin: 5px;
    transition: background-color 0.3s ease;
	margin: auto;
}

#btb-room-created-screen button:hover,
#btb-waiting-room-screen button:hover {
    background-color: #005fa3;
}

#btb-room-url {
    border: 2px solid #ccc;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
}

/* Player list */
#btb-player-list {
    margin-top: 20px;
    text-align: left;
    padding: 10px;
    background-color: #f5faff;
    border: 2px dashed #87cefa;
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
}

#btb-player-list ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

#btb-player-list li {
    padding: 6px 0;
    font-size: 1rem;
    border-bottom: 1px solid #e0f0ff;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enter Your Name - Multiplayer */
#btb-mp-player-name {
    padding: 10px;
    font-size: 16px;
    width: 80%;
    margin-bottom: 10px;
}

/* Next Screens */
#btb-game, #btb-start-screen, #btb-end-screen {
    padding: 1rem;
    max-width: 900px;
    margin: auto;
    text-align: center;
	transition: all 0.5s ease;
}

/* Start Screen */
#btb-start-screen, #btb-name-screen {
  padding-top: 2rem;
  max-width: 550px;
  margin: 40px auto;
  padding: 24px;
  border: 1px solid #87CEEB;
  border-radius: 24px;
  background: #f0fbff;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

#btb-start-screen input {
    padding: 0.7rem;
    width: 80%;
    max-width: 300px;
    margin: 1rem auto;
    border: 2px solid #bae6fd;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.btb-instructions {
    text-align: left;
    max-width: 500px;
    margin: 1rem auto;
    background: #e0f7ff;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: 0 0 10px #c4eaff;
}

.btb-instructions ul {
    padding-left: 1.5rem;
}

#btb-start-button, #btb-proceed-button {
    padding: 0.8rem 1.5rem;
    font-size: 1.2rem;
    background: #38bdf8;
    color: white;
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    margin-top: 1rem;
    animation: bounce 1.5s infinite;
	display: block;
    margin: 20px auto 0 auto; /* top: 20px, horizontal: auto, bottom: 0 */
    text-align: center;
}

/* Textbox for entering player name */
#btb-player-name {
  width: 80%;
  padding: 12px 16px;
  font-size: 1rem;
  border-radius: 12px;
  border: 2px solid #add8e6;
  margin: 16px 0;
  outline: none;
  text-align: center;
  transition: border-color 0.3s;
}
#btb-player-name:focus {
  border-color: #00bfff;
}

#btb-start-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(30, 144, 255, 0.5);
}

/* Radio Buttons for Game Mode - Easy, Medium, etc */
.btb-mode-select {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.btb-mode-select input[type="radio"] {
    display: none;
}

/* STYLE EACH MODE AS A BUTTON */
.btb-mode-select label {
    background-color: #e0f7fa;
    color: #00796b;
    font-weight: bold;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-size: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    user-select: none;
}

.btb-mode-select label:hover {
    background-color: #b2ebf2;
}

.btb-mode-select input[type="radio"]:checked + label {
    background-color: #00796b;
    color: #ffffff;
    border-color: #004d40;
    box-shadow: 0 0 10px rgba(0, 121, 107, 0.4);
	transform: scale(1.05);
}

/* Header */
#btb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    font-size: 1rem;
    gap: 1rem;
}

#btb-timer, #btb-score {
    font-weight: bold;
}

/* Bingo Grid */
#btb-bingo-board {
    margin: 1rem auto;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    max-width: 100%;
}

#btb-bingo-board div {
    background: #fff;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 0 10px #bae6fd;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    transition: 0.3s;
    cursor: pointer;
    user-select: none;
}

#btb-bingo-board div.marked {
    background: #bbf7d0;
    text-decoration: line-through;
    transform: scale(1.05);
}

/* Bubble Bath Area */
#btb-bath-area {
    height: 30vh;
    position: relative;
    overflow: hidden;
    background: linear-gradient(to top, #d0f0ff 40%, transparent);
    margin-top: 2rem;
    border-radius: 1rem;
    box-shadow: inset 0 5px 10px rgba(0,0,0,0.1);
}

.freeze-bubbles .bubble {
    animation: none !important;
    transform: none !important;
}

#btb-bubble-container .bubble {
    position: absolute;
    bottom: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    padding: 1rem;
    font-size: 1.2rem;
    animation: floatUp 7s linear forwards;
    pointer-events: none;
	min-width: 40px;
    text-align: center;
    white-space: nowrap;
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-100vh) scale(1.2); opacity: 0; }
}

/* End Screen */
#btb-end-screen {
    margin-top: 2rem;
    padding: 2rem;
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 0 20px #c4f1f9;
    display: none;
}

#btb-end-screen.show {
    display: block;
    animation: fadeIn 0.6s ease;
}

#btb-gender-reveal h3 {
    font-size: 2.5rem !important;
    animation: sparkleText 2.5s ease-in-out infinite;
    font-weight: bold;
    color: #ff69b4;
    text-shadow: 0 0 15px rgba(255, 105, 180, 0.7);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Shake Effect */
.shake {
  animation: shake 0.3s;
}
@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}

/* Highlight The Completed Row */
.bingo-row-won {
  background-color: #ffe066 !important;
  animation: glow 1s ease-in-out infinite alternate;
  border: 2px solid #ffbf00;
  z-index: 10;
  position: relative;
}

@keyframes glow {
  from {
    box-shadow: 0 0 5px #ffdd57;
  }
  to {
    box-shadow: 0 0 15px #ffbf00, 0 0 20px #fff38a;
  }
}

/* Prevent Accidental Clicks After Winning the Game */
#btb-bingo-board.game-disabled {
    pointer-events: none;
    opacity: 0.6;
}

/* End Message */
#btb-end-message {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

/* Final Score Box */
#btb-final-score {
    font-size: 1.5rem;
    font-weight: bold;
    color: #0c4a6e;
    margin-bottom: 1.5rem;
}

/* Gender Reveal Section */
#btb-gender-reveal {
    margin: 1.5rem 0;
}

/* Reveal Play Again Button */
#btb-end-screen button {
    background-color: #38bdf8;
    color: white;
    border: none;
    border-radius: 1.5rem;
    padding: 0.8rem 2rem;
    font-size: 1.2rem;
    margin-top: 1rem;
    cursor: pointer;
    box-shadow: 0 5px 10px rgba(56, 189, 248, 0.3);
    transition: background 0.3s ease;
}

#btb-end-screen button:hover {
    background-color: #0ea5e9;
}

/* Share Section */
.btb-share {
    margin-top: 2rem;
}

.btb-share p {
    font-size: 1.1rem;
    font-weight: bold;
    color: #334155;
    margin-bottom: 0.5rem;
}

/* Animations */
.btb-animate-bounce {
    animation: bounce 1.5s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.btb-animate-pop {
    animation: pop 0.5s ease-out;
}

@keyframes pop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes sparkleText {
    0%, 100% { color: #ff70a6; text-shadow: 0 0 10px #ff70a6; }
    50% { color: #ffa8c5; text-shadow: 0 0 15px #ffa8c5; }
}

/* "Try Again" shimmer effect */
#btb-end-message.try-again {
    font-size: 2rem !important;
    background: linear-gradient(90deg, #ff9a9e, #fad0c4, #ff9a9e);
    background-size: 200%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: shimmer 3s infinite linear;
}

@keyframes shimmer {
    0% { background-position: -100% 0; }
    100% { background-position: 100% 0; }
}

/* Share Icons */
.btb-share {
    text-align: center;
    margin-top: 20px;
	padding: 10px;
}

.btb-share p {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.btb-share-icon {
    font-size: 1rem;
    padding: 10px 20px;
    margin: 0 8px;
    border-radius: 25px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease, background-color 0.3s ease;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
	white-space: nowrap;
}

.btb-share-icon[data-type="whatsapp"] {
    background-color: #25D366;
}

.btb-share-icon[data-type="twitter"] {
    background-color: #1DA1F2;
}

.btb-share-icon[data-type="facebook"] {
    background-color: #3b5998;
}

.btb-share-icon:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

/* Optional: hide .btb-share if gender not revealed */
.btb-share.hidden {
    display: none !important;
}

/* Countdown CSS */
#btb-reveal-countdown {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  
  width: 100%;
  background: radial-gradient(#fdf6ff, #ffd6ec);
  z-index: 99999;
  position: relative;
  top: 0; left: 0;
  right: 0; bottom: 0;
  font-family: 'Comic Sans MS', cursive;
  z-index: 1000;
}

#btb-reveal-countdown.hidden {
  display: none !important;
}

.btb-countdown-heading {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #ff69b4;
  font-weight: bold;
}

.btb-countdown-text {
  font-size: 100px;
  font-weight: 900;
  color: #ff69b4;
  animation: popScale 1s ease-in-out infinite;
  text-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

@keyframes popScale {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Responsive Layouts */
@media screen and (max-width: 600px) {
    #btb-bingo-board {
        grid-template-columns: repeat(5, 1fr);
    }

    #btb-bingo-board div {
        padding: 0.5rem;
    	font-size: clamp(0.9rem, 1vw, 1rem);
    }

    #btb-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    #btb-start-screen input {
        width: 90%;
    }
    .btb-share-icon {
        display: inline-block;
        margin: 8px 6px;
    }
	 .btb-player-mode-options button {
        width: 100%;
        max-width: 250px;
    }
}

@media screen and (min-width: 601px) and (max-width: 900px) {
    #btb-bingo-board {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 350px) {
  .btb-bingo-cell {
    padding: 8px;
    font-size: 1rem;
  }
}