/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-weight: 400 !important;
}
h1, h2, h3, h4, h5, h6 {
  font-weight: 400 !important;
}

@media (min-width: 769px) {
  html { zoom: 0.77; }
}
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  color: var(--text-primary);
  background: #0a0a14;
}

a { text-decoration: none; color: inherit; cursor: pointer; }
button { cursor: pointer; border: none; outline: none; background: none; font-family: inherit; color: inherit; }
input, textarea, select { font-family: var(--font-small); outline: none; border: none; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* App Container */
.app-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Background */
.app-background {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image: var(--bg-page);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  transition: opacity 0.5s ease;
}

/* Main Panel — adaptive to actual viewport */
.main-panel {
  position: relative;
  z-index: 1;
  width: calc(100% - 20px);
  max-width: 1600px;
  height: calc(100vh - 2px);
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  backdrop-filter: var(--glass-blur-strong);
  -webkit-backdrop-filter: var(--glass-blur-strong);
  border-radius: 32px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Glass Panel Base */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

/* Page Visibility */
.page { display: none; }
.page.active { display: block; }

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-small);
  font-size: 14px;
  z-index: 99999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  z-index: 5000;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.85);
  z-index: 6000;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.lightbox-overlay img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: var(--radius-lg);
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 30px;
  font-size: 36px;
  color: white;
  z-index: 6001;
}

/* Flip */
.flip-h { transform: scaleX(-1); }
