:root {
  --color-bg: #061123;
  --color-primary: #5aaad7;
  --color-primary-dark: #296985;
  --color-primary-mid: #4c8eb4;
  --color-panel: #cfd7da;
  --color-panel-content: #e7edef;
  --color-panel-border: #bac6ca;
  --color-panel-separator: #c3cfd5;
  --color-text: #4f595f;
  --color-text-muted: #6a808d;
  --color-online: #6cd94b;
  /* Cinzel: elegant fantasy headings (box heads, section titles)
     Rajdhani: condensed game-style UI (navbar, labels, buttons)
     Open Sans: clean readable body/content text */
  --font-heading: 'Cinzel', serif;
  --font-ui: 'Rajdhani', sans-serif;
  --font-body: 'Open Sans', sans-serif;

  /* Override Bootstrap 5 defaults */
  --bs-navbar-padding-y: 0;
  --bs-navbar-padding-x: 0;
  --bs-nav-link-padding-y: 0;
  --bs-nav-link-padding-x: 0;
  --bs-link-color: #49A9D4;
  --bs-link-hover-color: #5BB5E8;
  --bs-link-decoration: none;
  --bs-link-hover-decoration: none;
  --bs-body-font-family: 'Open Sans', sans-serif;
  --bs-body-font-size: 14px;
  --bs-gutter-x: 30px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Reset Bootstrap 5 link defaults to match old BS3 feel */
a {
  color: #49A9D4;
  text-decoration: none;
}

a:hover {
  color: #5BB5E8;
  text-decoration: none;
}

/* Reset BS5 paragraph bottom margin to match BS3 */
p {
  margin-bottom: 10px;
}

/* Reset BS5 heading margins */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 10px;
  font-family: var(--font-heading);
}

body {
  background-color: var(--color-bg);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 0;
}

.container {
  width: 1170px !important;
  max-width: 100%;
  padding-left: 15px !important;
  padding-right: 15px !important;
}

/* ─── Status bar ─────────────────────────────────────────────────── */

.status-bar {
  width: 100%;
  background: rgba(0, 0, 0, 0.85);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid #4a8cb2;
}

.status-bar .item {
  height: 40px;
  padding: 0 15px;
  line-height: 40px;
  color: #6f8390;
  border-left: 1px solid #4a8cb2;
}

.status-bar .item .value {
  color: #b8ccd8;
  font-family: var(--font-ui);
  font-weight: 700;
}

.status-bar .item .online {
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--color-online);
}

.status-bar .item a {
  color: inherit;
  text-decoration: none;
}

/* ─── Navigation ─────────────────────────────────────────────────── */

.menu {
  margin-bottom: 0;
}

.menu nav {
  border-radius: 5px;
  background: linear-gradient(to bottom, var(--color-primary-mid) 0%, var(--color-primary-dark) 100%);
  border: none;
  box-shadow: inset 0 1px 0 0 #78b0cc, 0 4px 0 0 #194f6b;
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 600;
  padding: 0 15px !important;
  height: 60px;
  align-items: stretch !important;
}

.menu nav .collapse.navbar-collapse {
  align-items: stretch;
}

.menu nav .navbar-nav {
  align-items: stretch;
}

.menu nav .navbar-nav .nav-item {
  display: flex;
  align-items: center;
}

.menu nav .navbar-nav .nav-link {
  color: white;
  line-height: 60px;
  padding: 0 15px !important; /* match old BS3 li a padding */
  transition: background 0.15s;
  display: flex;
  align-items: center;
}

.menu nav .navbar-nav .nav-link:hover,
.menu nav .navbar-nav .nav-link:focus {
  color: white;
  background: rgba(0, 0, 0, 0.2);
}

.menu nav .navbar-nav .nav-item.active .nav-link,
.menu nav .navbar-nav .nav-item.show .nav-link {
  background: #262f33;
  color: white;
}

.menu nav .dropdown-menu {
  padding: 0 0 4px;
  background: #4abafb;
  border: none;
  border-radius: 0;
  box-shadow: 0 5px 5px rgba(0, 0, 0, 0.175);
}

.menu nav .dropdown-menu .dropdown-item {
  line-height: 34px;
  color: white;
  padding: 0 12px;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 500;
}

.menu nav .dropdown-menu .dropdown-item:hover {
  background: rgba(0, 0, 0, 0.15);
  color: #5BB5E8;
}

.menu nav .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.4);
  margin: 8px 0;
}

.menu nav .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.8%29' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.menu nav form.d-flex {
  align-items: center; /* vertically centers the inputs within the 60px navbar */
}

.menu nav .d-flex .form-control {
  height: 36px;
  background: linear-gradient(to bottom, #3b7799 0%, #2a5b74 100%);
  border-radius: 5px 0 0 5px;
  border: none;
  box-shadow: inset 0 3px 0 0 #286586, inset 0 -1px 0 0 #40809b;
  color: white;
  font-family: var(--font-ui);
}

.menu nav .d-flex .form-control::placeholder {
  color: #9ac0d4;
}

.menu nav .d-flex .form-control:focus {
  outline: none;
  box-shadow: inset 0 3px 0 0 #286586;
}

.menu nav .btn-search {
  background: linear-gradient(to bottom, #ffffff 0%, #d7d7d7 100%);
  border: none;
  height: 36px;
  color: #4e4c4c;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-ui);
  border-radius: 0 5px 5px 0;
  padding: 0 12px;
}

.menu nav .btn-search:hover {
  background: linear-gradient(to bottom, #eeeeee 0%, #c5c5c5 100%);
}

/* ─── Content wrapper ─────────────────────────────────────────────── */

.content {
  padding-top: 10px;
}

.content .container {
  position: relative;
}

.content-wrapper {
  position: relative;
  background:
    url("../img/frame-top-left.png"),
    url("../img/frame-top-right.png"),
    url("../img/frame-bottom-left.png"),
    url("../img/frame-bottom-right.png"),
    url("../img/frame-top.png"),
    url("../img/frame-left.png"),
    url("../img/frame-right.png"),
    url("../img/frame-bottom.png"),
    var(--color-panel);
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat-x, repeat-y, repeat-y, repeat-x;
  background-position: top left, top right, bottom left, bottom right, top, left, right, bottom;
  padding: 30px;
}

.corner-top-left {
  position: absolute;
  background: url("../img/corner.png") no-repeat;
  width: 169px;
  height: 112px;
  top: -10px;
  left: -16px;
  pointer-events: none;
}

.corner-top-right {
  position: absolute;
  background: url("../img/corner.png") no-repeat;
  transform: scaleX(-1);
  width: 169px;
  height: 112px;
  top: -10px;
  right: -16px;
  pointer-events: none;
}

/* ─── Main content column ─────────────────────────────────────────── */

.main-content {
  padding: 15px 15px; /* match BS3 col-xs-8 inner padding (15px each side) */
  overflow: hidden;
}

/* ─── Box component ───────────────────────────────────────────────── */

.box {
  margin-bottom: 30px;
  overflow: hidden;
}

.box .head {
  background: var(--color-primary);
  height: 40px;
  border-radius: 5px 5px 0 0;
  line-height: 40px;
  text-align: center;
  color: white;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.box .box-content {
  background: var(--color-panel-content);
  padding: 20px;
  border: 1px solid white;
  box-shadow: -1px 0 0 0 var(--color-panel-border), 1px 1px 0 0 var(--color-panel-border), -1px 1px 0 0 var(--color-panel-border), 1px 0 0 0 var(--color-panel-border);
  margin: 0 1px;
  border-radius: 0 0 5px 5px;
}

/* News card */
.news {
  background: var(--color-panel-content);
  border-radius: 5px;
  border: 1px solid #fff;
  box-shadow: -1px -1px 0 0 var(--color-panel-border), 1px 1px 0 0 var(--color-panel-border), -1px 1px 0 0 var(--color-panel-border), 1px -1px 0 0 var(--color-panel-border);
  padding: 20px;
  margin-bottom: 30px;
}

.news img { max-width: 100%; }

.news h3 {
  font-size: 18px;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-weight: 700;
  margin: 0;
}

.news .separator {
  width: 100%;
  height: 2px;
  background: #f7f9fa;
  border-top: 1px solid var(--color-panel-separator);
  margin: 20px 0;
}

.news p {
  font-size: 14px;
  line-height: 24px;
  font-family: var(--font-body);
}

.news .timestamp {
  font-family: var(--font-body);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
}

.news .comments a {
  color: #49A9D4;
  font-family: var(--font-body);
  font-size: 13px;
}

.news .author {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: -10px;
}

.news .author strong { font-family: var(--font-body); font-weight: 600; }

/* ─── Right panel ─────────────────────────────────────────────────── */

.right-panel {
  padding: 15px 15px 15px 15px; /* match BS3 col-xs-4 inner padding (15px each side) */
}

.right-panel .latest-posts ul {
  list-style-type: none;
}

.right-panel .latest-posts ul .item {
  padding-bottom: 2px !important;
  margin-bottom: 5px !important;
}

.right-panel .latest-posts ul .item .info {
  font-family: var(--font-body);
  font-size: 12px;
  color: #8397A0;
}

.right-panel .latest-posts ul li a {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: #607d8b;
}

.right-panel .box .box-content .item {
  border-bottom: 1px solid var(--color-panel-separator);
  box-shadow: 0 1px 0 0 #f7f9fa;
  padding-bottom: 10px;
  margin-bottom: 20px;
  width: 100%;
}

.right-panel .box .box-content .item:last-child {
  border-bottom: none;
  box-shadow: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.right-panel .box .box-content .item .item-head {
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--color-panel-separator);
  box-shadow: 0 1px 0 0 #f7f9fa;
  display: table;
}

.right-panel .box .box-content .item .item-head-castle-wars {
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  display: block;
  text-align: center;
}

.right-panel .box .box-content .item .wrap {
  overflow: hidden;
  width: 100%;
}

.right-panel .box .box-content .item .wrap-castle-wars {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 400px;
  margin: 0 auto;
}

.right-panel .box .box-content .item .wrap .left { float: left; }

.right-panel .box .box-content .item .wrap .left-castle-wars {
  float: left;
  padding-right: 20px;
  border-right: 1px solid var(--color-panel-separator);
  box-shadow: 1px 0 0 0 #f7f9fa;
}

.right-panel .box .box-content .item .wrap .left img {
  max-width: 60px;
  max-height: 60px;
}

.right-panel .box .box-content .item .wrap .right { margin-left: 70px; }
.right-panel .box .box-content .item .wrap .right-castle-wars { margin-left: 20px; }

.right-panel .box .box-content .item .wrap .right .title {
  color: var(--color-text);
  font-size: 16px;
  font-family: var(--font-heading);
  font-weight: 700;
}

.right-panel .box .box-content .item .wrap .right .info {
  color: var(--color-text-muted);
  font-size: 13px;
  font-family: var(--font-body);
}

/* ─── Slider / header ─────────────────────────────────────────────── */

header .container .slider {
  height: 250px;
}

header .container .slider .slick-dots { bottom: -25px; }

header .container .slider .item {
  position: relative;
  height: 250px;
}

header .container .slider .item img {
  position: absolute;
  z-index: 111;
  top: 0;
  height: 100%;
}

header .container .slider .item h2 {
  font-size: 60px;
  font-family: var(--font-body);
  text-shadow: 0 3px 3px rgba(0, 0, 0, 0.9);
  color: white;
  font-weight: 700;
  position: relative;
  z-index: 222;
}

header .container .slider .item p {
  color: white;
  text-shadow: 0 3px 3px rgba(0, 0, 0, 0.9);
  font-size: 19px;
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 28px;
  position: relative;
  z-index: 222;
}

/* ─── Logged account panel ────────────────────────────────────────── */

.logged-account .tab-pane {
  box-sizing: border-box;
  padding: 20px;
}

.logged-account .tab-pane span {
  font-family: var(--font-body);
  color: white;
  text-shadow: 0 1px 0 #2C546B;
  font-size: 13px;
}

.logged-account .tab-pane span.value { font-family: var(--font-body); font-weight: 600; }

/* ─── Buttons ─────────────────────────────────────────────────────── */

.btn-blue {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14px;
  height: 28px;
  line-height: 26px;
  color: white;
  background: linear-gradient(to bottom, var(--color-primary-mid) 0%, var(--color-primary-dark) 100%);
  border-radius: 5px;
  border: none;
  margin: 0 5px;
  transition: filter 0.15s;
}

.btn-blue:hover {
  color: white;
  filter: brightness(1.1);
}

.btn-silver {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14px;
  height: 28px;
  line-height: 26px;
  color: #464646;
  background: linear-gradient(to bottom, #ffffff 0%, #d7d7d7 100%);
  border-radius: 5px;
  border: none;
  margin: 0 5px;
}

.btn.btn-positive {
  font-family: var(--font-ui);
  font-weight: 700;
  color: white;
  background: linear-gradient(to bottom, var(--color-primary-mid) 0%, var(--color-primary-dark) 100%);
}

/* ─── Form inputs ─────────────────────────────────────────────────── */

input[type="text"],
input[type="password"],
input[type="email"],
input[type="name"],
input[type="number"] {
  padding: 7px 10px;
  border: 1px solid #bfc7ce;
  border-radius: 6px;
  background-color: #fff;
  font-size: 14px;
  transition: all 0.2s ease;
}

input:focus {
  border-color: #5aa7d6;
  outline: none;
  box-shadow: 0 0 4px rgba(90, 167, 214, 0.6);
}

input[readonly] {
  background-color: #f1f3f5;
  color: #666;
  cursor: not-allowed;
  border-color: #d6dbe0;
}

input[type="checkbox"] {
  transform: scale(1.1);
  margin-right: 6px;
}

/* Restore BS3 .form-group margin (removed in BS5) */
.form-group {
  margin-bottom: 15px;
}

/* Restore BS3 .help-block positioning */
.help-block {
  display: block;
  margin-top: 5px;
}

/* ─── Tables ──────────────────────────────────────────────────────── */

/* Reset BS5 table defaults - the site uses custom table classes not .table */
table {
  border-collapse: collapse;
}

.who-is-online .country  { width: 10%; }
.who-is-online .name     { width: 30%; }
.who-is-online .guild    { width: 25%; }
.who-is-online .level    { width: 25%; }
.who-is-online .vocation { width: 20%; }
.who-is-online tr        { height: 30px; }
.who-is-online tr:nth-child(even) { background: #DBE2E4; }

.table-heading-separator {
  border-bottom: 1px solid var(--color-panel-separator);
  box-shadow: 0 1px 0 0 #f7f9fa;
  margin-bottom: 10px;
  display: block;
}

.Table3, .Table5 { width: 100%; }
.BigButton { height: 25px; }
.TableContentAndRightShadow { background-image: none !important; }
.main-content table img { max-width: 450px; }

.guild-list,
.guild-show-list {
  border-collapse: collapse;
  width: 100%;
}

.guild-list th,
.guild-show-list th { background-color: var(--color-primary); }

.guild-list .table-heading,
.guild-show-list .table-heading { height: 30px; }

.guild-list .guild-logo,
.guild-show-list .guild-logo { width: 10%; text-align: center; padding: 5px; }

.guild-list .name,
.guild-show-list .name { width: 55%; }

.guild-list .view,
.guild-show-list .view { text-align: center; padding: 5px; width: 15%; }

.guild-list tr:nth-child(even)  { background: #DBE2E4; }
.guild-list tr:nth-child(odd)   { background: #c5d0d3; }
.guild-list td                  { height: 25px; }

.guild-show-list .even { background: #DBE2E4; }
.guild-show-list .odd  { background: #c5d0d3; }
.guild-show-list td    { height: 25px; }

.gunz-table {
  border-collapse: collapse;
  width: 100%;
}

.gunz-table th,
.gunz-table td { border: 1px solid #efedef; padding-left: 5px; }

.gunz-table td { height: 30px; }
.gunz-table tr:nth-child(even) { background: #DBE2E4; }
.gunz-table tr:nth-child(odd)  { background: #c5d0d3; }
.gunz-table th { background-color: var(--color-primary); border: none; }
.gunz-table .gunz-table-head td { font-weight: bold; text-align: center; }
.gunz-table .gunz-table-centered { text-align: center; }

.forum-table {
  border-collapse: collapse;
  width: 100%;
}

.forum-table th,
.forum-table td { border: 1px solid #efedef; padding-left: 5px; }

.forum-table td { height: 30px; }
.forum-table .even { background: #DBE2E4; }
.forum-table .odd  { background: #c5d0d3; }
.forum-table th    { background-color: var(--color-primary); border: none; }
.forum-table .forum-post  { height: 150px; }
.forum-table .post-author { vertical-align: top; width: 30%; }
.forum-table .post-text   { vertical-align: top; width: 70%; }
.forum-table .post-info   { vertical-align: top; height: 50px; }

.forum-pages { text-align: center; font-size: 15px; }

.create-guild th { background-color: var(--color-primary); padding: 6px; }
.create-guild td { height: 30px; padding: 7px; }
.create-guild tr:nth-child(even) { background: #DBE2E4; }

.death-list, .death-list th, .death-list td { padding-left: 5px; }

/* ─── Buy points ──────────────────────────────────────────────────── */

.buypoints .box-content { overflow: hidden; }

.buypoints a {
  margin-bottom: 30px;
  display: block;
  width: 30%;
  margin-right: 5%;
  float: left;
}

.buypoints a img { width: 100%; }
.buypoints a:nth-child(3) { margin-right: 0; }

/* ─── Countdown ───────────────────────────────────────────────────── */

.countdown {
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 600;
  color: #556873;
}

.countdown #cntdwn {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: #556873;
}

.countdown-event { font-family: var(--font-ui); font-weight: 600; color: #556873; }

.countdownspecial {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  color: #556873;
}

.countdownspecial #cntdwnspecial {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: green;
}

/* ─── Misc helpers ────────────────────────────────────────────────── */

.error { font-style: normal; color: red; font-weight: bold; }

.record { margin-bottom: 20px; font-family: var(--font-body); }
.record .title { color: #5BB5E8; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.record .value { color: #556873; font-family: var(--font-body); font-size: 14px; }
.record .input-value { display: block; background: white; width: 100%; border: none !important; height: 32px; border-radius: 3px; }
.record .radio-value { color: #556873; font-family: var(--font-body); line-height: 24px; }

.no-padding { padding: 0 !important; }
.negative   { color: #e74c3c !important; }
.positive   { color: #2ecc71 !important; }

.aac-management td,
.aac-management th {
  border-top: none !important;
  border-bottom: none !important;
  font-family: var(--font-body);
  color: #556873;
}

.aac-management th { font-family: var(--font-heading); font-size: 13px; font-weight: 700; letter-spacing: 0.5px; color: #5BB5E8; }
.aac-management td { vertical-align: middle !important; }

.green-notification { color: green; font-size: 16px; text-align: center; }
.red-notification   { color: red;   font-size: 16px; text-align: center; }
.font-big           { font-weight: bold; font-size: 24px; }

.guild-information .guild-name { font-size: 25px; font-weight: bold; }
.guild-information { padding-left: 30px; }

#comment { max-width: 80%; width: 80%; }
.help-block { color: red; }

.borderless td,
.borderless th { border: none; }

.btn-margin {
  margin-top: 5px !important;
  margin-left: 5px !important;
  margin-bottom: 5px !important;
}

.pd-10 { padding: 10px; }
.mb-10 { margin-bottom: 10px; }
.footer-small-text { font-size: 10px; }
.grecaptcha-badge  { visibility: hidden; }

/* ─── iOS-style switch ────────────────────────────────────────────── */

.ios-switch {
  display: inline-block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ios-switch i {
  position: relative;
  display: inline-block;
  margin-right: 0.5rem;
  width: 46px;
  height: 26px;
  background-color: #e6e6e6;
  border-radius: 23px;
  vertical-align: text-bottom;
  transition: all 0.3s linear;
}

.ios-switch i::before {
  content: "";
  position: absolute;
  left: 0;
  width: 42px;
  height: 22px;
  background-color: #fff;
  border-radius: 11px;
  transform: translate3d(2px, 2px, 0) scale3d(1, 1, 1);
  transition: all 0.25s linear;
}

.ios-switch i::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 22px;
  background-color: #fff;
  border-radius: 11px;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.24);
  transform: translate3d(2px, 2px, 0);
  transition: all 0.2s ease-in-out;
}

.ios-switch:active i::after { width: 28px; transform: translate3d(2px, 2px, 0); }
.ios-switch:active input:checked + i::after { transform: translate3d(16px, 2px, 0); }
.ios-switch input { display: none; }
.ios-switch input:checked + i { background-color: #4BD763; }
.ios-switch input:checked + i::before { transform: translate3d(18px, 2px, 0) scale3d(0, 0, 0); }
.ios-switch input:checked + i::after  { transform: translate3d(22px, 2px, 0); }
