.iframe_fs_back{z-index:1999;}
.iframeoverlay{z-index:2000;}
.contentLoader{z-index:2001;}
.gameStrip_in{z-index:2002;}

@font-face {
font-family: 'Outfit';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(https://fonts.gstatic.com/s/outfit/v15/QGYyz_MVcBeNP4NjuGObqx1XmO1I4TC1C4E.ttf) format('truetype');
}
@font-face {
font-family: 'Outfit';
font-style: normal;
font-weight: 600;
font-display: swap;
src: url(https://fonts.gstatic.com/s/outfit/v15/QGYyz_MVcBeNP4NjuGObqx1XmO1I4e6yC4E.ttf) format('truetype');
}
@font-face {
font-family: 'Outfit';
font-style: normal;
font-weight: 800;
font-display: swap;
src: url(https://fonts.gstatic.com/s/outfit/v15/QGYyz_MVcBeNP4NjuGObqx1XmO1I4bCyC4E.ttf) format('truetype');
}
@font-face {
font-family: 'Outfit';
font-style: normal;
font-weight: 900;
font-display: swap;
src: url(https://fonts.gstatic.com/s/outfit/v15/QGYyz_MVcBeNP4NjuGObqx1XmO1I4ZmyC4E.ttf) format('truetype');
}


:root {
/* Grass Theme */
--bg-top: #cdeab0;
--bg-bottom: #97d242;
--board-frame: #b66d39;
/* Wooden border */
--board-bg-1: #f4d8a2;
/* Checked tan light */
--board-bg-2: #e6c687;
/* Checked tan dark */

/* Header Pills Theme */
--dark-green: #1a6f53;

--text-color: #ffffff;
--glow-color: rgba(255, 255, 255, 0.4);

/* Block Colors Matching Reference Image closely */
--block-red: #da3845;
--block-blue: #37c3f3;
--block-green: #5ec044;
--block-orange: #f29424;
--block-pink: #eb436a;

/* Extra logic placeholder colors */
--block-yellow: #f1c40f;
--block-purple: #9b59b6;
--block-cyan: #00cec9;
}

.bpofgame * {
box-sizing: border-box;
margin: 0;
padding: 0;
user-select: none;
-webkit-user-select: none;
}

.bpofgame {
background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
color: var(--text-color);
font-family: 'Outfit', sans-serif;
display: block;
justify-content: center;
align-items: center;
min-height: 100%;
overflow: hidden;
}

/* Optional: Add some little grass tufts natively via before/after if wanted down the road */

#game-container {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
max-width: 500px;
/*height: 100vh;*/
padding: 10px;
gap: 15px;
transform-origin:top center;
margin:0 auto;
/* compact */
}

/* HEADER UI */
.gamemnheader {
display: flex;
justify-content: space-between;
align-items: flex-start;
width: 100%;
padding: 10px;
z-index: 10;
}

.header-left {
display: flex;
flex-direction: column;
gap: 10px;
width: 30%;
z-index: 15;
}

.header-right {
display: flex;
justify-content: flex-end;
align-items: center;
width: 30%;
z-index: 15;
}

.header-center {
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 15px;
display: flex;
justify-content: center;
z-index: 10;
}

.pill {
background: var(--dark-green);
border-radius: 30px;
display: flex;
align-items: center;
padding: 5px 15px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.2);
position: relative;
}

.coin-pill {
padding: 2px 15px 2px 2px;
/* Space for the coin icon on left */
gap: 8px;
width: fit-content;
}

.coin-pill .icon {
background: #ffc107;
border-radius: 50%;
width: 28px;
height: 28px;
display: flex;
justify-content: center;
align-items: center;
font-size: 1.2rem;
font-weight: 900;
color: #e58e26;
box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.8), 0 2px 4px rgba(0, 0, 0, 0.3);
}

.score-pill {
padding: 5px 30px;
min-width: 100px;
justify-content: center;
}

#score {
font-size: 2.5rem;
font-weight: 900;
color: #ffda33;
/* bright yellow */
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 1px 1px 0px #d35400;
}

#coins {
font-size: 1.4rem;
font-weight: 800;
color: white;
}

#combo-badge {
position: absolute;
top: -10px;
right: -15px;
background: #104230;
/* darker green base */
border: 2px solid #82cc4a;
color: #ffda33;
border-radius: 50%;
width: 35px;
height: 35px;
display: flex;
justify-content: center;
align-items: center;
font-weight: 800;
font-size: 1rem;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
z-index: 5;
transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#combo-badge.hidden {
transform: scale(0);
}



/* Combo Visuals Overlay */
#combo-container {
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -50%);
pointer-events: none;
z-index: 500;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}

.combo-text {
font-size: 3rem;
font-weight: 900;
color: #ffd32a;
text-transform: uppercase;
text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8), 2px 2px 0px #ff3f34;
animation: floatUpAndFade 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
position: absolute;
white-space: nowrap;
}

@keyframes floatUpAndFade {
0% {
transform: scale(0.5) translateY(20px);
opacity: 0;
}

20% {
transform: scale(1.2) translateY(0);
opacity: 1;
}

80% {
transform: scale(1) translateY(-30px);
opacity: 1;
}

100% {
transform: scale(0.8) translateY(-50px);
opacity: 0;
}
}

/* MAIN BOARD */
#board-frame {
background-color: var(--board-frame);
padding: 12px;
border-radius: 12px;
box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.4), 0 10px 20px rgba(0, 0, 0, 0.2);
}

#grid-container {
display: grid;
grid-template-columns: repeat(9, 1fr);
grid-template-rows: repeat(9, 1fr);
gap: 0px;
/* Removes gaps entirely for solid block connections */
width: 90vw;
max-width: 400px;
height: 90vw;
max-height: 400px;
background-color: var(--board-bg-1);
border-radius: 4px;
/* inner edge */
overflow: hidden;
position: relative;
}

.cell {
/* Background colors handled in JS inline or via light/dark classes for checkerboard */
transition: transform 0.1s ease;
}

.cell.dark {
background-color: var(--board-bg-2);
}

.cell.light {
background-color: var(--board-bg-1);
}

.cell.filled {
box-shadow: inset 0 5px 0 rgba(255, 255, 255, 0.3), inset 0 -5px 0 rgba(0, 0, 0, 0.2);
border-radius: 6px;
transform: scale(0.96);
z-index: 2;
}

.cell.highlight {
box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.4), inset 0 0 20px rgba(0, 0, 0, 0.1);
transform: scale(0.96);
background-color: rgba(255, 255, 255, 0.3);
/* faint overlay */
z-index: 1;
}

/* Grid behaviors */
#grid-container.bomb-mode {
cursor: crosshair;
}

#grid-container.bomb-mode .cell:hover {
box-shadow: inset 0 0 0 4px rgba(255, 0, 0, 0.5), 0 0 10px var(--block-red);
}

/* FOOTER & TRAYS */
#tray-frame {
background-color: var(--board-frame);
padding: 10px;
border-radius: 16px;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
width: 85vw;
max-width: 380px;
margin: 0 auto;
}

#blocks-container {
display: flex;
justify-content: space-around;
align-items: center;
width: 100%;
height: 100px;
background-color: #fce4b3;
/* very light tan */
border-radius: 8px;
box-shadow: inset 0 4px 6px rgba(0, 0, 0, 0.1);
}

.block-option {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100px;
height: 100px;
position: relative;
cursor: grab;
transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.block-option:active {
cursor: grabbing;
}

.block-option.dragging {
opacity: 0;
}

/* Individual small cubes that make up a block in the tray */
.block-cube {
width: 20px;
height: 20px;
border-radius: 4px;
position: absolute;
box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.3), inset 0 -4px 0 rgba(0, 0, 0, 0.2);
}

/* Drag Layer Overlay */
#drag-layer {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
pointer-events: none;
z-index: 1000;
}

.drag-clone {
position: absolute;
transform: translate(-50%, -150%);
pointer-events: none;
transition: transform 0.05s linear;
}

.drag-clone .block-cube {
width: 40px;
/* Larger when dragging to match board roughly */
height: 40px;
border-radius: 6px;
box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.4), inset 0 -6px 0 rgba(0, 0, 0, 0.2), 0 10px 20px rgba(0, 0, 0, 0.5);
}


/* HEAT/POWERUPS TOP RIGHT */
#powerups-container {
display: flex;
justify-content: flex-end;
gap: 8px;
/* tighter spacing for header */
}

.powerup-btn {
border: none;
color: white;
width: 42px;
/* much smaller */
height: 42px;
border-radius: 50%;
font-weight: 600;
cursor: pointer;
transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 -2px 0 rgba(0, 0, 0, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.4);
display: flex;
justify-content: center;
align-items: center;
font-size: 1.2rem;
position: relative;
border: 2px solid rgba(255, 255, 255, 0.6);
}

.powerup-btn .icon {
pointer-events: none;
}

/* Unique button gradients */
#btn-shuffle {
background: linear-gradient(135deg, #8c7ae6, #6c5ce7);
}

#btn-fall {
background: linear-gradient(135deg, #ff7675, #d63031);
}

#btn-bomb {
background: linear-gradient(135deg, #74b9ff, #0984e3);
}

.cost-badge {
position: absolute;
top: -8px;
right: -8px;
background-color: var(--block-red);
border: 1px solid white;
border-radius: 10px;
font-size: 0.6rem;
font-weight: 900;
padding: 1px 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
z-index: 2;
}

.powerup-btn:hover:not(:disabled) {
transform: translateY(-2px) scale(1.05);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.powerup-btn:active:not(:disabled) {
transform: translateY(1px) scale(0.95);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.powerup-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
filter: grayscale(100%);
box-shadow: none;
transform: none;
}

.powerup-btn.active {
box-shadow: 0 0 20px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(0, 0, 0, 0.5);
transform: scale(0.95);
filter: brightness(0.8);
}


/* Game Over */
#game-over-screen {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.7);
backdrop-filter: blur(5px);
display: flex;
justify-content: center;
align-items: center;
z-index: 2000;
transition: opacity 0.3s ease;
}

#game-over-screen.hidden {
opacity: 0;
pointer-events: none;
}

.game-over-modal {
background: #ffeecc;
padding: 40px;
border-radius: 20px;
text-align: center;
border: 6px solid var(--board-frame);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
transform: scale(1);
transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
color: #4a3b2c;
}

#game-over-screen.hidden .game-over-modal {
transform: scale(0.8);
}

.game-over-modal h2 {
font-size: 2.5rem;
color: var(--block-red);
margin-bottom: 10px;
}

.game-over-modal p {
font-size: 1.5rem;
margin-bottom: 30px;
}

#restart-btn {
background: linear-gradient(135deg, #1dd1a1, #10ac84);
color: white;
border: 3px solid white;
padding: 15px 40px;
font-size: 1.5rem;
font-weight: 900;
font-family: inherit;
border-radius: 30px;
cursor: pointer;
transition: all 0.2s;
box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

#restart-btn:hover {
transform: translateY(-2px);
filter: brightness(1.1);
}

#restart-btn:active {
transform: translateY(2px);
}

/* Animations for clearing lines */
@keyframes pop {
0% {
transform: scale(0.96);
opacity: 1;
}

50% {
transform: scale(1.1);
opacity: 1;
}

100% {
transform: scale(0);
opacity: 0;
}
}

.cell.clearing {
animation: pop 0.3s ease forwards;
z-index: 10;
}

/* Coin Float Animations */
#coin-fx-container {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
pointer-events: none;
z-index: 1500;
overflow: hidden;
}

.coin-float {
position: absolute;
font-size: 1.5rem;
font-weight: 900;
color: #f1c40f;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 1px 1px 0px #d35400;
pointer-events: none;
animation: floatCoinUp 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes floatCoinUp {
0% {
transform: scale(0.5) translateY(0);
opacity: 0;
}

20% {
transform: scale(1.2) translateY(-20px);
opacity: 1;
}

80% {
transform: scale(1) translateY(-60px);
opacity: 1;
}

100% {
transform: scale(0.8) translateY(-80px);
opacity: 0;
}
}
/* Mobile Performance Fixes */
.bpofgame {
touch-action: none !important;
user-select: none !important;
-webkit-user-select: none !important;
overscroll-behavior: none !important;
}
* {
-webkit-tap-highlight-color: transparent !important;
}
canvas, .game-container {
transform: translateZ(0);
}

.pill.coin-pill{margin-top:-10px;}
.dBestScore_in{display:inline-block;background:#1a6f53;padding:3px 10px;border-radius:20px;margin:-3px 0 0;font-size:18px;font-weight:bold;text-transform:uppercase;}