html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    box-sizing: border-box;
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}

body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}
html { 
    width: 100%; 
    overflow-x: hidden;
}
body{
    background:#fff url(/static/core/utils/balda/images/shattered3.jpg); 
    color:#0F0F0F; 
    font:15px/20px Arial, Helvetica, sans-serif; 
    padding:0; 
    margin:0;
    width: 100%;
    overflow-x: hidden;
    position: relative;
}

h1 { 
    font-family: Arial, Helvetica, sans-serif;
    font-size: 26px;
    font-weight: 300; 
    text-transform: uppercase;
    margin: 10px 0;
    padding-bottom: 0.5rem;
    color: #333;
}
#result_words { 
    color: #333;
    height: 365px;
    width: 370px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    font-weight: normal;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-top: 5px;
    margin-bottom: 5px;
    padding: 5px 0;
}

/* Custom Scrollbar for #result_words and #used_words */
#result_words::-webkit-scrollbar, 
#used_words::-webkit-scrollbar,
#helpdiv::-webkit-scrollbar {
    width: 6px;
}

#result_words::-webkit-scrollbar-track,
#used_words::-webkit-scrollbar-track,
#helpdiv::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

#result_words::-webkit-scrollbar-thumb,
#used_words::-webkit-scrollbar-thumb,
#helpdiv::-webkit-scrollbar-thumb {
    background: rgba(38, 100, 207, 0.3);
    border-radius: 10px;
}

#result_words::-webkit-scrollbar-thumb:hover,
#used_words::-webkit-scrollbar-thumb:hover,
#helpdiv::-webkit-scrollbar-thumb:hover {
    background: rgba(38, 100, 207, 0.5);
}
#used_words { 
    width: 350px;
    height: 90px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(30, 176, 226, 0.4);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    text-transform: lowercase;
    resize: none;
    transition: all 0.3s ease;
    outline: none;
}

#used_words:focus {
    background: rgba(255, 255, 255, 0.7);
    border-color: #1EB0E2;
    box-shadow: 0 0 0 4px rgba(30, 176, 226, 0.15);
}
#contrlos { float:right; width:340px; float:left; padding-top:15px; border-collapse: collapse; }
#grid{ 
    float:left; 
    padding-top:5px; 
    margin-top:5px; 
    border-collapse: 
    collapse; 
    /*border-spacing: 0;*/
}

#adsense-top{ 
    margin: 0 auto;
    /*width: 728px;*/
    border-bottom: 1px solid black;
    padding-bottom: 5px;
}

div.ad160x600 { 
    /*border:1px solid gray;*/
    /*width: 255px;*/
    /*height: 610px;*/
    float: left;
    /*height: 250px;*/
    /*width: 605px;*/
    min-height: 220px;
}
a.sword { 
    cursor: pointer;
    font-size: 15px;
    font-family: "Lucida Console", Monaco, monospace;
    font-weight: bold;
    margin-left: 5px;
    text-transform: lowercase;
}

a.sword:hover { 
    color: #101B99; 
    background-color: rgb(255, 229, 0);
    border-radius: 3px;
} 

div, ul, h1, h2, h3, li, p, img{margin:0; padding:0;}

/* used_words cleanup */

input.cell { 
  display: block;
  float: left;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  text-align: center;
  padding: 0;
  color: #222;
  font-weight: bold;
  text-transform: lowercase;
  border: 2px solid rgba(0, 0, 0, 0.14); /* Modern subtle border */
  line-height: normal;
  position: relative;
  z-index: 1;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

div.keyboard {
    display: block !important;
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 9999 !important;
    cursor: pointer;
    width: 14px;
    height: 10px;
    pointer-events: auto;
    opacity: 0.5;
}

div.keyboard img {
    display: block;
    width: 100%;
    height: 100%;
    opacity: 1 !important;
    visibility: visible !important;
}

table#grid td {
    position: relative;
    padding: 0;
    margin: 0;
}

input.cell3 { width:130px; height:130px; font-size:90px; }
input.cell4 { width:100px; height:100px; font-size:75px; }
input.cell5 { width:80px; height:80px; font-size:62px; }
input.cell6 { width:65px; height:65px; font-size:52px; }
input.cell7 { width:55px; height:55px; font-size:45px; }
input.cell8 { width:48px; height:48px; font-size:40px; }
input.cell9 { width:42px; height:42px; font-size:36px; }
input.cell10 { width:38px; height:38px; font-size:32px; }

input.cell:focus { 
    border-color: #2664cf;
    background: #fff;
    outline: 0;
    box-shadow: 0 0 0 4px rgba(38, 100, 207, 0.15), inset 0 1px 2px rgba(0,0,0,0.1);
    z-index: 10;
}
#yadirect { 
    margin-top: 80px;
    float: left;
    margin-right: 15px;
}
div.spacetop { 
    margin-top: 60px !important;
}

div.container{ 
    margin:0 auto;
    max-width: 910px;
    padding-right: 10px;
} 
@media screen and (max-width: 750px) {
    div.container { padding-right: 0; width: 100%; }
}
#main{
    /*width:960px; 
    min-width:960px; */
    position:relative; 
    margin:0 auto; 
    padding:0; 
    min-height:500px; 
    float:left; 
    margin-top:15px;
    margin-left:5px; 
}
#main h1{ 
    color: #273B4F;
    line-height: 25px;
    text-transform: uppercase;
    font-size: 23px;
}
#main h2 { 
    color: #273B4F;
    line-height: 19px;
    text-transform: uppercase;
    font-size: 18px;
    margin-bottom: 10px;
}

p.text { color:#666; line-height:1.2em; margin-right: 6px; } 
ul, li{
	list-style:none;
	margin:0;
	padding:0;
}
div#header ul > li {
    float: left;
}
ul.lst, ul.lst li {
	float:none;
    list-style-type:decimal;
    margin-left: 10px;
}

li { 
}
li a:link, li a:visited, li a:hover{
	display:block;
	margin:0;
	color:#666;
    /*padding: 3px 12px;*/
    position: relative;
    z-index: 9999;
    text-decoration: none;
}

div#header { 
    height: 45px;
    font-size: 14px;
    background: #2E4760;
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
}

div#header-menu{ 
    padding-top: 2px;
}
.header-title {
    color: #fff;
    font-size: 18px;
    margin: 0;
    padding: 0;
    font-weight: 400;
    text-transform: uppercase;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 10px;
}
@media screen and (max-width: 750px) {
    .header-title { display: none; }
}
table.result { padding:1px; }


table.sample {
	border-width: 1px;
	border-spacing: 0px;
	border-style: solid;
	border-color: gray;
	border-collapse: separate;
    font-size:12px;
    width: 100%;
}
table.sample th {
	border-width: 1px;
	padding: 0;
	border-style: dotted;
	border-color: gray;
}
table.sample td {
	border-width: 1px;
	padding: 0;
    padding-left: 5px;
	border-style: dotted;
	border-color: gray;
}

a.navigation { 
    color: #FFF !important;
    font-size: 20px;
    margin-top: 10px !important;
}
p.intro { 
    text-align:justify; 
    margin-top:10px; 
    color:#222; 
    font-size: 14px;
    line-height: 15px;
}
img.preimage { 
    margin-left:30px; 
    /*width:110px; */
    float:right; 
    text-align:right; }
.button {
	padding: 10px 15px;
	background: #2664cf;
	font-family: Arial, sans-serif;
	color: #ffffff;
	text-align: center;
	display: inline-flex;
    align-items: center;
    justify-content: center;
	cursor: pointer;
    font-size: 16px;
    border: none;
	border-radius: 6px;
    transition: all 0.2s;
    text-decoration: none;
}
.button:hover {
    background: #1a4590;
}
.red-button {
    background-color: #ac0000 !important;
}
button.clear { float:right; color:#BB0000; border-radius:6px; }
.clear-button {
    height: 21px;
} 
.undo-button {
    width: 13px;
} 
.hide { display:none; }
table.controls { 
margin-top:6px; 
float:left;
}

div.direct-left { 
    width: 170px;
    height: 610px;
    float: left;
    margin-top: 7px;
    margin-right: 10px;
}
div.direct-right { 
    float: right;
    margin-left: 10px;
}
span.popup {
    display:none;
}

ul.likebuttons { margin-top:10px; width: 50%;}
div.likebuttons { 
        margin-bottom: -0.3em;
        display: inline;
}
div.direct-bottom { padding-top:125px; }
p.lite { 
    margin-left: 6px; 
    margin-right: 6px; 
    margin-top: 15px; 
    color: grey; 
    clear: both; 
    text-align: justify;
}
span.bright {color:#58616A;}
h3.intext { margin-top:20px; color:#666; margin-bottom:16px; font-weight:bold; }
div.content { width: 100%; display: inline-block; margin-bottom: 30px; }
.buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
}
#central .buttons {
    width: auto; /* Don't stretch the container too much */
}
.top-ad {
    width: 728px;
    height: 90px;
    margin: 10px auto 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 90px;
}

.logo {
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 400;
    text-decoration: none;
}

#main { 
    margin-top:20px;
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 30px;
}

.central {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center grid and buttons horizontally */
    gap: 10px;
}

div.controls { 
    flex: 1 1 auto;
    min-width: 400px;
    max-width: 650px;
}

.button, #boardsize {
    height: 48px !important;
    padding: 0 15px !important;
    background: #2664cf;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
}

.button:hover {
    background: #1a4590;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.red-button {
    background: #ac0000 !important;
}

.red-button:hover { background: #7e0000 !important; }

.undo-button {
    background: #455a64 !important;
    min-width: 48px;
    font-size: 20px;
}

#boardsize {
    background: #fff;
    color: #333;
    padding: 0 10px !important;
    cursor: pointer;
}

.btn-icon {
    margin-right: 6px;
    flex-shrink: 0;
}

#search-span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#f-words-found { 
    font-weight: bold;
}

div.central { 
    display: block;
}

} 
img.metrika { 
 position:absolute; left:-9999px;
}
div#divgrid { display: inline-block; }
div#helpdiv { 
    border: 1px solid #eee;
    padding: 6px;
    color: rgb(230, 230, 230);
    background-color: #333;
    border-radius: 3px;
    min-height: 260px;
    max-height: 300px;
    overflow: auto;
    font-size: 12px;
    display:none;
    margin-top: 5px;
    width: 98%;
    /*width: 210px;*/
} 

img.skeyboard { 
    position: relative;
    float:left; 
    display:table-cell; 
    margin-top: -72px;
    width: 13px;
    left: 2px;
    opacity:0.4;
    cursor: pointer;
}

span.path-number { 
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 13px;
    color: #2e7d32; /* Rich green for better readability */
    font-weight: bold;
    z-index: 10;
    pointer-events: none;
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.8); /* Better legibility */
}
div.happy { 
    position: absolute; 
    top: 15px; left: 0px;
    width: 100%;
    height: 36px;
    /*background:#fff url(images/mishur-small.png); */
    background: url(images/mishur-small.png); 
}
p.startword { 
    line-height: 15px;
    padding-bottom: 5px;
}
a.startwordclear { 
width: 77px;
height: 21px;
float: left;
margin-top: 2px;
}
h1 em { 
    font-weight: bold;
}

td.ok { 
 background: url("/static/core/utils/balda/images/ok16.png") no-repeat;
 background-origin: content-box;
}
td.notok { 
 background: url("/static/core/utils/balda/images/notok16.png") no-repeat;
 background-origin: content-box;
}

td.warn { 
 background: url("/static/core/utils/balda/images/warn16.png") no-repeat;
 background-origin: content-box;
}
ul.images li { float: left; } 
ul.images{ list-style: none; width: 100%; display: inline-block; } 
ul.tokens { 
    margin-left: 20px;
    list-style: inherit !important;
    list-style-type: circle;
    clear: both;
}
ul.tokens li { 
    list-style: inherit !important;
    list-style-type: circle;
}
p.tokens { 
    color: rgb(255, 255, 155);
    font-size: 14px;
    display: inline-block;
}

a.helpbutton, a.touchbutton { 
    cursor: pointer;
    float: right;
    margin-top: 3px;
    background-color: #EEE;
    border: 1px solid #BCC7E6;
    width: 24px;
    text-align: center;
    border-radius: 4px;
    line-height: 15px;
    font-size: 13px;
    width: 20px;
    margin-left: 6px;
}
a.touchbutton { 
    float: left;
}

div.controls { 
    float: right;
    display: block;
    max-width: 210px;
}
div.title { 
    margin-bottom: 10px;
}

.navigation img { 
    margin-top: -19px; 
}

.medium-content { 
    max-width: 320px;
}

.bottom-content { 
    width: 100%; 
    clear: both;
    padding: 20px 0;
    min-height: 130px;
    border-top: 1px solid rgba(0, 0, 0, 0.05); /* Very soft divider */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    overflow-x: auto; /* Allow scroll if ad is wide, but style it */
}

/* Re-use our custom scrollbar for ad area too */
.bottom-content::-webkit-scrollbar {
    height: 4px; /* Thin horizontal scroll */
}
.bottom-content::-webkit-scrollbar-track {
    background: transparent;
}
.bottom-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}
div.mobility-ad { display: none; }  
p.adnotation { color: gray;  font-size: 12px; display: none; } 

/* UPPER NON MEDIA */

img.logo { height: 50px; float: left;  margin-top: -16px; }
div.logo {  float: left; font-size: 1.7em; margin-left: 4px;} 
span.logo-base { color: white; } 
span.logo-tld { color: gray; }

@media screen and (min-device-width: 960px) { 
    /* обычные компы короче */
    .medium-content { 
        min-width: 340px;
        min-height: 290px;
        margin-top: 6px;
        display: inline-block;
        margin-left: 15px;
        float: left;
    }
    #search-button {
        min-width: 150px;
    }
    #helpdiv {
        height: 365px;
    }

}

@media screen and (max-width: 750px) { 

    h1 {
            line-height: 1.1;
    }
    div.top-content { 
        /*max-height: 110px; */
        width: 100%;
        position: relative;
        margin: auto;
    }
    p.adnotation { display: initial; } 

    a.helpbutton, a.touchbutton, a.sword { 
        font-size: 20px;
    }
    a.helpbutton, a.touchbutton, a.sword { 
    }
    a.touchbutton { float: left; }
    /* маленькие экраны */
    .medium-content { 
        /*width: 98%;*/
        width: 100%;
        /* display: inline-block; */
        /*max-height: 160px;*/
        margin: 0 auto;
        display: block;
        float: none;
        margin-top: 10px;
        margin-bottom: 10px;
        display: none;
        /*overflow: scroll;*/
    }
    div.central {
         float: none; 
        margin: 0 auto;
        width: 100%;
    }
    div#divgrid {
        display: block;
        width: 96%;
    }
    #grid { 
        float: none; 
        padding-top: 0;
        margin-top: 5px;
        border-collapse: collapse;
        margin: 0 auto;
        width: 100%;
        table-layout: fixed;
    }
    input.cell {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1;
    }
    input.cell3, input.cell4, input.cell5, input.cell6, 
    input.cell7, input.cell8, input.cell9, input.cell10 {
        width: 100% !important;
        height: auto !important;
    }
    /* Responsive font sizes based on viewport width */
    input.cell3 { font-size: 20vw; }
    input.cell4 { font-size: 15vw; }
    input.cell5 { font-size: 12vw; }
    input.cell6 { font-size: 10vw; }
    input.cell7 { font-size: 8vw; }
    input.cell8 { font-size: 7vw; }
    input.cell9 { font-size: 6vw; }
    input.cell10 { font-size: 5vw; }

    /* Mobile Overrides - Keep it tight */
    div.buttons {
        flex-wrap: nowrap; 
        gap: 5px;
        justify-content: space-between;
        padding: 0 5px;
    }
    .button, #boardsize {
        flex: 1 1 auto;
        padding: 0 5px !important;
        font-size: 18px !important;
        min-width: 0; 
    }
    #clearall {
        flex: 0 0 48px;
        width: 48px !important;
    }
    #search-button {
        flex: 2 1 auto;
        margin-right: 5px;
    }
    #search-span {
        gap: 4px;
    }
    #boardsize {
        flex: 0 0 65px; 
        -webkit-appearance: none;
    }
    #undo-button {
        flex: 0 0 44px;
    }
    .btn-icon {
        margin-right: 4px;
    }
    @media screen and (max-width: 400px) {
        .btn-text { display: none; }
        .btn-icon { margin-right: 0; }
    }
    .btn-icon {
        flex-shrink: 0;
    }

    #main { 
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top:0px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    div.controls {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-top: 20px;
    }
    .top-ad {
        width: 100% !important;
        margin-bottom: 10px;
        max-height: 120px;
    }
    div.title {
        margin-top: 10px;
        margin-left: 10px;
    }
    div.controls { 
        max-width: 100%;
        float: none;
        margin: 0 auto;
        padding: 0;
        width: 100%;
        box-sizing: border-box;
    }
    #result_words { 
       width: 100%; 
       margin-left: 0px;
       box-sizing: border-box;
       height: 250px;
    }
    #used_words { 
       width: 100%; 
       margin-left: 0px;
       box-sizing: border-box;
    }
    #main h1 { 
        font-size: 26px; 
        line-height: 1.2;
        padding-bottom: 0.5rem;
    }
    div.keyboard { 
        display: none !important; 
    }
    span.path-number {
        font-size: 15px !important;
        top: 1px;
        right: 2px;
    }
} /* End of mobile query */

div.desktop-ad  { display: none; }
div.mobility-ad { display: block; } 

.result-item { 
    width: 95%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 0;
    background: rgba(255,255,255,0.3);
    margin-bottom: 2px;
} 
a.sword {
    font-size: 18px;
    font-weight: bold;
    flex: 1;
    text-align: left;
    color: #2664cf !important;
    padding-left: 10px;
}
.touchbutton, .helpbutton {
    width: 32px !important;
    height: 32px !important;
    font-size: 16px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%; /* Circle looks softer */
    margin: 0 5px;
    color: #2664cf !important;
    opacity: 0.6;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.touchbutton:hover, .helpbutton:hover {
    background: rgba(38, 100, 207, 0.1);
    opacity: 1;
    transform: scale(1.1);
}

.touchbutton:active, .helpbutton:active {
    transform: scale(0.95);
}
div#helpdiv {  
    width: 100%; 
    box-sizing: border-box;
    font-size: 15px;
    line-height: 1.4;
    padding: 15px;
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    border-radius: 8px;
}
div#helpdiv li {
    margin-bottom: 8px;
}

@media screen and (max-width: 750px) {
    a.sword {
        font-size: 22px;
        text-align: center;
        padding-left: 0;
    }
    .touchbutton, .helpbutton {
        width: 40px !important;
        height: 40px !important;
        font-size: 20px !important;
        border-radius: 8px;
    }
    div#helpdiv {
        font-size: 16px !important;
        height: 250px;
        max-width: 98%;
    }
}


