.mothergameholder * {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.mothergameholder{
background-color: #1f1f2a;
background-image:
radial-gradient(circle at 50% 10%, rgba(45, 45, 60, 1) 0%, rgba(25, 25, 35, 1) 80%);
color: white;
touch-action: none;
user-select: none;
-webkit-user-select: none;
-webkit-tap-highlight-color: transparent;
}

/* Star background */
#stars-container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 0;
pointer-events: none;
background-image:
radial-gradient(1px 1px at 10% 20%, white 100%, transparent),
radial-gradient(2px 2px at 30% 50%, rgba(255, 255, 255, 0.8) 100%, transparent),
radial-gradient(1.5px 1.5px at 80% 10%, rgba(255, 255, 255, 0.6) 100%, transparent),
radial-gradient(2px 2px at 60% 80%, rgba(255, 255, 255, 0.5) 100%, transparent),
radial-gradient(1px 1px at 90% 90%, white 100%, transparent);
background-size: 200px 200px;
opacity: 0.6;
}

#game-container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
display: flex;
justify-content: center;
align-items: center;
padding:75px 10px 100px;
overflow: hidden;
}

.level-grid {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: flex-end;
gap: 15px;
width: 100%;
/*max-width: 800px;*/
/*max-height: 100%;*/
}

/* --- Tube Styles --- */
.tube-wrapper {
position: relative;
width: 58px;
height: 210px;
cursor: pointer;
transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
transform-origin: bottom center;
flex-shrink: 1;
}

.tube-wrapper.selected {
transform: translateY(-20px) scale(1.05);
}

/* The glass tube body */
.tube-glass {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
border: 3px solid rgba(255, 255, 255, 0.85);
border-top: none;
/* Adjusted top curve depth to 10px to better align with the rim */
border-radius: 29px 29px 29px 29px / 10px 10px 29px 29px;
background: rgba(255, 255, 255, 0.08);
box-shadow:
inset 6px 0 12px rgba(255, 255, 255, 0.5),
inset -6px 0 12px rgba(0, 0, 0, 0.2),
inset 0 -6px 12px rgba(255, 255, 255, 0.4),
0 10px 20px rgba(0, 0, 0, 0.4);
overflow: hidden;
display: flex;
flex-direction: column-reverse;
align-items: center;
padding: 12px 4px 6px 4px;
/* Slightly reduced top padding */
gap: 3px;
z-index: 1;
}

/* Glass sheen overlay */
.tube-glass::after {
content: '';
position: absolute;
top: 0;
left: 8px;
width: 10px;
height: 90%;
background: linear-gradient(to right, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 100%);
border-radius: 5px;
pointer-events: none;
z-index: 10;
}

/* Tube opening lip */
.tube-lip-base {
position: absolute;
top: -4px;
left: -2px;
width: calc(100% + 4px);
/* Tightened width from 12px to 4px overlap */
height: 18px;
/* Adjusted height to match the curve perspective */
border-radius: 50%;
background: transparent;
border: 3px solid rgba(255, 255, 255, 0.85);
box-sizing: border-box;
box-shadow:
0 4px 6px rgba(0, 0, 0, 0.3),
inset 0 2px 6px rgba(255, 255, 255, 0.8);
z-index: 5;
}

.tube-lip-back {
clip-path: polygon(-10% -10%, 110% -10%, 110% 50%, -10% 50%);
z-index: 2;
}

.tube-lip-front {
clip-path: polygon(-10% 50%, 110% 50%, 110% 120%, -10% 120%);
z-index: 4;
}

/* --- Ball Styles --- */
.ball {
width: 42px;
height: 42px;
border-radius: 50%;
flex-shrink: 0;
position: relative;
/* 3D glossy look */
box-shadow:
inset -5px -5px 10px rgba(0, 0, 0, 0.35),
inset 4px 4px 8px rgba(255, 255, 255, 0.55),
0 4px 8px rgba(0, 0, 0, 0.4);
transition: transform 0.15s ease;
}

/* Highlight specular on ball */
.ball::before {
content: '';
position: absolute;
top: 6px;
left: 8px;
width: 12px;
height: 8px;
background: rgba(255, 255, 255, 0.7);
border-radius: 50%;
transform: rotate(-35deg);
pointer-events: none;
}

/* Ball pop-in animation when it lands */
@keyframes ballBounce {
0% {
transform: scale(1.25);
}

40% {
transform: scale(0.9);
}

70% {
transform: scale(1.08);
}

100% {
transform: scale(1.0);
}
}

.ball.bounce {
animation: ballBounce 0.3s ease-out forwards;
}

/* Flying ball (used during move animation) */
.ball-flying {
position: fixed;
width: 42px;
height: 42px;
border-radius: 50%;
z-index: 500;
pointer-events: none;
box-shadow:
inset -5px -5px 10px rgba(0, 0, 0, 0.35),
inset 4px 4px 8px rgba(255, 255, 255, 0.55),
0 6px 16px rgba(0, 0, 0, 0.5);
transition: top 0.2s cubic-bezier(0.4, 0, 0.6, 1), left 0.2s ease, transform 0.2s ease;
}

.ball-flying::before {
content: '';
position: absolute;
top: 6px;
left: 8px;
width: 12px;
height: 8px;
background: rgba(255, 255, 255, 0.7);
border-radius: 50%;
transform: rotate(-35deg);
pointer-events: none;
}

/* --- All the UI stuff (unchanged from water-sort) --- */
#ui-layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 10;
pointer-events: none;
display: flex;
flex-direction: column;
justify-content: space-between;
padding:10px;
}

#ui-layer button,
.level-indicator,
.popup-screen {
pointer-events: auto;
}

#top-ui {
display: flex;
justify-content: space-between;
align-items: flex-start;
width: 100%;
}

#top-left-group {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 12px;
}

.level-indicator {
cursor:pointer;
color: white;
font-size: 26px;
font-weight: 900;
letter-spacing: 3px;
padding: 0 25px;
text-shadow: 0 4px 6px rgba(0, 0, 0, 0.6);
background: none;
box-shadow: none;
border: none;
}

.icon-btn {
width: 50px;
height: 50px;
background-color: #e74c3c;
border: none;
border-radius: 12px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
color: white;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
transition: transform 0.1s, box-shadow 0.1s, background-color 0.1s;
}

.icon-btn:hover {
background-color: #ff6b6b;
}

.icon-btn:active {
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
transform: translateY(2px);
}

#win-screen {
position: absolute;
top: 50%;
left: 0;
width: 100%;
transform: translateY(-50%);
background: linear-gradient(to right, rgba(52, 152, 219, 0), rgba(41, 128, 185, 0.95) 20%, rgba(41, 128, 185, 0.95) 80%, rgba(52, 152, 219, 0));
padding: 60px 0;
border: none;
box-shadow: 0 0 50px rgba(52, 152, 219, 0.3);
text-align: center;
color: white;
display: flex;
flex-direction: column;
align-items: center;
gap: 24px;
z-index: 1001;
}

#win-screen h2 {
font-size: 56px;
font-weight: 900;
color: white;
text-transform: uppercase;
letter-spacing: 6px;
-webkit-text-stroke: 2px #2c3e50;
text-shadow:
0 6px 0 #2c3e50,
0 12px 15px rgba(0, 0, 0, 0.5);
margin: 0;
}

.popup-screen#lose-screen {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: #2c3e50;
padding: 40px;
border-radius: 20px;
border: 3px solid #34495e;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
text-align: center;
color: white;
display: flex;
flex-direction: column;
align-items: center;
gap: 24px;
}

#btn-next-level,
#btn-retry {
padding: 16px 36px;
font-size: 20px;
background-color: #2ecc71;
color: white;
border: 3px solid #27ae60;
border-radius: 12px;
cursor: pointer;
font-weight: 800;
box-shadow: 0 5px 0 #27ae60, 0 8px 15px rgba(0, 0, 0, 0.2);
transition: transform 0.1s, box-shadow 0.1s;
}

#btn-next-level:hover,
#btn-retry:hover {
background-color: #2fd677;
}

#btn-next-level:active,
#btn-retry:active {
box-shadow: 0 0 0 #27ae60, 0 2px 4px rgba(0, 0, 0, 0.2);
transform: translateY(5px);
}

.hidden {
display: none !important;
}

/* Tactile UI panels */
.tactile-panel {
background-color: #34495e;
border: none;
border-radius: 14px;
box-shadow: inset 0 -4px 6px rgba(0, 0, 0, 0.2), 0 4px 6px rgba(0, 0, 0, 0.15);
color: white;
height: 48px;
display: flex;
align-items: center;
justify-content: center;
}

/* Coin UI */
.coin-container {
display: flex;
align-items: center;
gap: 8px;
padding: 0 16px;
font-size: 22px;
font-weight: 800;
}

.coin-svg {
filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}

.coin-svg-small {
filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

/* Powerups UI */
#powerups-container {
display: flex;
justify-content: center;
gap: 20px;
width: 100%;
pointer-events: auto;
}

.tactile-btn {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 76px;
height: 76px;
background-color: #ecf0f1;
border: 3px solid #bdc3c7;
border-radius: 16px;
box-shadow: 0 6px 0 #bdc3c7, 0 10px 15px rgba(0, 0, 0, 0.3);
color: #2c3e50;
cursor: pointer;
transition: transform 0.1s, box-shadow 0.1s;
}

.tactile-btn:hover {
background-color: #ffffff;
}

.tactile-btn:active {
box-shadow: 0 0 0 #bdc3c7, 0 4px 6px rgba(0, 0, 0, 0.3);
transform: translateY(6px);
}

.tactile-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
filter: grayscale(100%);
box-shadow: 0 6px 0 #bdc3c7, 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tactile-btn:disabled:active {
transform: none;
box-shadow: 0 6px 0 #bdc3c7, 0 4px 6px rgba(0, 0, 0, 0.1);
}

.powerup-icon {
display: flex;
margin-bottom: 2px;
color: #3498db;
}

.powerup-cost {
font-size: 15px;
font-weight: 800;
display: flex;
align-items: center;
gap: 4px;
}

.coin-particle {
position: absolute;
pointer-events: none;
z-index: 1000;
transition: transform 1s cubic-bezier(0.25, 1, 0.5, 1), opacity 1s ease-out;
}

.win-particle {
position: absolute;
pointer-events: none;
z-index: 1002;
width: 10px;
height: 10px;
border-radius: 2px;
animation: celebrate 2s ease-out forwards;
}

@keyframes celebrate {
0% {
transform: translate(0, 0) scale(0) rotate(0);
opacity: 1;
}

100% {
transform: translate(var(--dx), var(--dy)) scale(1.5) rotate(var(--rot));
opacity: 0;
}
}

/* Combo Popup Styles */
#combo-popup-layer {
position: absolute;
top: 15%;
left: 0;
width: 100%;
z-index: 999;
pointer-events: none;
display: flex;
flex-direction: column;
align-items: center;
gap: 15px;
}

.combo-popup {
background: linear-gradient(to right, rgba(52, 152, 219, 0), rgba(41, 128, 185, 0.3) 20%, rgba(41, 128, 185, 0.3) 80%, rgba(52, 152, 219, 0));
padding: 8px 40px;
display: flex;
justify-content: center;
align-items: center;
animation: slideInOut 2s forwards;
width: 100%;
}

.combo-popup-text {
font-size: 32px;
font-weight: 900;
color: white;
text-transform: uppercase;
letter-spacing: 4px;
-webkit-text-stroke: 1.5px #2c3e50;
text-shadow:
0 3px 0 #2c3e50,
0 6px 8px rgba(0, 0, 0, 0.4);
white-space: nowrap;
}

@keyframes slideInOut {
0% {
transform: translateX(100%);
opacity: 0;
}

15% {
transform: translateX(0);
opacity: 1;
}

85% {
transform: translateX(0);
opacity: 1;
}

100% {
transform: translateX(-100%);
opacity: 0;
}
}

/* Confetti */
.confetti-particle {
position: absolute;
width: 12px;
height: 24px;
z-index: 900;
pointer-events: none;
animation: fall cubic-bezier(0.3, 0.5, 0.8, 1) forwards;
}

@keyframes fall {
0% {
transform: translateY(0) rotate(0deg);
opacity: 1;
}

100% {
transform: translateY(600px) rotate(720deg);
opacity: 0;
}
}

@media (max-width: 500px) {
/*#ui-layer {
padding: 15px 15px 40px 15px;
}*/

#top-ui {
flex-wrap: nowrap;
gap: 10px;
justify-content: space-between;
align-items: flex-start;
}

.level-indicator {
font-size: 18px;
padding: 0 10px;
}

.coin-container {
font-size: 18px;
padding: 0 12px;
}

.icon-btn {
width: 44px;
height: 44px;
}

.tactile-panel {
height: 44px;
}

.coin-svg {
width: 20px;
height: 20px;
}

#powerups-container {
gap: 12px;
}

.tactile-btn {
width: 65px;
height: 65px;
}

.popup-screen {
width: 90%;
padding: 24px;
}

.popup-screen h2 {
font-size: 28px;
}

.tube-wrapper {
width: 48px;
height: 180px;
}

.tube-glass {
width: 44px;
}

.ball,
.ball-flying {
width: 36px;
height: 36px;
}
}
/* Mobile Performance Fixes */
.mothergameholder{
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);
}







/* Modal Container overlay background */
.ol_modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(15, 15, 22, 0.85);
backdrop-filter: blur(4px);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}

.ol_modal-overlay.ol_hidden {
display: none !important;
}

/* Modal Content Card */
.ol_modal-content {
background: #2d2d3c;
width: 90%;
max-width: 480px;
height: 75%;
border-radius: 16px;
display: flex;
flex-direction: column;
padding: 20px;
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.ol_modal-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
padding-bottom: 10px;
}

.ol_modal-header h2 {
font-size: 22px;
color: #fff;
}

.ol_close-btn {
font-size: 30px;
cursor: pointer;
color: #a29bfe;
transition: color 0.2s;
line-height: 1;
}

.ol_close-btn:hover {
color: #ff4757;
}

/* Scrollable Level Grid */
.ol_level-grid {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 12px;
overflow-y: auto;
padding-right: 5px;
flex-grow: 1;
}

/* Level Selection Item Buttons */
.level-btn {
background: #2a82ff;
color: #fff;
border: none;
padding: 12px 0;
font-size: 15px;
font-weight: bold;
border-radius: 8px;
cursor: pointer;
text-align: center;
transition: all 0.2s ease;
}

.level-btn:hover:not(:disabled) {
background: #4ea2ff;
transform: translateY(-2px);
}

/* Disabled/Locked Level Style */
.level-btn:disabled {
background: #1f1f2a;
color: #555566;
cursor: not-allowed;
border: 1px dashed rgba(255, 255, 255, 0.05);
opacity: 0.6;
}

/* Active Highlight Style */
.level-btn.active-level {
background: #2ed573 !important;
box-shadow: 0 0 10px rgba(46, 213, 115, 0.4);
}

.ol_level-btn{font-weight:bold;}

.iframe_fs_back{z-index:1999;top:auto;bottom:35px;}
.iframeoverlay{z-index:2000;}
.contentLoader{z-index:2001;}
.gameStrip_in{z-index:2002;}