/* ==========================================================================
   RISE OF KINGDOMS - TACTICAL GAME HUD & UX STYLESHEET
   Immersive Medieval-Fantasy Strategy Game UI Theme
   ========================================================================== */

/* Google Fonts Import - 100% Unified Gaming UI (Outfit) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&display=swap');

:root {
  --rok-gold-light: #FFF1B0;
  --rok-gold-main: #F59E0B;
  --rok-gold-dark: #B45309;
  --rok-slate-bg: #040817;
  --rok-panel-bg: rgba(9, 15, 30, 0.88);
  --rok-panel-border: rgba(245, 158, 11, 0.28);
  --rok-food-color: #84CC16;
  --rok-wood-color: #F59E0B;
  --rok-stone-color: #94A3B8;
  --rok-gold-res: #FBBF24;
}

/* Base Body with Atmospheric Game Throne Room Background */
body {
  background-color: #030611;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(68, 20, 110, 0.35) 0%, rgba(4, 8, 20, 0) 60%),
    linear-gradient(180deg, rgba(4, 7, 18, 0.40) 0%, rgba(5, 10, 24, 0.68) 240px, rgba(4, 7, 18, 0.92) 640px, rgba(3, 5, 14, 0.98) 100%),
    url('assets/bg_imperial.png');
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #E2E8F0;
  min-height: 100vh;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(3, 6, 15, 0.8);
}
::-webkit-scrollbar-thumb {
  background: #1E293B;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
  border-color: rgba(245, 158, 11, 0.5);
}

/* Sticky Column Behavior for Large Screens */
@media (min-width: 1024px) {
  .rok-sticky-col {
    position: sticky;
    top: 5.25rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    padding-right: 0.35rem;
  }
}

/* Typography Utilities - 100% Unified with Outfit */
.font-cinzel {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: 0.04em;
  font-weight: 800;
}
.font-mono-num {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-weight: 700;
}

/* Regal Metallic Gold Text Gradient */
.rok-gold-gradient {
  background: linear-gradient(180deg, #FFFBEB 0%, #FDE68A 25%, #F59E0B 65%, #B45309 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.85));
}

.rok-silver-gradient {
  background: linear-gradient(180deg, #FFFFFF 0%, #E2E8F0 45%, #94A3B8 80%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

/* Tactical Panel with Smooth Game HUD Borders */
.rok-panel {
  position: relative;
  background: rgba(8, 14, 28, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 158, 11, 0.26);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 
    0 12px 32px -5px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.rok-panel:hover {
  border-color: rgba(245, 158, 11, 0.48);
  box-shadow: 
    0 16px 40px -5px rgba(0, 0, 0, 0.9),
    0 0 24px rgba(245, 158, 11, 0.12);
}

/* Corner framing utility (clean, without floating brackets) */
.rok-corner-frame {
  position: relative;
}

/* Royal Panel for Main Account */
.rok-panel-royal {
  position: relative;
  background: linear-gradient(145deg, rgba(38, 20, 10, 0.92) 0%, rgba(12, 19, 36, 0.94) 60%);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 
    0 14px 40px -5px rgba(0, 0, 0, 0.9),
    0 0 30px rgba(245, 158, 11, 0.15) inset;
}

/* Tactical Inset Plaque for Resource Rows */
.rok-inset-row {
  background: rgba(5, 9, 18, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.75rem;
  transition: all 0.2s ease;
}
.rok-inset-row:hover {
  background: rgba(14, 22, 42, 0.85);
  border-color: rgba(245, 158, 11, 0.35);
}

/* Tactile Game Buttons */
.rok-btn-gold {
  background: linear-gradient(180deg, #FBBF24 0%, #D97706 70%, #B45309 100%);
  color: #0F172A;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
  border: 1px solid #FDE68A;
  box-shadow: 
    0 4px 12px rgba(217, 119, 6, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.4) inset;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.rok-btn-gold:hover {
  background: linear-gradient(180deg, #FDE68A 0%, #F59E0B 70%, #B45309 100%);
  transform: translateY(-1px);
  box-shadow: 
    0 6px 16px rgba(217, 119, 6, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.5) inset;
}
.rok-btn-gold:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}

.rok-btn-dark {
  background: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
  border: 1px solid #334155;
  color: #E2E8F0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: all 0.18s ease;
}
.rok-btn-dark:hover {
  background: linear-gradient(180deg, #334155 0%, #1E293B 100%);
  border-color: rgba(245, 158, 11, 0.4);
  color: #F8FAFC;
  transform: translateY(-1px);
}
.rok-btn-dark:active {
  transform: translateY(1px);
}

/* Micro Resource Split Gauge (Open vs Bag) */
.rok-gauge {
  height: 5px;
  border-radius: 9999px;
  background: rgba(30, 41, 59, 0.8);
  overflow: hidden;
  display: flex;
}
.rok-gauge-open {
  background: linear-gradient(90deg, #10B981, #34D399);
  height: 100%;
}
.rok-gauge-bag {
  background: rgba(148, 163, 184, 0.4);
  height: 100%;
}

/* 3D Floating Building Animation */
@keyframes float-building {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(0.6deg);
  }
}
.animate-float-building {
  animation: float-building 4.8s ease-in-out infinite;
}

/* Glowing effects for 3D Building */
.trading-post-glow {
  filter: drop-shadow(0 14px 28px rgba(245, 158, 11, 0.28));
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.trading-post-glow:hover {
  filter: drop-shadow(0 18px 40px rgba(245, 158, 11, 0.55)) drop-shadow(0 0 20px rgba(16, 185, 129, 0.35));
  transform: scale(1.05) translateY(-3px);
}

/* Shimmer Badge */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.badge-shimmer {
  background: linear-gradient(90deg, rgba(245,158,11,0.12) 0%, rgba(245,158,11,0.38) 50%, rgba(245,158,11,0.12) 100%);
  background-size: 200% 100%;
  animation: shimmer 3.2s infinite linear;
}

/* Drag & Drop Zone Styling */
#drop-zone.dragover {
  border-color: #F59E0B !important;
  background: rgba(245, 158, 11, 0.1) !important;
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.25) inset;
  transform: scale(1.01);
}

/* Dropzone radar pulse effect */
@keyframes radar-scan {
  0% { transform: translateY(-100%); opacity: 0.1; }
  50% { opacity: 0.3; }
  100% { transform: translateY(100%); opacity: 0.1; }
}
.radar-grid {
  background-image: 
    linear-gradient(rgba(245, 158, 11, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 158, 11, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Toast Animation */
@keyframes slideInUp {
  from {
    transform: translateY(100%) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
.toast-in {
  animation: slideInUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Number value highlight flash when modified */
@keyframes num-flash {
  0% { color: #F59E0B; transform: scale(1.08); }
  100% { color: inherit; transform: scale(1); }
}
.animate-flash {
  animation: num-flash 0.6s ease-out;
}

/* Tactical Matrix Table (For 5 to 15+ Farms) */
.rok-table-wrapper {
  overflow-x: auto;
  border-radius: 0.875rem;
}
.rok-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}
.rok-table th {
  background: rgba(10, 16, 28, 0.95);
  backdrop-filter: blur(8px);
  padding: 0.85rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #94A3B8;
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  white-space: nowrap;
}
.rok-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
  font-size: 0.8125rem;
  white-space: nowrap;
}
.rok-table tbody tr {
  transition: all 0.15s ease;
  background: rgba(10, 16, 28, 0.45);
}
.rok-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.65);
}
.rok-table tbody tr.row-main-account {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15) 0%, rgba(15, 23, 42, 0.7) 100%);
  border-left: 3px solid #F59E0B;
}
.rok-table tfoot td {
  background: rgba(8, 12, 22, 0.95);
  border-top: 2px solid rgba(245, 158, 11, 0.4);
  padding: 0.85rem 1rem;
  font-weight: 800;
}
