.iframe_fs_back{z-index:1999;}
.iframeoverlay{z-index:2000;}
.contentLoader{z-index:2001;}
.gameStrip_in{z-index:2002;}
.mothergameholder{background:#2367a3;}

:root {
--bg-color: #f0f4f8;
--container-bg: #ffffff;
--text-primary: #334155;
--text-secondary: #64748b;
--grid-bg: #e2e8f0;
--cell-bg: #f8fafc;
--cell-border: transparent;
--primary-color: #3b82f6;
--primary-hover: #2563eb;
--accent-color: #f59e0b;
--success-color: #10b981;
--path-color: #60a5fa;
--path-width: 12px;
--cell-active-bg: #eff6ff;
--cell-clue-bg: #dbeafe;
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
--radius-md: 12px;
--radius-lg: 20px;
--radius-full: 9999px;
}

#game-container{
font-family: 'Nunito', sans-serif;
background-color: var(--bg-color);
color: var(--text-primary);
display: block;
justify-content: center;
align-items: center;
overflow: hidden;
transform-origin:top center;
margin:0 auto;
touch-action: none;
position:relative;
top:50%;
/*transform:translateY(-50%);*/
}

#game-container {
background-color: var(--container-bg);
padding: 24px;
border-radius: var(--radius-lg);
box-shadow: var(--shadow-lg);
width: 100%;
max-width: 420px;
display: flex;
flex-direction: column;
gap: 20px;
}

.tg_header {
display: flex;
justify-content: space-between;
align-items: center;
}

.tg_h1 {
font-size: 1.5rem;
font-weight: 900;
color: var(--primary-color);
letter-spacing: -0.5px;
}

.level-info {
font-weight: 700;
font-size: 1.1rem;
color: #ffffff;
background-color: #cf7000;
padding: 4px 12px;
border-radius: var(--radius-full);
cursor: pointer;
margin: 0 0 0 15px;
}

.tg_main {
position: relative;
width: 100%;
aspect-ratio: 1 / 1;
background-color: #182335;
border-radius: var(--radius-md);
padding: 8px;
touch-action: none;
}

#grid-container {
display: grid;
width: 100%;
height: 100%;
gap: 8px;
z-index: 10;
position: relative;
}

.cell {
background-color: var(--cell-bg);
border-radius: var(--radius-md);
display: flex;
justify-content: center;
align-items: center;
font-size: clamp(1.5rem, 4vw, 2rem);
font-weight: 800;
color: var(--text-secondary);
user-select: none;
cursor: pointer;
box-shadow: var(--shadow-sm);
transition: all 0.1s ease;
z-index: 10;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6);
}

.cell span {
opacity: 0;
transform: scale(0.8);
transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cell.clue {
background-color: var(--cell-clue-bg);
color: var(--primary-color);
}

.cell.clue span {
opacity: 1;
transform: scale(1);
}

.cell.visited {
transform: scale(0.95);
background: linear-gradient(145deg, #ffe9a8, #ffd36a);
color: #ff8a00;
border: 1px solid rgba(255, 185, 50, 0.35);
box-shadow:
0 8px 18px rgba(255, 184, 50, 0.25),
inset 0 1px 2px rgba(255, 255, 255, 0.65);
}

.cell.visited span {
opacity: 1;
transform: scale(1);
}

.cell.current {
transform: scale(1.05);
box-shadow: var(--shadow-md);
z-index: 20;
background: linear-gradient(145deg, #4d8df7, #3278e8);
color: #fff;
border: 1px solid rgba(255, 255, 255, 0.18);
box-shadow:
0 10px 22px rgba(45, 115, 225, 0.32),
inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

#lines-layer {
position: absolute;
top: 8px;
left: 8px;
width: calc(100% - 16px);
height: calc(100% - 16px);
pointer-events: none;
z-index: 5;
}

.path-line {
stroke: #fff;
stroke-width: var(--path-width);
stroke-linecap: round;
stroke-linejoin: round;
transition: all 0.1s ease;
}

.tg_footer {
display: flex;
gap: 12px;
}

.action-btn {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
gap: 8px;
padding: 12px;
background-color: white;
border: 2px solid var(--grid-bg);
border-radius: var(--radius-md);
font-family: inherit;
font-weight: 700;
font-size: 1rem;
color: var(--text-primary);
cursor: pointer;
transition: all 0.2s ease;
}

.action-btn:hover:not(:disabled) {
background-color: var(--grid-bg);
}

.action-btn:active:not(:disabled) {
transform: scale(0.98);
}

.action-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}

.modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.8);
backdrop-filter: blur(4px);
display: flex;
justify-content: center;
align-items: center;
z-index: 100;
opacity: 1;
transition: opacity 0.3s ease;
}

.modal.hidden {
opacity: 0;
pointer-events: none;
}

.modal-content {
background-color: white;
padding: 32px;
border-radius: var(--radius-lg);
box-shadow: var(--shadow-lg);
text-align: center;
transform: translateY(0) scale(1);
transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.hidden .modal-content {
transform: translateY(20px) scale(0.95);
}

.modal h2 {
color: var(--success-color);
font-size: 1.8rem;
font-weight: 900;
margin-bottom: 8px;
}

.modal p {
color: var(--text-secondary);
margin-bottom: 24px;
}

.primary-btn {
background-color: var(--success-color);
color: white;
border: none;
padding: 14px 28px;
border-radius: var(--radius-full);
font-family: inherit;
font-weight: 800;
font-size: 1.1rem;
cursor: pointer;
box-shadow: var(--shadow-md);
transition: all 0.2s ease;
}

.primary-btn:hover {
background-color: #059669;
transform: translateY(-2px);
box-shadow: var(--shadow-lg);
}

.primary-btn:active {
transform: translateY(0);
}

@keyframes pop {
0% {
transform: scale(1);
}

50% {
transform: scale(1.1);
}

100% {
transform: scale(1);
}
}

.cell.win-anim {
animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
background:linear-gradient(145deg, #4ad076, #00a04f);
color: white;
}
#game-container {
touch-action: none !important;
user-select: none !important;
-webkit-user-select: none !important;
overscroll-behavior: none !important;
}
#game-container * {
-webkit-tap-highlight-color: transparent !important;
}
canvas, .game-container {
transform: translateZ(0);
}
@font-face {
font-family: 'Nunito';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(https://fonts.gstatic.com/s/nunito/v32/XRXI3I6Li01BKofiOc5wtlZ2di8HDLshRTM.ttf) format('truetype');
}
@font-face {
font-family: 'Nunito';
font-style: normal;
font-weight: 700;
font-display: swap;
src: url(https://fonts.gstatic.com/s/nunito/v32/XRXI3I6Li01BKofiOc5wtlZ2di8HDFwmRTM.ttf) format('truetype');
}
@font-face {
font-family: 'Nunito';
font-style: normal;
font-weight: 900;
font-display: swap;
src: url(https://fonts.gstatic.com/s/nunito/v32/XRXI3I6Li01BKofiOc5wtlZ2di8HDBImRTM.ttf) format('truetype');
}


.level-select-content {
max-width: 360px;
width: 90%;
max-height: 80vh;
display: flex;
flex-direction: column;
}

.levels-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
margin-top: 16px;
max-height: 300px;
overflow-y: auto;
padding: 4px;
}

.level-chip {
padding: 12px 0;
background-color: var(--grid-bg);
border: 2px solid transparent;
border-radius: var(--radius-md);
font-weight: 800;
color: var(--text-primary);
cursor: pointer;
transition: all 0.15s ease;
}

.level-chip:hover {
background-color: var(--path-color);
color: white;
}

.level-chip.active {
border-color: var(--primary-color);
background-color: var(--cell-active-bg);
color: var(--primary-color);
}