/* ==========================================================================
   TRAVIAN LEGENDS - AUTHENTIC MEDIEVAL THEME & LAYOUT ENGINE
   ========================================================================== */

:root {
  --bg-parchment: #f4ecd8;
  --bg-parchment-dark: #e8dcbe;
  --bg-stone: #2e261d;
  --bg-stone-dark: #1a140e;
  --border-stone: #78654c;
  --border-gold-emboss: #d4af37;
  --border-wood: #5c3a21;
  --text-dark: #2c1a0e;
  --text-gold: #fef08a;
  --text-parchment: #f5eedc;
}

body.travian-theme {
  background: #5b7c26 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" opacity="0.05"><path d="M0 0h100v100H0z" fill="%23000"/></svg>');
  color: #fff;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Creator Attribution Banner */
.creator-badge-top {
  background: rgba(15, 10, 5, 0.92);
  color: var(--border-gold-emboss);
  text-align: center;
  font-size: 0.76rem;
  padding: 4px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

/* ==========================================================================
   1. TOP TRAVIAN MEDALLION HEADER DOCK
   ========================================================================== */
.travian-top-dock {
  background: linear-gradient(180deg, #3d2f1f 0%, #20170d 100%);
  border-bottom: 3px solid #785a28;
  box-shadow: 0 4px 15px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  position: sticky;
  top: 0;
  z-index: 1000;
  gap: 12px;
}

/* Hero Avatar */
.hero-avatar-card {
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
}

.hero-avatar-card:hover { transform: scale(1.06); }

.hero-avatar-frame {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle, #5b7c26 0%, #223709 100%);
  border: 3px solid #d4af37;
  box-shadow: 0 0 10px rgba(0,0,0,0.8), inset 0 0 8px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-avatar-icon { font-size: 1.8rem; }

.hero-lvl-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: #d97706;
  border: 1px solid #fde047;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 900;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Target Highlight in Tutorial */
.tutorial-highlight-target {
  box-shadow: 0 0 0 4px #f59e0b, 0 0 25px #fde047 !important;
  border-radius: 50%;
  animation: pulseGoldTarget 1.2s infinite alternate;
  z-index: 100000 !important;
}

@keyframes pulseGoldTarget {
  0% { box-shadow: 0 0 0 3px #f59e0b, 0 0 15px #fde047; }
  100% { box-shadow: 0 0 0 6px #f59e0b, 0 0 30px #fde047; }
}

/* Medallion Navigation Dock */
.medallion-nav-dock {
  display: flex;
  gap: 8px;
}

.medallion-btn {
  background: linear-gradient(180deg, #4a3b2c 0%, #2b1f14 100%);
  border: 2px solid #8c6f45;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.15), 0 3px 6px rgba(0,0,0,0.6);
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.medallion-btn .medallion-icon {
  font-size: 1.3rem;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.8));
}

.medallion-btn .medallion-label { display: none; }

.medallion-btn:hover {
  transform: translateY(-3px) scale(1.08);
  border-color: #fde047;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.7);
}

.medallion-btn.active {
  background: linear-gradient(180deg, #78350f 0%, #451a03 100%);
  border: 2px solid #fde047;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.9);
}

.medallion-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #dc2626;
  color: white;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 10px;
  border: 1px solid white;
}

/* Resource Gauges Dock */
.resource-gauges-dock {
  display: flex;
  gap: 8px;
  background: rgba(0,0,0,0.4);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.res-gauge-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #19120a;
  border: 1px solid #4a3822;
  padding: 3px 8px;
  border-radius: 6px;
}

.res-g-icon { font-size: 1.1rem; }
.res-g-details { font-size: 0.82rem; font-weight: bold; font-family: monospace; }
.res-g-val { color: #fef08a; }
.res-g-cap { color: #94a3b8; font-size: 0.72rem; }

/* Right Utility Header Buttons */
.header-right-dock {
  display: flex;
  gap: 6px;
}

.icon-util-btn {
  background: #2b1f14;
  border: 1px solid #6b5335;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.icon-util-btn:hover {
  background: #4a3520;
  border-color: #fde047;
}

.icon-util-btn.logout-accent:hover {
  background: #7f1d1d;
  border-color: #ef4444;
}

/* ==========================================================================
   2. MAIN 3-COLUMN LAYOUT
   ========================================================================== */
.travian-main-layout {
  max-width: 1600px;
  margin: 12px auto;
  padding: 0 14px;
  display: grid;
  grid-template-columns: 215px 1fr 255px;
  gap: 16px;
  align-items: start;
}

/* Authentic Parchment Panels */
.parchment-panel-box {
  background: var(--bg-parchment);
  color: var(--text-dark);
  border: 2px solid #8c6f45;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
  margin-bottom: 14px;
  overflow: hidden;
}

.parchment-panel-header {
  background: linear-gradient(180deg, #4a3825 0%, #2d2012 100%);
  color: var(--text-gold);
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #9c7b4f;
}

.panel-header-title { font-weight: bold; }
.panel-toggle-btn { background: none; border: none; color: var(--text-gold); cursor: pointer; }

.parchment-panel-body {
  padding: 10px;
  font-size: 0.82rem;
}

.info-line-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 0.78rem;
}

.info-val.badge-green {
  background: #15803d;
  color: white;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.7rem;
}

.info-announcement {
  font-size: 0.75rem;
  color: #4b382a;
  line-height: 1.35;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #b5a07c;
}

.quick-links-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quick-links-list a {
  color: #854d0e;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.8rem;
  padding: 4px 6px;
  background: rgba(0,0,0,0.04);
  border-radius: 4px;
  transition: background 0.15s;
}

.quick-links-list a:hover {
  background: rgba(0,0,0,0.1);
  color: #a16207;
}

/* Right Sidebar: Player & Villages Cards */
.village-main-name {
  font-size: 0.95rem;
  color: #78350f;
}

.village-stat-pills {
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
  margin-top: 4px;
}

.culture-points-track {
  background: #d4c5a5;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.culture-points-bar {
  background: #22c55e;
  height: 100%;
}

.village-row-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

.village-row-item:hover { background: rgba(0,0,0,0.06); }

.village-row-item.active {
  background: #d97706;
  color: #fff;
  font-weight: bold;
}

/* Taskmaster Card */
.taskmaster-panel-box {
  cursor: pointer;
  background: #fdfaf3;
  border: 2px solid #b45309;
  transition: transform 0.15s;
}

.taskmaster-panel-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.7);
}

.taskmaster-avatar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.taskmaster-portrait-frame {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #92400e;
  border: 2px solid #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.taskmaster-icon { font-size: 1.5rem; }

.taskmaster-exclamation {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-weight: 900;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulseGold 1.5s infinite;
}

.taskmaster-title { font-weight: 900; font-size: 0.85rem; color: #92400e; }
.taskmaster-action-text { font-size: 0.72rem; color: #6b7280; font-weight: bold; }

.taskmaster-footer-btn {
  background: #b45309;
  color: white;
  text-align: center;
  padding: 5px;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   3. ORGANIC RESOURCE FIELDS & VILLAGE CENTER CANVAS
   ========================================================================== */
.travian-center-viewport { position: relative; }

.fields-art-wrapper, .center-plots-grid {
  position: relative;
  width: min(640px, 94vw);
  height: min(640px, 94vw);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 50%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8), inset 0 0 50px rgba(0,0,0,0.5);
  overflow: hidden;
  border: 5px solid #785a28;
}

.travian-valley-landscape, .travian-village-center-canvas {
  position: relative;
  width: 100%;
  height: 100%;
}

.valley-svg-canvas, .center-moat-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Center Village Moat Portal */
.valley-center-village-portal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(74px, 19%, 92px);
  height: clamp(74px, 19%, 92px);
  border-radius: 50%;
  background: radial-gradient(circle, #78350f 0%, #451a03 70%, #1f0e04 100%);
  border: 2.5px solid #fde047;
  box-shadow: 0 0 15px rgba(0,0,0,0.9), inset 0 0 10px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  z-index: 50;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
  padding: 4px;
  gap: 5px;
}

.valley-center-village-portal:hover {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.9);
}

.portal-icon {
  font-size: clamp(1.05rem, 3.0vw, 1.45rem);
  filter: drop-shadow(0 2px 4px #000);
  line-height: 1;
  margin-top: -2px;
}

.portal-text-title {
  font-size: clamp(0.52rem, 1.45vw, 0.64rem);
  font-weight: 900;
  color: #fef08a;
  text-shadow: 0 1px 3px #000;
  white-space: normal;
  line-height: 1.15;
  max-width: 88%;
  letter-spacing: 0.2px;
  text-align: center;
}

/* 18 Organic Resource Field Nodes */
.field-node-organic {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  gap: 1px;
}

.field-node-organic:hover {
  transform: translate(-50%, -50%) scale(1.22);
  z-index: 100;
}

.field-node-icon-badge {
  font-size: 1.35rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

/* 22 Village Center Plot Nodes */
.village-plot-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.village-plot-node:hover {
  transform: translate(-50%, -50%) scale(1.2);
  z-index: 100;
}

/* Authentic Soft Turf Empty Plot Discs */
.empty-plot-disc-turf {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #769a2d 0%, #5a7d1e 75%, #466315 100%);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3), 0 1px 2px rgba(255,255,255,0.15);
  transition: all 0.15s;
}

.village-plot-node:hover .empty-plot-disc-turf {
  background: radial-gradient(circle at 40% 40%, #8bb535 0%, #689123 75%, #527419 100%);
  border: 2px dashed #fde047;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
  transform: scale(1.15);
}

.empty-plot-disc {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, #557d19 0%, #3a580e 100%);
  border: 2px dashed #a3e635;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.empty-plot-disc .plot-num {
  font-size: 0.68rem;
  font-weight: 900;
  color: #fef08a;
  opacity: 0.8;
}

.building-miniature-icon {
  font-size: 2rem;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.8));
}

/* Authentic White Level Discs */
.field-level-disc-white {
  width: 20px;
  height: 20px;
  background: #ffffff;
  border: 2px solid #2d2012;
  border-radius: 50%;
  color: #1a140e;
  font-size: 0.72rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.8);
  margin-top: 1px;
}

.field-level-disc-white.pulsing-hammer {
  background: #f59e0b;
  color: #000;
  animation: pulseGold 1.2s infinite;
}

/* ==========================================================================
   4. FLOATING PRODUCTION & GARRISON WIDGET OVERLAY
   ========================================================================== */
.floating-production-widget {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(244, 236, 216, 0.95);
  border: 2px solid #8c6f45;
  border-radius: 8px;
  padding: 8px 12px;
  color: #2c1a0e;
  box-shadow: 0 4px 15px rgba(0,0,0,0.7);
  font-size: 0.78rem;
  width: 170px;
  z-index: 60;
}

.prod-widget-header {
  font-weight: 900;
  color: #78350f;
  margin-bottom: 4px;
  font-size: 0.75rem;
}

.prod-widget-rates {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prod-rate-row {
  display: flex;
  justify-content: space-between;
}

.prod-widget-divider {
  height: 1px;
  background: #b5a07c;
  margin: 6px 0;
}

/* ==========================================================================
   5. AUTHENTIC TRAVIAN TUTORIAL SPEECH BUBBLE & ARROW
   ========================================================================== */
.travian-tutorial-bubble {
  position: fixed;
  z-index: 999999;
  width: 320px;
  background: #2b241d;
  border: 2px solid #8c6f45;
  border-radius: 8px;
  color: #f5eedc;
  box-shadow: 0 10px 40px rgba(0,0,0,0.9), 0 0 20px rgba(245, 158, 11, 0.3);
  padding: 12px 14px;
  animation: popIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Pointer Triangle Arrow */
.tut-bubble-pointer {
  position: absolute;
  width: 0;
  height: 0;
}

.tut-bubble-pointer.top {
  top: -10px;
  left: 28px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid #2b241d;
}

.tut-bubble-pointer.right {
  top: 24px;
  right: -10px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 10px solid #2b241d;
}

.tut-bubble-pointer.left {
  top: 24px;
  left: -10px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 10px solid #2b241d;
}

.tut-bubble-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #6b5335;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.tut-bubble-title {
  font-weight: 900;
  font-size: 0.92rem;
  color: #fde047;
}

.tut-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.85rem;
  cursor: pointer;
}

.tut-close-btn:hover { color: #fff; }

.tut-bubble-body {
  font-size: 0.84rem;
  color: #e2d9be;
  line-height: 1.45;
  margin-bottom: 12px;
}

.tut-bubble-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tut-step-dots {
  display: flex;
  gap: 5px;
}

.step-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #574431;
}

.step-dot.active {
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
}

.tut-btn-prev {
  background: #3d2f21;
  border: 1px solid #785a28;
  color: #f5eedc;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
}

.tut-btn-next {
  background: linear-gradient(180deg, #d97706 0%, #92400e 100%);
  border: 1px solid #fde047;
  color: #fff;
  font-weight: 900;
  padding: 4px 14px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* ==========================================================================
   6. AUTHENTIC TRAVIAN RICH CARD & MODAL DIALOG
   ========================================================================== */
.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(10, 7, 4, 0.88) !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  z-index: 10000 !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  padding: 12px !important;
  box-sizing: border-box !important;
}

.modal-overlay.active,
.modal-overlay[style*="display: flex"] {
  display: flex !important;
}

.modal-overlay[style*="display: none"],
.modal-overlay:not(.active):not([style*="display: flex"]) {
  display: none !important;
}

.travian-rich-modal-frame {
  background: #fcf8ee;
  color: #2b1f14;
  border: 3px solid #78350f;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.95), 0 0 0 1px rgba(245, 158, 11, 0.4);
  width: 95vw;
  max-width: 580px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: popIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}

.travian-dark-modal-frame {
  background: #20170e;
  color: #f5eedc;
  border: 3px solid #78350f;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.95), 0 0 0 1px rgba(245, 158, 11, 0.4);
  width: 95vw;
  max-width: 580px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: popIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}

.rich-modal-header {
  background: linear-gradient(180deg, #3d2613 0%, #1e130a 100%);
  border-bottom: 2px solid #78350f;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  box-sizing: border-box;
}

.rich-modal-title {
  color: #fde047;
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  gap: 6px;
}

.rich-modal-title .level-highlight {
  color: #fb923c;
  margin-left: 2px;
}

.rich-modal-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rich-modal-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #78350f;
  background: #451a03;
  color: #fde047;
  font-weight: 900;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  transition: all 0.15s ease;
  padding: 0;
  line-height: 1;
}

.rich-modal-btn:hover {
  background: #b91c1c;
  border-color: #ef4444;
  color: #ffffff;
  transform: scale(1.05);
}

/* Modal Inner Navigation Tabs */
.modal-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #d6d3d1;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.modal-tab-btn:hover {
  color: #fde047;
  background: rgba(245, 158, 11, 0.08);
}

.modal-tab-btn.active {
  color: #fbbf24;
  border-bottom-color: #f59e0b;
  background: rgba(245, 158, 11, 0.16);
  font-weight: 900;
}

.rich-modal-body {
  padding: 14px 16px;
  overflow-y: auto;
  flex: 1;
  box-sizing: border-box;
}

.rich-card-banner {
  height: 125px;
  border-radius: 6px;
  border: 1px solid #b5a07c;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.rich-card-banner.bg-woodcutter { background: linear-gradient(135deg, #4d7c0f 0%, #1e3a07 100%); }
.rich-card-banner.bg-clay { background: linear-gradient(135deg, #a04018 0%, #4d1804 100%); }
.rich-card-banner.bg-iron { background: linear-gradient(135deg, #475569 0%, #1e293b 100%); }
.rich-card-banner.bg-crop { background: linear-gradient(135deg, #ca8a04 0%, #713f12 100%); }
.rich-card-banner.bg-building { background: linear-gradient(135deg, #3b2a1a 0%, #1a120b 100%); }

.banner-stats-column {
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  font-size: 0.85rem;
  line-height: 1.5;
  z-index: 5;
}

.banner-stats-column b {
  font-size: 0.95rem;
  color: #fde047;
}

.banner-illustration-large {
  font-size: 4rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
  z-index: 5;
}

.rich-description-box { margin-bottom: 12px; }

.rich-desc-header {
  font-weight: bold;
  font-size: 0.85rem;
  color: #3f6212;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.rich-desc-text {
  font-size: 0.82rem;
  color: #3f2e1e;
  line-height: 1.4;
}

.rich-requirements-card {
  background: #f4ecd8;
  border: 1.5px solid #84cc16;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.rich-costs-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.cost-chip-travian {
  background: #fdfaf3;
  border: 1px solid #b5a07c;
  padding: 4px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: bold;
  color: #2c1a0e;
}

.cost-chip-travian.insufficient {
  background: #ffe4e6;
  border-color: #f43f5e;
  color: #9f1239;
}

.rich-status-warning {
  font-size: 0.78rem;
  color: #b91c1c;
  font-weight: bold;
  margin-bottom: 8px;
  text-align: center;
}

.rich-bonuses-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px dashed #b5a07c;
  font-size: 0.8rem;
  color: #2c1a0e;
}

.stat-pill-travian {
  background: #fdfaf3;
  border: 1px solid #d6c7b2;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: #3b2814;
}

.bonus-gain {
  color: #15803d;
  font-weight: 900;
  margin-left: 2px;
}

/* Admin Player Banishment Scroll Container */
.admin-player-scroll-card {
  max-height: 480px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  border: 1.5px solid #6b5335;
  border-radius: 8px;
  background: rgba(15, 10, 5, 0.85);
  scrollbar-width: thin;
  scrollbar-color: #eab308 rgba(0,0,0,0.5);
}

.admin-player-scroll-card::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.admin-player-scroll-card::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.5);
  border-radius: 4px;
}

.admin-player-scroll-card::-webkit-scrollbar-thumb {
  background: #ca8a04;
  border-radius: 4px;
  border: 1px solid #78350f;
}

.rich-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}

@media (max-width: 520px) {
  .rich-actions-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.upgrade-action-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.btn-travian-green {
  width: 100%;
  background: linear-gradient(180deg, #65a30d 0%, #3f6212 100%);
  border: 1px solid #4d7c0f;
  color: #fff;
  font-weight: 900;
  font-size: 0.88rem;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4);
  transition: all 0.15s;
  box-sizing: border-box;
}

.btn-travian-green:hover:not(:disabled) {
  background: linear-gradient(180deg, #84cc16 0%, #4d7c0f 100%);
  box-shadow: 0 0 10px rgba(132, 204, 22, 0.6);
}

.btn-travian-green:disabled {
  background: #64748b;
  border-color: #475569;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-travian-purple {
  width: 100%;
  background: linear-gradient(180deg, #9333ea 0%, #6b21a8 100%);
  border: 1px solid #581c87;
  color: #fff;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4);
  transition: all 0.15s;
  box-sizing: border-box;
}

.btn-travian-purple:hover:not(:disabled) {
  background: linear-gradient(180deg, #a855f7 0%, #7e22ce 100%);
}

.action-time-label {
  font-size: 0.78rem;
  color: #57534e;
  font-family: inherit;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.rearrange-box-travian {
  background: #eef2e6;
  border: 1px solid #d4dec3;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: #36491a;
  margin-top: 8px;
}

/* Authentic Travian Troop Training Cards & Consistent Parchment Tabs */
.troop-training-card-parchment {
  background: #fdfaf3;
  border: 1.5px solid #b5a07c;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  box-sizing: border-box;
}

.troop-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  border-bottom: 1px solid #e7ddcf;
  padding-bottom: 4px;
}

.troop-card-title {
  font-weight: 900;
  color: #78350f;
  font-size: 1rem;
}

.troop-card-count {
  font-size: 0.8rem;
  color: #57534e;
}

.troop-card-count b {
  color: #15803d;
  font-size: 0.85rem;
}

.troop-card-desc {
  font-size: 0.82rem;
  color: #3f2e1e;
  line-height: 1.4;
  margin-bottom: 8px;
}

.troop-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #d6c7b2;
}

.troop-action-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e7ddcf;
}

.form-control-travian-num {
  background: #ffffff !important;
  border: 1.5px solid #8c6f45 !important;
  color: #2b1f14 !important;
  border-radius: 6px !important;
  padding: 7px 10px !important;
  font-size: 0.95rem !important;
  font-weight: 900 !important;
  text-align: center !important;
  width: 90px !important;
  outline: none !important;
  box-sizing: border-box !important;
}

.form-control-travian-num:focus {
  border-color: #15803d !important;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4) !important;
}

.btn-travian-max {
  background: #f4ecd8;
  border: 1.5px solid #8c6f45;
  color: #78350f;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 900;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-travian-max:hover {
  background: #ebdcc0;
  border-color: #5a2707;
  color: #451a03;
}

/* Interactive Floating Tooltip Popover for Desktop & Mobile */
.travian-interactive-tooltip {
  position: fixed;
  z-index: 99999999;
  background: #2b1f14;
  border: 2px solid #fde047;
  border-radius: 8px;
  color: #fef08a;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: bold;
  box-shadow: 0 8px 24px rgba(0,0,0,0.9), 0 0 15px rgba(245, 158, 11, 0.4);
  max-width: 280px;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  display: none;
}

.travian-interactive-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
  display: block;
}

.travian-interactive-tooltip .tip-title {
  color: #fbbf24;
  font-size: 0.9rem;
  font-weight: 900;
  margin-bottom: 2px;
  border-bottom: 1px solid #78350f;
  padding-bottom: 2px;
}

.travian-interactive-tooltip .tip-body {
  color: #f5eedc;
  font-size: 0.82rem;
  font-weight: 600;
}

.rearrange-title {
  font-weight: bold;
  color: #273b0f;
  margin-bottom: 2px;
}

.btn-rearrange-parchment {
  background: #e2d9be;
  border: 1px solid #b5a07c;
  color: #45321f;
  font-weight: bold;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 4px;
  margin-top: 6px;
  cursor: pointer;
}

.building-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 4px;
}

@media (max-width: 520px) {
  .building-picker-grid {
    grid-template-columns: 1fr;
  }
}

.building-picker-card {
  background: #f4ecd8;
  border: 1px solid #8c6f45;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.picker-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.picker-card-icon { font-size: 1.6rem; }
.picker-card-title { font-weight: bold; font-size: 0.9rem; color: #78350f; }
.picker-card-desc { font-size: 0.75rem; color: #57534e; line-height: 1.35; }

/* ==========================================================================
   7. AUTHENTIC TRAVIAN HELP MENU MODAL
   ========================================================================== */
.travian-help-menu-grid {
  display: grid;
  grid-template-columns: 180px 1fr 220px;
  gap: 16px;
  align-items: start;
}

.sage-scholar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.sage-scholar-avatar {
  font-size: 6rem;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

.sage-title-tag {
  background: #78350f;
  color: #fef08a;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
  border: 1px solid #fde047;
}

.help-section-title {
  font-size: 1rem;
  font-weight: 900;
  color: #78350f;
  margin-bottom: 4px;
}

.help-section-desc {
  font-size: 0.8rem;
  color: #3f2e1e;
  line-height: 1.4;
  margin-bottom: 8px;
}

.help-links-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.help-link-diamond {
  color: #15803d;
  font-size: 0.82rem;
  font-weight: bold;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: color 0.15s;
}

.help-link-diamond:hover {
  color: #166534;
  text-decoration: underline;
}

.help-link-diamond .diamond-icon {
  color: #84cc16;
  font-size: 0.75rem;
}

.help-card-orange {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border: 2px solid #78350f;
  border-radius: 8px;
  padding: 12px;
  color: white;
  text-align: center;
  margin-bottom: 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

.help-card-blue {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  border: 2px solid #1e1b4b;
  border-radius: 8px;
  padding: 12px;
  color: white;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

.help-card-title {
  font-size: 0.85rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.help-card-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.btn-help-action {
  width: 100%;
  background: linear-gradient(180deg, #65a30d 0%, #3f6212 100%);
  border: 1px solid #4d7c0f;
  color: white;
  font-weight: 900;
  font-size: 0.8rem;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.btn-help-action:hover {
  background: linear-gradient(180deg, #84cc16 0%, #4d7c0f 100%);
}

/* ==========================================================================
   9. AUTHENTIC TRAVIAN TASKMASTER & QUESTS MODAL
   ========================================================================== */
.taskmaster-modal-banner {
  background: linear-gradient(135deg, #451a03 0%, #291002 100%);
  border: 2px solid #b45309;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: white;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.taskmaster-portrait-large {
  font-size: 3rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
}

.taskmaster-modal-info {
  flex: 1;
}

.taskmaster-modal-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: #fde047;
  margin-bottom: 2px;
}

.taskmaster-modal-subtitle {
  font-size: 0.78rem;
  color: #fef3c7;
  line-height: 1.35;
  margin-bottom: 8px;
}

.taskmaster-progress-track-box {
  background: rgba(0,0,0,0.4);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #78350f;
}

.taskmaster-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #fde047;
  margin-bottom: 4px;
}

.taskmaster-progress-bar-bg {
  background: #1f160e;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #451a03;
}

.taskmaster-progress-bar-fill {
  background: linear-gradient(90deg, #65a30d 0%, #22c55e 100%);
  height: 100%;
  transition: width 0.3s ease;
}

.quests-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quest-task-card {
  background: #fdfaf3;
  border: 2px solid #8c6f45;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: all 0.15s;
}

.quest-task-card.claimable-glow {
  border: 2px solid #22c55e !important;
  background: #f0fdf4 !important;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
  animation: pulseGold 1.5s infinite;
}

.quest-task-card.claimed-dim {
  opacity: 0.75;
  background: #f5f0e6;
  border-color: #b5a07c;
}

.quest-card-left {
  flex: 1;
}

.quest-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.quest-card-title {
  font-weight: 900;
  font-size: 0.92rem;
  color: #78350f;
}

.quest-ready-chip {
  background: #15803d;
  color: white;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #86efac;
}

.quest-card-desc {
  font-size: 0.8rem;
  color: #45321f;
  line-height: 1.35;
  margin-bottom: 6px;
}

.quest-rewards-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.reward-chip {
  background: #f4ecd8;
  border: 1px solid #b5a07c;
  font-size: 0.75rem;
  font-weight: bold;
  color: #2c1a0e;
  padding: 2px 6px;
  border-radius: 4px;
}

.quest-card-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* ==========================================================================
   9B. QUICK QUEST CLAIM POPUP DRAWER (BOTTOM LEFT)
   ========================================================================== */
.quest-quick-drawer {
  position: fixed;
  bottom: 0;
  left: 24px;
  width: 330px;
  background: #2b241d;
  border: 2px solid #22c55e;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -5px 25px rgba(0,0,0,0.85), 0 0 20px rgba(34, 197, 94, 0.4);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  overflow: hidden;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quest-quick-drawer.hidden {
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
}

.quest-quick-header {
  padding: 8px 12px;
  background: linear-gradient(180deg, #15803d 0%, #14532d 100%);
  border-bottom: 2px solid #22c55e;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ffffff;
  user-select: none;
}

.quest-quick-count-pill {
  background: #facc15;
  color: #713f12;
  font-weight: 900;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.quest-quick-body {
  padding: 12px 14px;
  background: #1c150e;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quest-quick-name {
  font-size: 0.92rem;
  font-weight: 900;
  color: #fef08a;
}

.quest-quick-rewards-row {
  display: flex;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: bold;
  color: #86efac;
  flex-wrap: wrap;
}

.quest-quick-rewards-row span {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
}

.quest-quick-claim-btn {
  width: 100%;
  padding: 7px 14px;
  font-size: 0.88rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.5);
}

/* ==========================================================================
   10. AUTHENTIC TRAVIAN REALM CHAT DRAWER
   ========================================================================== */
.chat-drawer {
  position: fixed;
  bottom: 0;
  right: 24px;
  width: 390px;
  background: #2b241d;
  border: 2px solid #8c6f45;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -5px 25px rgba(0,0,0,0.8);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  overflow: hidden;
}

.chat-drawer.collapsed {
  transform: none !important;
  bottom: 0 !important;
}

.chat-drawer.collapsed .chat-messages-container,
.chat-drawer.collapsed .chat-input-row {
  display: none !important;
}

.chat-header {
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  box-sizing: border-box;
  background: linear-gradient(180deg, #3d2f1f 0%, #20170d 100%);
  border-bottom: 2px solid #8c6f45;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fef08a;
  user-select: none;
  white-space: nowrap;
}

.chat-drawer.collapsed .chat-header {
  border-bottom: none !important;
}

.chat-tab-btn {
  background: #19120a !important;
  border: 1px solid #785a28 !important;
  color: #cbd5e1 !important;
  padding: 3px 10px !important;
  font-size: 0.75rem !important;
  font-weight: bold !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: all 0.15s !important;
  box-shadow: none !important;
}

.chat-tab-btn:hover {
  background: #382819 !important;
  border-color: #fde047 !important;
  color: #ffffff !important;
}

.chat-tab-btn.active {
  background: linear-gradient(180deg, #d97706 0%, #92400e 100%) !important;
  border: 1px solid #fde047 !important;
  color: #ffffff !important;
  font-weight: 900 !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5) !important;
}

.chat-unread-pill {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 10px;
  border: 1px solid #fca5a5;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
  animation: unreadPulse 1.5s infinite;
}

@keyframes unreadPulse {
  0% { transform: scale(0.95); opacity: 0.9; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.9; }
}

.chat-bell-badge {
  position: absolute;
  top: -8px;
  right: -9px;
  font-size: 0.92rem;
  animation: bellRing 1.3s infinite ease-in-out;
  filter: drop-shadow(0 0 5px #f59e0b) drop-shadow(0 0 8px #ef4444);
  pointer-events: none;
}

@keyframes bellRing {
  0%, 100% { transform: rotate(0) scale(1); }
  10%, 30% { transform: rotate(-18deg) scale(1.2); }
  20%, 40% { transform: rotate(18deg) scale(1.2); }
  50% { transform: rotate(-8deg); }
  60% { transform: rotate(8deg); }
  70% { transform: rotate(0); }
}

.chat-drawer.has-new-messages {
  border-color: #f59e0b !important;
  box-shadow: 0 -5px 25px rgba(245, 158, 11, 0.7), 0 0 15px rgba(239, 68, 68, 0.8) !important;
  animation: chatDrawerGlow 1.8s infinite alternate !important;
}

@keyframes chatDrawerGlow {
  0% { border-color: #8c6f45; box-shadow: 0 -5px 25px rgba(0,0,0,0.8); }
  100% { border-color: #f59e0b; box-shadow: 0 -5px 25px rgba(245, 158, 11, 0.8), 0 0 18px rgba(239, 68, 68, 0.9); }
}

.chat-messages-container {
  height: 240px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #1c150e;
  font-size: 0.8rem;
  color: #f5eedc;
}

.chat-msg {
  line-height: 1.35;
  word-break: break-word;
}

.chat-sender {
  font-weight: 900;
  color: #fde047;
  margin-right: 4px;
}

.chat-input-row {
  display: flex;
  padding: 8px 10px;
  background: #2b241d;
  border-top: 1px solid #6b5335;
  gap: 6px;
}

.chat-input {
  flex: 1;
  padding: 6px 10px;
  background: #140d07;
  border: 1px solid #785a28;
  color: #fff;
  border-radius: 4px;
  font-size: 0.8rem;
  outline: none;
}

.chat-input:focus {
  border-color: #fde047;
}

.chat-send-btn {
  background: linear-gradient(180deg, #65a30d 0%, #3f6212 100%);
  border: 1px solid #4d7c0f;
  color: #fff;
  font-weight: 900;
  font-size: 0.78rem;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  transition: all 0.15s;
}

.chat-send-btn:hover {
  background: linear-gradient(180deg, #84cc16 0%, #4d7c0f 100%);
  border-color: #84cc16;
}

/* Player Mentions & Autocomplete */
.chat-mention {
  background: rgba(245, 158, 11, 0.25);
  color: #fde047;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.4);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-block;
}

.chat-mention:hover {
  background: #f59e0b;
  color: #000;
}

.chat-mention.mention-me {
  background: rgba(34, 197, 94, 0.35);
  color: #86efac;
  border-color: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.chat-tag-suggestions {
  position: absolute;
  bottom: 46px;
  left: 10px;
  right: 10px;
  background: #251c14;
  border: 1.5px solid #ca8a04;
  border-radius: 6px;
  max-height: 140px;
  overflow-y: auto;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  z-index: 10001;
}

.chat-tag-item {
  padding: 6px 12px;
  color: #fef08a;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #3d2f1f;
  transition: background 0.1s;
}

.chat-tag-item:hover, .chat-tag-item.active {
  background: #78350f;
  color: #ffffff;
}

.chat-tag-item:last-child {
  border-bottom: none;
}

/* ==========================================================================
   11. AUTHENTIC TRAVIAN AUTH & LOGIN MODAL
   ========================================================================== */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 40px);
  padding: 16px;
  box-sizing: border-box;
}

.auth-box {
  width: 100%;
  max-width: 440px;
  background: #2b241d;
  border: 3px solid #8c6f45;
  border-radius: 12px;
  box-shadow: 0 12px 45px rgba(0,0,0,0.85);
  padding: 24px 28px;
  color: #f5eedc;
  box-sizing: border-box;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid #6b5335;
  padding-bottom: 8px;
}

.auth-tab {
  flex: 1;
  background: #19120a !important;
  border: 1px solid #785a28 !important;
  color: #cbd5e1 !important;
  padding: 9px 12px !important;
  font-size: 0.85rem !important;
  font-weight: bold !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.15s !important;
  box-shadow: none !important;
}

.auth-tab:hover {
  background: #382819 !important;
  border-color: #fde047 !important;
  color: #ffffff !important;
}

.auth-tab.active {
  background: linear-gradient(180deg, #d97706 0%, #92400e 100%) !important;
  border: 1px solid #fde047 !important;
  color: #ffffff !important;
  font-weight: 900 !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5) !important;
}

.auth-form input.form-control {
  background: #140d07 !important;
  border: 1px solid #785a28 !important;
  color: #ffffff !important;
  padding: 9px 12px !important;
  border-radius: 5px !important;
  font-size: 0.88rem !important;
  outline: none !important;
}

.auth-form input.form-control:focus {
  border-color: #fde047 !important;
  box-shadow: 0 0 8px rgba(253, 224, 71, 0.4) !important;
}

.auth-btn, #auth-submit-btn {
  background: linear-gradient(180deg, #d97706 0%, #92400e 100%) !important;
  border: 1px solid #fde047 !important;
  color: #ffffff !important;
  font-weight: 900 !important;
  font-size: 0.95rem !important;
  padding: 10px 16px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  box-shadow: 0 3px 6px rgba(0,0,0,0.5) !important;
  transition: all 0.15s !important;
}

.auth-btn:hover, #auth-submit-btn:hover {
  background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%) !important;
  transform: translateY(-1px) !important;
}

/* ==========================================================================
   12. LIVING PANORAMIC AMBIENT WORLD BACKDROP
   ========================================================================== */
.ambient-world-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 30%, rgba(0,0,0,0.35) 100%), #52751f;
}

.ambient-world-svg {
  width: 104% !important;
  height: 104% !important;
  margin-top: -2% !important;
  margin-left: -2% !important;
  object-fit: cover !important;
  display: block !important;
  filter: blur(2.2px) brightness(0.98) saturate(1.15) !important;
  -webkit-filter: blur(2.2px) brightness(0.98) saturate(1.15) !important;
  transform: scale(1.02) !important;
}

/* ==========================================================================
   12B. MODERN MEDIEVAL FORM CONTROLS & DISPATCH
   ========================================================================== */

/* Mission Selector Radio Grid */
.mission-selector-group {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 6px !important;
  margin-top: 6px !important;
  margin-bottom: 14px !important;
}

.mission-option {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  background: #18120c !important;
  border: 1.5px solid #574435 !important;
  border-radius: 8px !important;
  padding: 9px 4px !important;
  color: #d6d3d1 !important;
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  text-align: center !important;
  white-space: nowrap !important;
  user-select: none !important;
  box-sizing: border-box !important;
}

.mission-option input[type="radio"] {
  accent-color: #f59e0b !important;
  width: 14px !important;
  height: 14px !important;
  margin: 0 !important;
  cursor: pointer !important;
}

.mission-option:hover {
  border-color: #b45309 !important;
  background: #2b1f15 !important;
  color: #fef08a !important;
}

.mission-option.selected,
.mission-option:has(input:checked) {
  border-color: #f59e0b !important;
  background: linear-gradient(180deg, #78350f 0%, #451a03 100%) !important;
  color: #fef08a !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4) !important;
}

/* Inputs & Form Controls */
.form-control,
.troop-dispatch-input,
input[type="text"],
input[type="number"],
input[type="password"],
textarea {
  background: #120d08 !important;
  border: 1.5px solid #6b5335 !important;
  border-radius: 6px !important;
  color: #fef08a !important;
  font-weight: bold !important;
  padding: 8px 12px !important;
  font-size: 0.88rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
  outline: none !important;
  transition: border-color 0.15s, box-shadow 0.15s !important;
}

.form-control:focus,
.troop-dispatch-input:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus {
  border-color: #f59e0b !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.45) !important;
  background: #19120b !important;
}

/* Button Refinements */
.btn-primary {
  background: linear-gradient(180deg, #d97706 0%, #92400e 100%) !important;
  border: 1.5px solid #fde047 !important;
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8) !important;
  padding: 9px 22px !important;
  border-radius: 6px !important;
  font-weight: 900 !important;
  font-size: 0.88rem !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
  transition: all 0.15s ease !important;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%) !important;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.6) !important;
  transform: translateY(-1px) !important;
}

.btn-primary:disabled {
  background: #3f352c !important;
  border-color: #574435 !important;
  color: #78716c !important;
  text-shadow: none !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

.btn-secondary {
  background: #38291e !important;
  border: 1.5px solid #6b5335 !important;
  color: #e7e5e4 !important;
  padding: 9px 18px !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.btn-secondary:hover {
  background: #4a382a !important;
  border-color: #a8824f !important;
  color: #ffffff !important;
}

.btn-danger {
  background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%) !important;
  border: 1.5px solid #f87171 !important;
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8) !important;
  padding: 8px 16px !important;
  border-radius: 6px !important;
  font-weight: 800 !important;
  font-size: 0.85rem !important;
  cursor: pointer !important;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4) !important;
  transition: all 0.15s ease !important;
}

.btn-danger:hover {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%) !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6) !important;
  transform: translateY(-1px) !important;
}

/* ==========================================================================
   13. MOBILE & TABLET RESPONSIVE SYSTEM (PORTRAIT & LANDSCAPE)
   ========================================================================== */
@media (max-width: 900px) {
  body {
    overflow-x: hidden !important;
    width: 100vw !important;
    max-width: 100vw !important;
  }

  /* 1. Header Dock Mobile Optimization */
  .travian-top-dock {
    flex-wrap: wrap !important;
    padding: 6px 8px !important;
    gap: 6px !important;
    justify-content: space-between !important;
  }

  .hero-avatar-card {
    order: 1 !important;
  }

  .header-right-dock {
    order: 2 !important;
  }

  /* Full-width 4-Column Resource Bar on Mobile */
  .resource-gauges-dock {
    order: 3 !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 4px !important;
    padding: 4px 6px !important;
    box-sizing: border-box !important;
  }

  .res-gauge-pill {
    padding: 3px 4px !important;
    gap: 3px !important;
    justify-content: center !important;
    min-width: 0 !important;
  }

  .res-g-icon {
    font-size: 0.95rem !important;
  }

  .res-g-details {
    font-size: 0.72rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .res-g-val {
    font-size: 0.75rem !important;
    font-weight: 900 !important;
  }

  .res-g-cap {
    font-size: 0.65rem !important;
    color: #94a3b8 !important;
  }

  /* Full-width 6 Medallion Navigation on Mobile */
  .medallion-nav-dock {
    order: 4 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    gap: 4px !important;
  }

  .medallion-btn {
    flex: 1 !important;
    width: auto !important;
    height: 42px !important;
    border-radius: 8px !important;
  }

  .medallion-btn .medallion-icon {
    font-size: 1.2rem !important;
  }

  /* 2. Main 3-Column Layout Stacking on Mobile */
  .travian-main-layout {
    display: flex !important;
    flex-direction: column !important;
    padding: 6px 8px !important;
    margin: 4px auto !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Viewport Column (Circle / Map / Stats / Reports) Comes First */
  .travian-viewport-col {
    order: 1 !important;
    width: 100% !important;
  }

  /* Right Sidebar (Queues, Quests, Villages) Comes Second */
  .travian-right-sidebar {
    order: 2 !important;
    width: 100% !important;
  }

  /* Left Sidebar (Production rates & Info Box) Comes Third */
  .travian-left-sidebar {
    order: 3 !important;
    width: 100% !important;
  }

  /* Village Circle & Resource Fields Stage Scaling */
  .fields-art-wrapper,
  .center-plots-grid {
    width: min(94vw, 420px) !important;
    height: min(94vw, 420px) !important;
    margin: 6px auto !important;
  }

  .valley-center-village-portal {
    width: clamp(74px, 19%, 90px) !important;
    height: clamp(74px, 19%, 90px) !important;
    gap: 5px !important;
    padding: 4px !important;
  }

  .portal-icon {
    font-size: 1.15rem !important;
    margin-top: -2px !important;
  }

  .portal-text-title {
    font-size: 0.54rem !important;
    line-height: 1.15 !important;
    max-width: 88% !important;
    white-space: normal !important;
    text-align: center !important;
  }

  /* Modals & Popups on Mobile */
  .travian-modal-box,
  .taskmaster-modal-box,
  .building-construct-modal-box {
    width: 94vw !important;
    max-width: 94vw !important;
    max-height: 88vh !important;
    padding: 14px !important;
  }

  /* Slideout Drawers */
  .guide-slideout-drawer {
    width: 94vw !important;
    max-width: 94vw !important;
  }

  /* Quick Quest Claim Drawer on Mobile (Separated to bottom-left) */
  .quest-quick-drawer {
    left: 10px !important;
    bottom: 12px !important;
    width: min(78vw, 290px) !important;
    z-index: 9999 !important;
  }

  /* Chat Floating Bubble on Mobile (Collapsed to bottom-right 52px circle) */
  .chat-drawer.collapsed {
    position: fixed !important;
    bottom: 16px !important;
    right: 14px !important;
    width: 52px !important;
    height: 52px !important;
    border-radius: 50% !important;
    border: 2px solid #fde047 !important;
    background: radial-gradient(circle, #d97706 0%, #78350f 100%) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8) !important;
    cursor: pointer !important;
    transform: none !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000 !important;
  }

  .chat-drawer.collapsed .chat-header {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .chat-drawer.collapsed .chat-header > div:first-child {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
  }

  .chat-drawer.collapsed .chat-header > div:first-child span:first-child {
    font-size: 1.6rem !important;
    margin: 0 !important;
  }

  .chat-drawer.collapsed .chat-header > div:first-child span:last-child,
  .chat-drawer.collapsed .chat-header > div:last-child,
  .chat-drawer.collapsed .chat-messages-container,
  .chat-drawer.collapsed .chat-input-row {
    display: none !important;
  }

  /* Expanded Chat Window on Mobile */
  .chat-drawer:not(.collapsed) {
    position: fixed !important;
    bottom: 14px !important;
    right: 10px !important;
    left: 10px !important;
    width: calc(100vw - 20px) !important;
    max-height: 420px !important;
    border-radius: 12px !important;
    border: 2px solid #8c6f45 !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.9) !important;
    z-index: 10000 !important;
    transform: none !important;
  }
}





