/* AcademyMU - responsive layout + shared look for tables and text.
   Loaded after every other theme stylesheet, so it only adjusts what is needed. */

/* ---------- shared typography (all widths) ---------- */
/* one body font everywhere in page content (some pages had switched to Arial) */
#content :is(.modules_cont, .col-xs-12) :is(p, li, td, dd, dt, label, small, input, select, textarea) {
	font-family: Tahoma, 'PT Sans', sans-serif;
}
.modules_cont,
#container.modules_cont_full #content > .col-xs-12 {
	font-size: 14px;
	line-height: 1.6;
}
.modules_cont p,
.modules_cont li { font-size: 14px; line-height: 1.6; }

/* page titles: same font, size and colour on every page (Cinzel gold, like the menu and rankings) */
#content .page-title,
#content :is(.modules_cont, .col-xs-12) h1.page-title {
	margin: 0 0 18px !important;
	padding: 0 0 10px !important;
	border-bottom: 1px solid rgba(255,138,42,.18);
	color: #d4b27a !important;
	font-family: 'Cinzel', Georgia, serif !important;
	font-size: 20px !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	letter-spacing: 1.5px !important;
	text-transform: uppercase;
	text-align: left;
}
#content .page-title::before { color: #61656a; }
/* pages that use their own <h1> as the title get the same look */
#content :is(.modules_cont, .col-xs-12) h1 {
	color: #d4b27a !important;
	font-family: 'Cinzel', Georgia, serif !important;
	font-size: 24px !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	letter-spacing: 1px !important;
}
#content :is(.modules_cont, .col-xs-12) h2 { font-size: 20px; line-height: 1.35; }
#content :is(.modules_cont, .col-xs-12) h3 { font-size: 17px; line-height: 1.4; }
#content :is(.modules_cont, .col-xs-12) h4 { font-size: 15px; }
.modules_cont small,
.modules_cont .small { font-size: 12px; }

/* ---------- shared table look (all widths) ---------- */
.modules_cont table,
.modules_cont_full table { max-width: 100%; }
.modules_cont .table,
.modules_cont_full .table { font-size: 13px; }
.modules_cont .table > thead > tr > th,
.modules_cont_full .table > thead > tr > th {
	font-size: 12px;
	letter-spacing: .03em;
	vertical-align: middle;
}
.modules_cont .table > tbody > tr > td,
.modules_cont_full .table > tbody > tr > td { vertical-align: middle; }

/* One table look for the whole site, taken from the Rankings tables (dark red glass, gold Cinzel headers).
   Applies to user panel, merchant/deliveries, castle siege, guides and the old rankings tables.
   !important is needed because many of these tables carry inline styles. */
#content :is(.general-table-ui, .we-ranking-style-table, .rankings-table, .csx-table, .sp-history-table, .guide-content table) {
	border-collapse: separate !important;
	border-spacing: 0 !important;
	background: linear-gradient(135deg, rgba(27,31,35,.95) 0%, rgba(21,24,27,.98) 100%) !important;
	border: 1px solid rgba(255,138,42,.18) !important;
	border-radius: 10px !important;
	overflow: hidden;
	font-size: 13px !important;
	box-shadow: 0 10px 28px rgba(0,0,0,.45) !important;
}
/* header cells: real <th>, or the first row where old WebEngine tables use <td> as headers */
#content :is(.general-table-ui, .we-ranking-style-table, .rankings-table, .csx-table, .sp-history-table, .guide-content table) th,
#content :is(.general-table-ui, .rankings-table) > tbody:first-child > tr:first-child > td {
	padding: 12px 10px !important;
	background: linear-gradient(180deg, rgba(38,43,48,.95) 0%, rgba(27,31,35,.9) 100%) !important;
	color: #ff9a45 !important;
	font-family: 'Cinzel', serif !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	text-transform: uppercase;
	letter-spacing: .5px;
	border: 0 !important;
	border-bottom: 1px solid rgba(255,138,42,.22) !important;
	vertical-align: middle !important;
}
#content :is(.general-table-ui, .we-ranking-style-table, .rankings-table, .csx-table, .sp-history-table, .guide-content table) td {
	padding: 10px !important;
	color: #e7e9eb !important;
	background: transparent !important;
	border: 0 !important;
	border-bottom: 1px solid rgba(255,138,42,.08) !important;
	vertical-align: middle !important;
}
#content :is(.general-table-ui, .we-ranking-style-table, .rankings-table, .csx-table, .sp-history-table, .guide-content table) tr:nth-child(even) > td {
	background: rgba(0,0,0,.14) !important;
}
#content :is(.general-table-ui, .we-ranking-style-table, .rankings-table, .csx-table, .sp-history-table, .guide-content table) tr:hover > td {
	background: rgba(255,138,42,.1) !important;
}
#content :is(.general-table-ui, .rankings-table) > tbody:first-child > tr:first-child:hover > td { background: linear-gradient(180deg, rgba(38,43,48,.95) 0%, rgba(27,31,35,.9) 100%) !important; }
#content :is(.general-table-ui, .we-ranking-style-table, .rankings-table, .csx-table, .sp-history-table, .guide-content table) tr:last-child > td { border-bottom: 0 !important; }
#content .guide-content table { margin: 16px 0 !important; }

/* news share buttons */
.we-news-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 4px; padding-top: 14px; border-top: 1px solid rgba(255,138,42,.18); font-size: 13px; }
.we-news-older .we-news-share { margin: 0 14px 14px; }
.we-news-share-label { color: #ff9a45; font-family: 'Cinzel', Georgia, serif; font-weight: 700; letter-spacing: .5px; margin-right: 2px; }
.we-share-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid rgba(255,255,255,.14); border-radius: 4px; background: rgba(0,0,0,.35); color: #e7e9eb !important; font-size: 12px; line-height: 1; text-decoration: none !important; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.we-share-btn:hover { color: #fff !important; }
.we-share-facebook:hover { background: #1877f2; border-color: #1877f2; }
.we-share-x:hover { background: #000; border-color: #555; }
.we-share-whatsapp:hover { background: #1fa855; border-color: #1fa855; }
.we-share-telegram:hover { background: #229ed9; border-color: #229ed9; }
.we-share-link:hover, .we-share-link.is-copied { background: rgba(255,138,42,.25); border-color: #ff9a45; }
@media (max-width: 600px) { .we-share-btn span { display: none; } .we-share-btn { padding: 9px 11px; } .we-share-link.is-copied span { display: inline; } }

/* wide content (tables, embeds) scrolls inside its own box instead of the page */
.rsp-scroll {
	display: block;
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
img, video, iframe { max-width: 100%; }
img { height: auto; }

/* ---------- tablet: narrower side columns ---------- */
@media (max-width: 1240px) {
	html { min-width: 0 !important; }
	.nav-right .lang-select { margin-left: 12px !important; margin-right: 0 !important; }
	.navigation-top-in { padding-left: 10px !important; padding-right: 10px !important; box-sizing: border-box; }
	#container { width: 100% !important; max-width: 1200px; box-sizing: border-box; padding-left: 8px; padding-right: 8px; }
	.header-info-container { width: auto !important; max-width: 1190px; margin-left: 10px !important; margin-right: 10px !important; }
	.ui-left { min-width: 0 !important; }
	.footer { width: auto !important; max-width: 1040px; box-sizing: border-box; margin-left: 10px !important; margin-right: 10px !important; }
	.sparks { width: 100% !important; left: 0 !important; margin-left: 0 !important; overflow: hidden; }
	.sidebar { width: 250px !important; box-sizing: border-box; }
	.sidebar .panel-sidebar { width: auto !important; max-width: 100%; }
	.floating-nav { flex-wrap: nowrap !important; max-width: calc(100vw - 16px); overflow-x: auto; white-space: nowrap; }
	.main_side { width: calc(100% - 500px) !important; max-width: calc(100% - 500px) !important; }
}

/* ---------- phone / small tablet: one column ---------- */
@media (max-width: 991px) {
	/* the background art carries the logo: scale it down and start it below the wrapped menu */
	body, html { background-size: 1000px auto, auto !important; background-position: center 95px, center bottom !important; }
	#body { overflow-x: hidden; }

	/* top navigation wraps instead of running off screen */
	#rz-scrollbar { display: none !important; }
	#navigation-top, .navigation-top-in { width: 100% !important; min-width: 0 !important; height: auto !important; box-sizing: border-box; }
	#navigation-top { margin: 0 !important; position: relative !important; }
	#navigation-top .navigation-top-in { height: auto !important; min-height: 0 !important; }
	.navigation-top-in { flex-wrap: wrap !important; justify-content: center !important; gap: 6px; padding: 6px 8px !important; }
	#cssmenu { width: 100% !important; float: none !important; }
	#cssmenu > ul { display: flex !important; flex-wrap: wrap !important; justify-content: center !important; gap: 4px; margin: 0 !important; padding: 0 !important; height: auto !important; }
	#cssmenu > ul > li { float: none !important; margin: 0 !important; }
	#cssmenu > ul > li > a { padding: 7px 10px !important; font-size: 11px !important; }
	.nav-right { width: 100% !important; height: auto !important; justify-content: center !important; flex-wrap: wrap !important; gap: 6px; position: static !important; margin: 0 !important; }
	.nav-right .my-account { width: auto !important; height: auto !important; margin: 0 !important; gap: 6px; }
	.nav-right .lang-select, .nav-right .custom-lang-dropdown, .nav-right .lang-dropdown-trigger { min-width: 0 !important; width: auto !important; margin: 0 !important; }
	.lang-dropdown-menu { left: auto; right: 0; max-height: 60vh; overflow-y: auto; }

	/* header artwork */
	#header { width: 100% !important; padding-top: 20px !important; }
	.header-logo-space { height: 150px !important; }

	/* action chips */
	.header-info-container { margin: 0 10px 10px !important; }
	.ui-row { flex-wrap: wrap; gap: 0 !important; padding: 0 !important; margin: 0 !important; }
	.ui-left { width: 100%; flex: 1 1 100%; }
	.header-info-container, .ui-row, .ui-left, .glass-strip { height: auto !important; }
	.glass-strip { flex-wrap: wrap !important; gap: 6px; }
	.glass-chip { flex: 1 1 100px !important; min-width: 0 !important; width: auto !important; height: auto !important; min-height: 0 !important; padding: 10px 6px !important; }
	.glass-chip .chip-title { font-size: 13px !important; }
	.glass-chip .chip-sub { font-size: 10px !important; }

	/* columns stack: page content first, account panel next, widgets last */
	#container, #container.modules_cont_full { width: 100% !important; padding: 0 8px 16px !important; margin: 0 !important; }
	#content { display: flex; flex-direction: column; gap: 12px; padding: 0 !important; overflow: visible !important; min-height: 0; }
	#content > .sidebar,
	#content > .main_side { float: none !important; width: 100% !important; max-width: 100% !important; padding: 0 !important; }
	#content > .main_side { order: 1; }
	#content > .sidebar-r { order: 2; }
	#content > .sidebar:not(.sidebar-r) { order: 3; }
	#content > .col-xs-12 { width: 100%; padding: 0; float: none; }
	.modules_cont { float: none !important; padding: 10px !important; box-sizing: border-box; min-height: 0 !important; }
	.panel-sidebar { margin-bottom: 12px; }
	.sidebar-banner { text-align: center; }
	.sidebar-banner img { width: 100%; max-width: 360px; }

	/* bootstrap rows inside modules must not poke out of the box */
	.modules_cont .row, .modules_cont_full .row { margin-left: 0 !important; margin-right: 0 !important; }
	.modules_cont [class*="col-"], .modules_cont_full [class*="col-"] { padding-left: 0; padding-right: 0; }
	.modules_cont .row > [class*="col-xs-"]:not(.col-xs-12) { padding-left: 4px; padding-right: 4px; }

	/* the scroll-in menu bar: one swipeable row without a visible scrollbar */
	.floating-nav { scrollbar-width: none; }
	.floating-nav::-webkit-scrollbar { display: none; }

	.footer { margin: 16px 8px 40px !important; padding: 20px 14px !important; text-align: center; }
	.footer [class*="col-"] { float: none !important; width: 100% !important; text-align: center !important; margin-bottom: 10px; }
}

@media (max-width: 600px) {
	.header-logo-space { height: 135px !important; }
	#content .page-title, #content :is(.modules_cont, .col-xs-12) h1.page-title { font-size: 17px !important; letter-spacing: 1px !important; }
	#content :is(.modules_cont, .col-xs-12) h1 { font-size: 20px !important; }
	#content :is(.modules_cont, .col-xs-12) h2 { font-size: 18px; }
	#content :is(.modules_cont, .col-xs-12) h3 { font-size: 16px; }
	.modules_cont .table, .modules_cont_full .table { font-size: 12px; }
	.modules_cont .table > thead > tr > th, .modules_cont .table > tbody > tr > td,
	.modules_cont_full .table > thead > tr > th, .modules_cont_full .table > tbody > tr > td { padding: 6px 5px !important; }
	.form-control, input[type=text], input[type=password], input[type=email], input[type=number], select, textarea { font-size: 16px !important; } /* stops iOS zoom-on-focus */
	.btn { white-space: normal; }
	/* rankings: use the full width; the many-column table swipes sideways inside its card */
	#content .rankings-glass-container { padding: 0 !important; margin: 10px 0 !important; }
	#content .rankings-glass-menu { gap: 6px !important; margin-bottom: 14px !important; }
	#content .rankings-glass-menu a { padding: 8px 12px !important; font-size: 11px !important; letter-spacing: .5px !important; }
	#content .rankings-glass-table-wrap { border-radius: 12px !important; }
	#content .rankings-glass-table-wrap th, #content .rankings-glass-table-wrap td { padding: 9px 7px !important; }
	#content .table-responsive { border: 0 !important; margin-bottom: 12px; }
	/* let cells wrap so short tables fit the screen instead of scrolling */
	#content .table-responsive > .table > thead > tr > th,
	#content .table-responsive > .table > tbody > tr > td,
	#content .we-ranking-style-table th, #content .we-ranking-style-table td { white-space: normal !important; }
	#content .we-ranking-style-table { min-width: 0 !important; }
	#content .amount-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
	#content .csx-table--schedule td + td { white-space: nowrap; font-size: 11px !important; padding: 8px 6px !important; }
}

/* ---------- all widths: small fixes found during the mobile pass ---------- */
/* the Top Guilds panel is printed empty when there is no guild data: hide the empty shell */
.sidebar > .panel-sidebar:not(:has(*)) { display: none !important; }
/* page forms (register, login, password reset): gold call-to-action like the rest of the site */
.modules_cont .form-horizontal .btn-primary {
	padding: 9px 22px;
	border: 1px solid #8f6a2c !important;
	border-radius: 6px;
	background: linear-gradient(180deg, #dcb763, #b0823a) !important;
	color: #11151a !important;
	font-weight: 800;
	letter-spacing: .02em;
	text-shadow: none;
	box-shadow: none;
}
.modules_cont .form-horizontal .btn-primary:hover,
.modules_cont .form-horizontal .btn-primary:focus { filter: brightness(1.08); color: #11151a !important; }

/* ---------- mobile polish (Nov 2026) ---------- */
@media (max-width: 991px) {
	/* the panel header art is drawn for the 282px desktop sidebar: stretch it across wider panels */
	.panel-sidebar { background-size: 100% 170px, auto !important; }
	/* sidebar banners keep their height while they lazy-load, so the page does not jump */
	.sidebar-banner { margin: 0 0 12px !important; }
	.sidebar-banner img { display: block; margin: 0 auto; aspect-ratio: 3 / 1; object-fit: cover; }
	/* forms inside page content: bootstrap's negative form-group margins were cut off by .modules_cont */
	.modules_cont .form-horizontal .form-group { margin-left: 0 !important; margin-right: 0 !important; }
	.modules_cont .form-horizontal .control-label { text-align: left !important; padding-top: 0 !important; margin-bottom: 6px; }
	/* rankings: hint that the wide table scrolls sideways */
	#content .rankings-glass-table-wrap { position: relative; }
	#content .rankings-glass-table-wrap::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 28px; pointer-events: none; border-radius: 0 12px 12px 0; background: linear-gradient(90deg, rgba(11,15,20,0), rgba(11,15,20,.85)); }
}

/* tablets: the side widgets sit two per row instead of stretching across the whole screen */
@media (min-width: 600px) and (max-width: 991px) {
	#content > .sidebar { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
	#content > .sidebar > * { min-width: 0; margin: 0 !important; }
	#content > .sidebar-r > .panel-sidebar:first-child { grid-column: 1 / -1; }
	#content > .sidebar > hr, #content > .sidebar > .clearfix { display: none; }
	.sidebar-banner img { max-width: 100%; }
}

@media (max-width: 600px) {
	/* top menu: compact so the five English links fit on one row; longer translations wrap to a second row */
	#cssmenu > ul { flex-wrap: wrap !important; gap: 3px; }
	#cssmenu > ul > li > a { padding: 7px 6px !important; font-size: 10px !important; letter-spacing: .2px !important; white-space: nowrap; }
	/* login page form was only 2/3 of the screen wide */
	.modules_cont .col-xs-8.col-xs-offset-2 { width: 100% !important; margin-left: 0 !important; }
	/* castle siege emblem: smaller on phones */
	.cs-square--xl > div { width: 128px !important; height: 128px !important; font-size: 52px !important; }
	/* page forms: full-width submit button, comfortable to tap */
	.modules_cont .form-horizontal .btn-primary { display: block; width: 100%; min-height: 44px; font-size: 15px; }
	.modules_cont .form-horizontal [class*="col-sm-offset"] { margin-left: 0 !important; }
	/* top resets: show rank, class, player, VIP and resets; the other columns stay on larger screens */
	#content .rankings-glass-table-wrap .rk-opt { display: none !important; }
}

@media (max-width: 420px) {
	#cssmenu > ul { gap: 2px; }
	#cssmenu > ul > li > a { padding: 6px 4px !important; font-size: 9.5px !important; letter-spacing: 0 !important; }
}

/* ==========================================================================
   AcademyMU design polish: one palette and one type scale for the whole site.
   Layout is unchanged; this only aligns colours, fonts and small details.
   ========================================================================== */
:root {
	--ac-gold: #d9b45f;
	--ac-gold-hi: #f0d58c;
	--ac-gold-lo: #a8874a;
	--ac-title: #d4b27a;
	--ac-text: #e6dfd3;
	--ac-muted: #a99f92;
	--ac-line: rgba(217,180,95,.18);
	--ac-line-strong: rgba(217,180,95,.35);
	--ac-btn: linear-gradient(180deg, #dcb763, #b0823a);
	--ac-btn-border: #8f6a2c;
	--ac-btn-text: #11151a;
	--ac-font: Tahoma, 'PT Sans', sans-serif;
	--ac-head: 'Cinzel', Georgia, serif;
}

/* sidebar widgets: same fonts as the page content instead of Times New Roman */
.panel-sidebar > .panel-heading,
.panel-sidebar > .panel-heading .panel-title {
	font-family: var(--ac-head) !important;
	color: var(--ac-title) !important;
	font-weight: 700 !important;
	font-size: 12px !important;
	letter-spacing: 1.4px;
}
.panel-sidebar .panel-body,
.panel-sidebar .panel-body :is(td, th, span, strong, b, a, li, p, div, label, input, button) {
	font-family: var(--ac-font) !important;
}
.panel-sidebar .panel-body .ua-login input::placeholder { color: #7f8388; }

/* header shortcut chips: the highlighted one uses the gold palette (it was green) */
.glass-chip.is-primary {
	background-image: linear-gradient(rgba(217,180,95,.18), rgba(255,255,255,.03)) !important;
	border-color: rgba(217,180,95,.34) !important;
}

/* sidebar Sign In: same gold call-to-action as Register and the page forms (was the only red button) */
.panel-sidebar .ua-actions .ua-cta.ua-cta--login,
.panel-sidebar .ua-actions .ua-cta.ua-cta--login:hover,
.panel-sidebar .ua-actions .ua-cta.ua-cta--login:focus-visible {
	background: var(--ac-btn) !important;
	border: 1px solid var(--ac-btn-border) !important;
	color: var(--ac-btn-text) !important;
	white-space: nowrap;
	text-shadow: none !important;
	box-shadow: 0 6px 16px rgba(0,0,0,.45) !important;
}
.panel-sidebar .ua-actions .ua-cta.ua-cta--login:hover { filter: brightness(1.08); }
.panel-sidebar .ua-actions .ua-cta.ua-cta--login span { color: var(--ac-btn-text) !important; font-weight: 800; }

/* footer: as wide as the page columns and centred under them */
@media (min-width: 992px) {
	.footer { width: auto !important; max-width: 1200px !important; margin-left: auto !important; margin-right: auto !important; box-sizing: border-box; }
	.footer > .footer-glass { width: 100% !important; max-width: none !important; box-sizing: border-box; }
}

/* market filter: four flexible fields instead of fixed widths that cut the labels */
#content .we-market-filter {
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) auto !important;
	gap: 8px !important;
}
#content .we-market-filter > :is(input[type=search], select) { width: 100% !important; min-width: 0 !important; }
@media (max-width: 600px) {
	#content .we-market-filter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
	#content .we-market-filter > input[type=search] { grid-column: 1 / -1; }
	#content .we-market-filter > button { grid-column: 1 / -1; }
}

/* footer on phones and tablets: links and social icons centred like the text under them */
@media (max-width: 991px) {
	.footer .footer-links-row, .footer .footer-socials { justify-content: center !important; }
}

/* links inside page content: one gold accent */
#content .modules_cont a:not([class]) { color: var(--ac-gold); }
#content .modules_cont a:not([class]):hover { color: var(--ac-gold-hi); }
