/* --- General & Index Page Styles --- */
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #0a2e0a, #1a5d1a, #0a2e0a, #1a5d1a);
  background-size: 400% 400%;
  animation: gradientBG 20s ease infinite;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: white;
  text-align: center;
  padding: 20px;
  position: relative;
  box-sizing: border-box;
}

.gallery-body {
    min-height: 100vh;
    justify-content: flex-start;
    padding-top: 50px;
    background: linear-gradient(135deg, #0a2e0a, #1a5d1a, #0a2e0a, #1a5d1a);
    background-size: 400% 400%;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- Layout Branding Graphics --- */
.logo-container {
  max-width: 500px;
  width: 100%;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.gallery-logo-container {
  margin-top: 50px;
}

.brand-logo {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 15px rgba(144, 228, 193, 0.6)) drop-shadow(0 0 30px rgba(0, 255, 157, 0.3));
}

.content {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  line-height: 1.6;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  max-width: 600px;
  margin-bottom: 20px;
}

.button-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.top-button-container {
  position: absolute;
  top: 15px;
  left: 15px;
  display: flex;
  gap: 10px;
  z-index: 1000;
}

.utility-controls-container {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  gap: 10px;
  z-index: 1000;
}

/* --- Core Buttons General Parameters --- */
button, .open-page-btn, .utility-btn {
  background: rgba(255, 255, 255, 0.15) !important;
  border-radius: 16px !important; 
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  color: #e0f7e0 !important;
  cursor: pointer;
  font-size: 18px !important; 
  font-weight: 500 !important; /* SLEEK WEIGHT CONFIGURATION */
  margin: 10px 0; 
  padding: 14px 40px !important; 
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 8px 32px 0 rgba(0, 255, 45, 0.15);
  backdrop-filter: saturate(180%) blur(10px) !important;
  -webkit-backdrop-filter: saturate(180%) blur(10px) !important;
  transition: transform 0.3s ease, background 0.3s ease;
  min-width: 180px;
  user-select: none;
  text-decoration: none;
  display: inline-block;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

button:hover, .open-page-btn:hover, .utility-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  transform: scale(1.05) !important;
  outline: none;
}

/* --- Dynamic Top Dashboard Resizer --- */
.top-button-container button, 
.top-button-container .open-page-btn, 
.utility-controls-container button,
.utility-controls-container .utility-btn {
  font-size: 14px !important; 
  padding: 8px 20px !important; 
  margin: 0 !important;
  min-width: auto !important; 
  border-radius: 12px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 4px 15px rgba(0, 255, 45, 0.1);
}

/* --- Maximized Search Bar Controls --- */
.search-container {
    width: 100%;
    max-width: 700px; 
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.search-bar {
    width: 100%;
    padding: 14px 22px; 
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px !important; 
    color: white;
    font-size: 1.1rem; 
    box-sizing: border-box; 
    backdrop-filter: saturate(180%) blur(10px);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.3s ease;
}

.search-bar::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-bar:focus {
    outline: none;
    border-color: rgba(0, 255, 45, 0.6);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 15px rgba(0, 255, 102, 0.3);
}

/* --- Gallery Grid Layout Settings --- */
.gallery-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 20px;
  max-width: 1100px;
  width: 100%;
  margin-top: 40px;
  padding: 0 10px;
  box-sizing: border-box;
}

.game-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-radius: 16px;
  color: white;
  text-decoration: none;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s ease;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-6px) scale(1.02);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(0, 255, 45, 0.4);
}

.game-thumbnail {
    width: 100%;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-card h3 {
    margin-top: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #90E4C1;
    text-shadow: 0 0 5px rgba(0, 255, 157, 0.4);
    font-weight: 500;
}

.game-card p {
    color: rgba(255, 255, 255, 0.8);
    text-shadow: none;
    padding: 0;
    margin: 0;
    line-height: 1.4;
    flex-grow: 1;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* --- OS Context Dropdown overlay --- */
.custom-context-menu {
  position: fixed;
  background: #1c1c1e;
  border: 1px solid #2c2c2e;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.88rem;
  min-width: 210px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  z-index: 2147483647;
  display: none;
  border-radius: 8px;
  padding: 5px 0;
  text-align: left;
}

.context-item {
  padding: 6px 18px;
  cursor: pointer;
  user-select: none;
}

.context-item:hover {
  background: #0a84ff;
  color: #ffffff;
}

.context-accent {
  color: #30d158;
  font-weight: 600;
}

.context-divider {
  height: 1px;
  background: #2c2c2e;
  margin: 5px 0;
}

/* --- Hardware Profiler HUD --- */
.hardware-profiler-hud {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid #444;
  color: #00ff66;
  font-family: monospace;
  padding: 15px;
  font-size: 0.8rem;
  border-radius: 6px;
  z-index: 99999;
  text-align: left;
  min-width: 260px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  display: none;
}

.profiler-header {
  font-weight: bold;
  border-bottom: 1px solid #444;
  padding-bottom: 6px;
  margin-bottom: 8px;
  color: #90E4C1;
  display: flex;
  justify-content: space-between;
}

.stress-btn-container {
  margin: 8px 0;
}

.stress-trigger-btn {
  width: 100%;
  background: #2d2d2d;
  color: #ff3b30;
  border: 1px solid #ff3b30;
  padding: 6px;
  font-family: monospace;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  text-transform: uppercase;
}

.stress-trigger-btn.active {
  background: #ff3b30;
  color: #fff;
  animation: stressPulseAlert 1s infinite alternate;
}

@keyframes stressPulseAlert {
  from { box-shadow: 0 0 4px #ff3b30; }
  to { box-shadow: 0 0 14px #ff3b30; }
}

.profiler-selector-box {
  margin-top: 10px;
  padding-top: 6px;
  border-top: 1px dashed #444;
  color: #ccc;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.profiler-selector-box label {
  display: block;
  margin: 3px 0;
  cursor: pointer;
}

.profiler-metric-row {
  margin: 4px 0;
}

/* --- Framework Isolation Canvas Overlay --- */
.app-viewport-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  flex-direction: column;
  z-index: 10000;
}

.viewport-navbar {
  background: #111;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #222;
}

.viewport-title {
  color: #fff;
  font-weight: 600;
  margin: 0;
}

.viewport-controls {
  display: flex;
  gap: 10px;
}

.iframe-sandbox-container {
  flex: 1;
  background: #000;
}

.app-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* --- Live System Theme Engine Profiles --- */
body.light-theme-profile {
  background: linear-gradient(135deg, #e0f2e0, #a1dba1, #e0f2e0, #a1dba1);
  color: #051a05;
}
body.light-theme-profile button,
body.light-theme-profile .open-page-btn,
body.light-theme-profile .utility-btn {
  background: rgba(0, 0, 0, 0.06) !important;
  border-color: rgba(0, 0, 0, 0.2) !important;
  color: #0a3d0a !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 4px 15px rgba(0, 0, 0, 0.05);
}
body.light-theme-profile .game-card {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: #111;
}
body.light-theme-profile .game-card h3 {
  color: #1a5d1a;
}
body.light-theme-profile .search-bar {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.15);
  color: #000;
}
body.light-theme-profile .search-bar::placeholder {
  color: rgba(0, 0, 0, 0.5);
}
