/*------------------------- Import animation styles --------------------------*/
@import url( "animation-w3c.css" );
@import url( "animation-chr.css" );
@import url( "animation-ff.css" );
@import url( "animation-ms.css" );
@import url( "animation-o.css" );

/*-------------------------------- CSS Reset ---------------------------------*/
html, body, div, span, figure,
h1, h2, h3, p, a, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot,
thead, tr, th, td, dl, dt, dd,
input[type=checkbox], input[type=radio] {
    outline: 0;
    padding: 0;
    border: 0;
    margin: 0;
}
select {
    margin: 0;
}

/*----------------------------- Layout settings ------------------------------*/
html, body {
    width: 100%;
    height: 100%;
}
body {
    position: relative; /* required to not cut top overflow */
    color: white;
    font: 13px/1.7 Verdana, sans-serif;
    min-width: 471px;
    /*min-height: 680px; !* larger than container size to include tooltips *!*/
}
a {
    text-decoration: none;
    color: inherit;
}
#background {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
#back-gradient {
    position: absolute;
    z-index: -2;
    width: 100%;
    height: 100%;
}
#back-decor {
    position: absolute;
    z-index: -1;
    top: 50%;
    right: 50%;
    width: 1024px;
    height: 1024px;
    margin: -512px -512px 0 0;
}
#container {
    position: relative;
}
/*Disable zoom0in for mobile devices on double-tap*/
* {
    touch-action: manipulation;
}
header {
    width: 451px;
    height: 51px;
    background: url(../images/header-back.png);
    padding: 10px;
    margin: auto;
}
#field {
    font-size: 50px;
    width: 449px;
    height: 449px;
    padding: 11px;
    background: url(../images/field.png);
    margin: auto;
}
#field-insert {
    position: relative;
}
#options-page, #help-page, #scores-page {
    display: none;
    width: 411px;
    height: 431px;
    overflow: auto;
    background: url(../images/page-back.png);
    padding: 20px 30px;
}
footer {
    width: 446px;
    height: 46px;
    background: url(../images/footer-back.png);
    padding: 13px;
    margin: auto;
}

/*----------------------------- Content styling ------------------------------*/

@font-face {
    font-family: ozone;
    src: url(../fonts/ozone-ed.ttf);
}

h1 {
    font-size: 1.5em;
    line-height: 2.5em;
    text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
h2 {
    margin-bottom: 0.5em;
}
h2, legend {
    font-size: 1em;
    font-weight: bold;
}


/* Balls */
figure {
    width: 50px;
    height: 50px;
}
figure.matte {
    background-image: url(../images/balls.png);
}
figure.glossy {
    background-image: url(../images/balls-glossy.png);
}
.blue {
    background-position: 0 0;
}
.purple {
    background-position: 0 -50px;
}
.red {
    background-position: 0 -100px;
}
.yellow {
    background-position: 0 -150px;
}
.green {
    background-position: 0 -200px;
}
.cyan {
    background-position: 0 -250px;
}
.white {
    background-position: 0 -300px;
}

/* Header */
#balls-preview {
    margin-left: 30%;
}
#balls-preview figure {
    display: inline-block;
    float: left;
}
#score {
    display: inline-block;
    float: right;
    font: 34px/51px ozone, sans-serif;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Field */
#field figure {
    position: absolute;
    -moz-transform-origin: 25px 25px; /* useless firefox twitching fix =( */
}

/* Options */
fieldset, p {
    clear: both;
    padding-top: 0.6em;
    margin-bottom: 1.2em;
}
input[type=checkbox], input[type=radio] {
    opacity: 0;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px;
    height: 1px;
}
input[type=text] {
    width: 20px;
}
input + label {
    display: inline-block;
    height: 20px;
    padding-left: 20px;
    margin-left: 2em;
    background: url(../images/controls.png) no-repeat;
}
input[type=checkbox] + label {
    background-position: 0 4px;
}
input[type=checkbox] + label:hover {
    background-position: 0 -16px;
}
input[type=checkbox] + label:active {
    background-position: 0 -36px;
}
input[type=checkbox]:disabled + label {
    background-position: 0 -56px;
}
input[type=checkbox]:checked + label {
    background-position: 0 -76px;
}
input[type=checkbox]:checked + label:hover {
    background-position: 0 -96px;
}
input[type=checkbox]:checked + label:active {
    background-position: 0 -116px;
}
input[type=checkbox]:checked:disabled + label {
    background-position: 0 -136px;
}
input[type=radio] + label {
    background-position: 0 -156px;
}
input[type=radio] + label:hover {
    background-position: 0 -176px;
}
input[type=radio] + label:active {
    background-position: 0 -196px;
}
input[type=radio]:disabled + label {
    background-position: 0 -216px;
}
input[type=radio]:checked + label {
    background-position: 0 -236px;
}
input[type=radio]:checked + label:hover {
    background-position: 0 -256px;
}
input[type=radio]:checked + label:active {
    background-position: 0 -276px;
}
input[type=radio]:checked:disabled + label {
    background-position: 0 -296px;
}
input[type=button] {
    float: right;
    min-width: 5em;
    min-height: 2em;
    margin: 0.5em;
}
select[name=language],
select[name=balls-skin] {
    margin-left: 2.5em;
}
select, input[type=button] {
    color: white;
    font-size: 13px;
    line-height: 16px;
    background-color: rgba(0, 0, 0, 0.0); /* Windows version of Opera treat 'transparent' incorrectly */
    -webkit-appearance: none; /* Fix of the same problem as above for the Windows version of Chrome */
    background-image:         linear-gradient( top, rgba(80, 80, 80, 0.2), rgba(0, 0, 0, 0.35) );
    background-image: -webkit-linear-gradient( top, rgba(80, 80, 80, 0.2), rgba(0, 0, 0, 0.35) );
    background-image:    -moz-linear-gradient( top, rgba(80, 80, 80, 0.2), rgba(0, 0, 0, 0.35) );
    background-image:     -ms-linear-gradient( top, rgba(80, 80, 80, 0.2), rgba(0, 0, 0, 0.35) );
    background-image:      -o-linear-gradient( top, rgba(80, 80, 80, 0.2), rgba(0, 0, 0, 0.35) );
    padding: 2px 6px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-top-color: rgba(255, 255, 255, 0.25);
    border-bottom-color: rgba(0, 0, 0, 0.35);
    border-radius: 3px;
    box-shadow: 0 -1px rgba(0, 0, 0, 0.2), 0 1px rgba(255, 255, 255, 0.15);
}
select:hover, input[type=button]:hover {
    background-image:         linear-gradient( top, rgba(50, 50, 50, 0.3), rgba(0, 0, 0, 0.45) );
    background-image: -webkit-linear-gradient( top, rgba(50, 50, 50, 0.3), rgba(0, 0, 0, 0.45) );
    background-image:    -moz-linear-gradient( top, rgba(50, 50, 50, 0.3), rgba(0, 0, 0, 0.45) );
    background-image:     -ms-linear-gradient( top, rgba(50, 50, 50, 0.3), rgba(0, 0, 0, 0.45) );
    background-image:      -o-linear-gradient( top, rgba(50, 50, 50, 0.3), rgba(0, 0, 0, 0.45) );
    border-top-color: rgba(255, 255, 255, 0.3);
}
select:active, input[type=button]:active {
    background-image:         linear-gradient( top, rgba(10, 10, 10, 0.35), rgba(50, 50, 50, 0.4) );
    background-image: -webkit-linear-gradient( top, rgba(10, 10, 10, 0.35), rgba(50, 50, 50, 0.4) );
    background-image:    -moz-linear-gradient( top, rgba(10, 10, 10, 0.35), rgba(50, 50, 50, 0.4) );
    background-image:     -ms-linear-gradient( top, rgba(10, 10, 10, 0.35), rgba(50, 50, 50, 0.4) );
    background-image:      -o-linear-gradient( top, rgba(10, 10, 10, 0.35), rgba(50, 50, 50, 0.4) );
}
select option {
    color: inherit;
    background: #444;
}

/* Help */
dt {
    font-style: italic;
}
[id^="dt-"] + dd {
    position: relative;
    padding-left: 50px;
    margin-bottom: 1em;
}
[id^="dt-"] + dd:before {
    display: inline-block;
    position: absolute;
    top: 4px;
    left: 0;
    content: "";
    width: 40px;
    height: 46px;
    background: url(../images/icons.png) no-repeat;
}
#dt-lines + dd:before {
    background-position: center -276px;
}
#dt-rectangles + dd:before {
    background-position: center -322px;
}
#dt-rings + dd:before {
    background-position: center -368px;
}
#dt-blocks + dd:before {
    background-position: center -414px;
}

/* Scores */
table {
    width: 100%;
    margin-top: 1em;
}
th {
    padding-bottom: 0.6em;
}
td {
    padding: 0.3em 0;
    text-align: center;
}
td:nth-of-type(odd) {
    font: 22px/24px ozone, sans-serif;
}

/* Footer */
footer a {
    display: inline-block;
    position: relative;
    float: right;
    overflow: hidden;
    opacity: 0.7;
    cursor: pointer;
    height: 46px;
    background-image: url(../images/icons.png);
}
footer a:hover {
    opacity: 1;
    overflow: visible;
}
.tooltip {
    position: absolute;
    left: 0;
    top: 65px;
    /*width: 500px;*/
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    /*margin-left: -250px;*/
    opacity: 0;
}
footer a:hover .tooltip {
    opacity: 1;
}
#logo {
    height: 40px;
}
#cc {
    float: left;
    width: 48px;
    background-position: center -46px;
}
#restart {
    width: 44px;
    background-position: center -46px;
}
#new_game {
    width: 44px;
    background-position: center -46px;
    float: right;
}
#undo {
    width: 44px;
    background-position: center -92px;
    float: left;
}
#scores {
    width: 44px;
    background-position: center -138px;
}
#help {
    width: 32px;
    background-position: center -184px;
}
#options {
    width: 48px;
    background-position: center -230px;
}
#mode {
    width: 40px;
    background-position: center -276px;
}
#num-balls {
    position: absolute;
    bottom: 4px;
    left: 4px;
    font: 22px/24px ozone, sans-serif;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Responsive layout: Bulma related changes */
header, footer, #field {
    box-sizing: content-box;
}

.widget-section {
    border: 1px solid red;
    margin: 10% 0;
    border-radius: 5px;
    width: 100%;
    text-align: center;
}

.widget-unit {
    padding: 10%;
    color: red;
    /*font-size: 200%;*/
}

.column {
    /*border: 1px dotted red;*/
}

body, html {
    background-color: #f3f2da !important;
}

body {
    position: relative;
    left: -5%;
    margin: 0 8% !important;
    overflow-x: revert;
}

.user-scores {
    font-size: 100%;
    padding-left: 10px;
}

#high-score {
    font: 22px/24px ozone, sans-serif;
}