html, body {
    padding: 0;
    margin: 0;
    height: 100%;
    color: #8c7653;
    font-family: Georgia, serif;
    font-size: 12px;
}

a {
    color: #8c7653;
    text-decoration: underline dotted;
}

a:hover, #navbar a:hover {
    color : #a28a64;
}

#page {
    min-height: 100%;
    min-width: 1249px;
    margin: 0 auto;
    background: url(images/bg-top.jpg) center top repeat-x, url(images/bg-gradient.png) center 583px repeat-x, url(images/bg-bottom.jpg) center bottom repeat-x, #000;
}

#page::after {
    content: '';
    display: block;
    height: 160px;
}

#header {
    height: 372px;
}

#content-wrapper {
    display: flex;
    justify-content: center;
}

.side {
    position: relative;
    z-index: 1;
    padding-top: 56px;
}

.side::after {
    content: '';
    display: block;
    height: 60px;
}

#center {
    position: relative;
    width: 619px;
    z-index: 2;
}

#content-bg {
    position: absolute;
    background: url(images/content-middle.png);
    width: 619px;
    top: 130px;
    left: 0;
    bottom: 97px;
}

#content-bg::before {
    content: '';
    position: absolute;
    background: url(images/content-top.png);
    width: 619px;
    height: 130px;
    top: -130px;
    left: 0;
}

#content-bg::after {
    content: '';
    position: absolute;
    background: url(images/content-bottom.png);
    width: 619px;
    height: 130px;
    bottom: -97px;
    left: 0;
}

#content {
    position: relative;
    min-height: 227px;
    padding: 23px 22px;
}

.panel {
    position: relative;
    min-height: 118px;
    margin-bottom: 38px;
}

.panel-header {
    position: absolute;
    background: url(images/panel-header.png);
    width: 278px;
    height: 63px;
    top: -11px;
    left: 24px;
    z-index: 4;
    display: flex;
    justify-content: center;
    align-items: center;
}

.panel-header-label {
    text-transform: uppercase;
    font-size: 1.3em;
    background: linear-gradient(to bottom, #d2a257, #403220);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.text-stroke {
    filter: drop-shadow(1px 0 #000) drop-shadow(-1px 0 #000) drop-shadow(0 -1px #000) drop-shadow(0 1px #000) drop-shadow(0 0 3px #000);
}

#right .panel-header {
    right: 24px;
    left: auto;
}

.panel-frame {
    position: absolute;
    z-index: 2;
    background: url(images/panel-middle.png);
    width: 326px;
    top: 64px;
    left: 0;
    bottom: 54px;
}

.panel-frame::before {
    content: '';
    position: absolute;
    background: url(images/panel-top.png);
    width: 326px;
    height: 73px;
    top: -64px;
    left: 0;
}

.panel-frame::after {
    content: '';
    position: absolute;
    background: url(images/panel-bottom.png);
    width: 326px;
    height: 63px;
    bottom: -54px;
    left: 0;
}

#right .panel-frame {
    right: 0;
    left: auto;
}

.panel-bg {
    position: absolute;
    z-index: 1;
    background: url(images/panel-bg-top.png) center top no-repeat, url(images/panel-bg-repeat.png) center 62px repeat-y;
    width: 255px;
    left: 36px;
    top: 27px;
    bottom: 0;
}

#right .panel-bg {
    right: 36px;
    left: auto;
}

.panel-content {
    position: relative;
    z-index: 3;
    width: 315px;
    padding: 43px 22px 10px 35px;
    box-sizing: border-box;
}

#right .panel-content {
    padding-left: 22px;
    padding-right: 35px;
}

#footer {
    position: relative;
    background: url(images/bg-footer.jpg) center;
    height: 178px;
    margin-top: -178px;
    min-width: 1249px;
}

#footer-line {
    position: absolute;
    background: url(images/footer-line.png) right -15px no-repeat, url(images/footer-line.png) left top no-repeat, url(images/footer-line.png) center -30px repeat-x;
    left: 0;
    top: -7px;
    right: 0;
    height: 14px;
}

#navbar {
    background: url(images/nav-bar.png);
    height: 72px;
    width: 1024px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
}

.nav-container-wrapper {
    position: relative;
    width: 0;
    display: flex;
    z-index: 2;
}

.nav-container-wrapper.right {
    justify-content: flex-end;
}

.nav-container {
    width: 460px;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px 16px 31px;
    box-sizing: border-box;
}

.nav-container-wrapper.right .nav-container {
    padding: 0 31px 16px 10px;
}

#navbar a {
    color: #88704a;
    text-shadow: 0 0 3px #000;
    text-transform: uppercase;
    font-size: 1em;
    text-decoration: none;
}

#download-button {
    position: relative;
    background: url(images/download-orb.png);
    width: 142px;
    height: 75px;
    z-index: 1;
}

#logo {
    display: block;
    background: url(images/logo.png);    
    width: 449px;
    height: 257px;
    margin: 36px auto 0 auto;
}

.text-gradient-1 {
    background: linear-gradient(to bottom, #5b4c36, #4b3e2a, #5b4c36);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.login-label {
    text-transform: uppercase;
    font-size: 1.4em;
    display: block;
    text-align: center;
    margin-bottom: 1px;
}

.login-input {
    display: block;
    width: 230px;
    margin: 0 auto 11px;
}

.login-form {
    margin-top: 18px;
}

.form-links a, .login-link {
    font-size: 1.3em;
    display: block;
    text-align: center;
    margin: 15px 0;
    outline: none;
}

#user-form-button {
    display: block;
    margin: 0 auto 17px;
    width: 150px;
}

input[type=text], input[type=password], input[type=email], select, textarea {
    border: none;
    color: #88704a;
    box-sizing: border-box;
}

input[type=text], input[type=password], input[type=email], select {
    background: url(images/input.png) right -76px no-repeat, url(images/input.png) left -38px no-repeat, url(images/input.png) top no-repeat;
    background-size: auto, auto, 100% 113px;
    height: 37px;
    padding: 0 20px;
}

option, textarea {
    background: #050301;
    padding: 10px;
}

textarea {
    border: 1px solid #a3815e;
    box-shadow: 1px 0 0 #694d31, -1px 0 0 #694d31, 0 1px 0 #694d31, 0 -1px 0 #694d31;
}

.button, button, .pagination_active.highlight, .download-button {
    position: relative;
    display: inline-block;
    border: 0;
    background: url(images/button.png) top;
    height: 45px;
    transition: filter 150ms;
    text-decoration: none;
    color: #c6964d;
    text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000, 0 1px 0 #000, 0 0 3px #000;
    font-size: 14px;
    font-family: inherit;
    letter-spacing: normal;
    vertical-align: bottom;
    line-height: 45px;
    box-sizing: border-box;
    padding: 0 20px;
    margin: 1px 5px;
    cursor: pointer;
    font-variant: normal;
    text-transform: uppercase;
    text-align: center;
}

.button-gray {
    background-position-y: -46px;
}

.button::before, button::before, .pagination_active::before, .download-button::before {
    content: '';
    display: block;
    position: absolute;
    background: url(images/button.png) left -92px;
    width: 18px;
    height: 41px;
    top: 2px;
    left: -4px;
}

.button::after, button::after, .pagination_active::after, .download-button::after {
    content: '';
    display: block;
    position: absolute;
    background: url(images/button.png) right -92px;
    width: 18px;
    height: 41px;
    top: 2px;
    right: -4px;
}

.filter-effects, #footer a {
    transition: filter 150ms;
}

.filter-effects:hover {
    filter: saturate(1.1) brightness(1.1) contrast(1.1);
    color: #544631;
}

#footer a:hover, .button:hover, button:hover, .download-button:hover {
    filter: saturate(1.1) brightness(1.1) contrast(1.1);
}

.filter-effects:active, .button:active, .button.active, button:active, button.active, .download-button:active, #footer a:active {
    filter: saturate(1.0) brightness(0.9) contrast(1.1);
}

#ranking-wrapper {

}

#ranking-content {
    width: 225px;
    margin: 0 auto;
}

.ranking-place span, .ranking-name a {
    filter: drop-shadow(1px 0 #000) drop-shadow(-1px 0 #000) drop-shadow(0 -1px #000) drop-shadow(0 1px #000) drop-shadow(0 0 3px #000);
    background: linear-gradient(to bottom, #ffc982, #7b5029);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}


.ranking-row {
    display: flex;
    height: 29px;
    line-height: 29px;
    border-bottom: 1px solid #2c1f13;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.ranking-place {
    width: 25px;
    flex: 0 0 auto;
    font-family: "Times New Roman", Times, serif;
    font-size: 1.3em;
}

.ranking-name {
    flex: 1 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9em;
}

.ranking-name a {
    text-decoration: none;
}

.ranking-kingdom {
    width: 35px;
    background-size: contain;
    background: center no-repeat;
    flex: 0 0 auto;
}

.ranking-kingdom-1 {
    background-image: url(/images/kingdom/1s.png);
}

.ranking-kingdom-2 {
    background-image: url(/images/kingdom/2s.png);
}

.ranking-kingdom-3 {
    background-image: url(/images/kingdom/3s.png);
}

.ranking-row:last-of-type {
    border: none;
    box-shadow: none;
}

#ranking-buttons {
    width: 225px;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
}

#ranking-buttons .button {
    flex: 0 0 102px;
    background-position-y: -46px;
}

#ranking-buttons .button:hover, #ranking-buttons .button:active, #ranking-buttons .button.active {
    background-position-y: 0;
    filter: none;
}

/* Nazwa miesiąca (generowana przez CalendarService (m5_s2)) */
#callendar-header {
    width: 259px;
    text-align: center;
    color: #c79b5f;
    font-size: 14px;
    line-height: 22px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 1px 1px 1px #000;
}

/* Wiersz dni tygodnia (statyczny w layout.php) */
.callendar-weekdays {
    display: flex;
    width: 259px;
    margin-top: -3px;
}

/* Siatka dni (generowana przez CalendarService (m5_s2)) */
#calendar-wrapper {
    position: relative;
    display: flex;
    width: 259px;
    flex-wrap: wrap;
    margin-bottom: -3px;
}

/* Kolejność w panelu: miesiąc -> dni tygodnia -> siatka */
#right .panel-callendar .panel-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}
#right .panel-callendar #callendar-header { order: 1; }
#right .panel-callendar .callendar-weekdays { order: 2; }
#right .panel-callendar #calendar-wrapper { order: 3; }
#right .panel-callendar .event-list { order: 4; }

.panel-callendar {
    z-index: 2;
}

.panel-other {
    z-index: 1;
}

#callendar {
    position: relative;
    display: flex;
    width: 259px;
    flex-wrap: wrap;
    margin-bottom: -3px;
}

.callendar-cell {
    font-family: "Times New Roman", Times, serif;
    width: 35px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: url(images/callendar-cell.png) top;
    border: 1px solid #624a2d;
    color: #c09665;
    z-index: 1;
}

.callendar-cell-event-1 {
    background-position-y: -25px;
}

.callendar-cell-event-2 {
    background-position-y: -50px;
}

/* Dzień z eventem / dziś (klasy z CalendarService) */
.callendar-today {
    background-position-y: -50px;
}
.callendar-has-event {
    background-position-y: -25px;
    cursor: help;
}

.callendar-weekdays .callendar-cell {
    background: none;
}

.callendar-cell-gray {
    color: #444;
}

.callendar-event-description {
    position: absolute;
    bottom: 0;
    width: 237px;
    padding: 0 10px 10px;
    border: 1px solid #624a2d;
    color: #8c7653;
    line-height: normal;
    background: #0f0902;
    display: none;
    left: 50%;
    transform: translate(-50%, 100%);
    text-align: left;
}

.callendar-event-title {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 1.1em;
    line-height: 30px;
}

.callendar-cell:hover {
    z-index: 2;
}

.callendar-cell:hover .callendar-event-description {
    display: block;
}

/* Popup eventów — pojawia się pod siatką na hover (jak w oryginale) */
#calendar-wrapper .callendar-event-popup {
    display: none;
    position: absolute;
    left: 50%;
    top: auto;
    bottom: 0;
    transform: translate(-50%, 100%);
    min-width: 237px;
    max-width: 237px;
    padding: 8px 10px 10px;
    border: 1px solid #624a2d;
    background: #0f0902;
    text-align: left;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
    z-index: 200;
}
#calendar-wrapper .callendar-cell:hover .callendar-event-popup {
    display: block;
}
#calendar-wrapper .callendar-event-popup .callendar-event-wrapper {
    position: static;
    display: block;
}
#calendar-wrapper .callendar-event-popup .callendar-event-wrapper + .callendar-event-wrapper {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #3a2c19;
}
#calendar-wrapper .callendar-event-popup .callendar-event-title {
    font-weight: bold;
    font-size: 1em;
    line-height: 1.3;
    color: #c79b5f;
}
#calendar-wrapper .callendar-event-popup .callendar-event-description {
    position: static;
    display: block;
    width: auto;
    left: auto;
    bottom: auto;
    padding: 0;
    margin-top: 2px;
    border: 0;
    background: none;
    transform: none;
    color: #8c7653;
    line-height: normal;
    text-align: left;
    font-size: 0.92em;
}

.other-label {
    background: linear-gradient(to bottom, #c68d30, #3e301f);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-transform: uppercase;
    text-align: center;
    margin: 19px auto 9px;
    font-size: 1.3em;
}

.stat-label {
    font-family: "Times New Roman", Times, serif;
    width: 150px;
    background-position-y: -46px;
    display: block;
    margin: 0 auto 22px;
}

#video {
    background: url(images/video-frame.png), url(images/video-image.png) center no-repeat;
    width: 230px;
    height: 167px;
    display: block;
    margin: 13px auto 63px;
}

#fb-button {
    background: url(images/fb-orb.png);
    width: 91px;
    height: 106px;
    position: absolute;
    left: 50%;
    transform: translateX(-45px);
    bottom: -48px;
}

#footer::before {
    content: '';
    display: block;
    height: 36px;
}

#footer-navbar {
    display: flex;
    justify-content: space-between;
    width: 629px;
    margin: 0 auto;
}

#footer-navbar a {
    text-transform: uppercase;
    font-size: 1.4em;
    filter: drop-shadow(1px 0 #000) drop-shadow(-1px 0 #000) drop-shadow(0 -1px #000) drop-shadow(0 1px #000) drop-shadow(0 0 3px #000);
    background: linear-gradient(to bottom, #ffeb94, #be894e);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

#social-buttons {
    display: flex;
    justify-content: center;
}

.social-button {
    display: block;
    background: url(images/social-icons.png) left top;
    width: 31px;
    height: 31px;
    margin: 17px;
}

.social-button-fb {
    background-position-x: right;
}

.social-button-yt {

}

#signature {
    font-size: 1.3em;
    filter: drop-shadow(1px 0 #000) drop-shadow(-1px 0 #000) drop-shadow(0 -1px #000) drop-shadow(0 1px #000) drop-shadow(0 0 3px #000);
    color: #b18253;
    text-align: center;
    margin-top: 10px;
}

.user-panel-header {
    font-size: 1.6em;
    font-weight: bold;
    margin-top: 15px;
    text-align: center;
    text-transform: uppercase;
    font-family: "Times New Roman", Times, serif;
}