/* ==========================================================================
   FINAL FANTASY VII - MAKO THEME STYLES
   ========================================================================== */

:root {
  --ff7-blue-start: #060b28;
  --ff7-blue-mid: #0b1a4f;
  --ff7-blue-end: #04091e;
  --ff7-border-outer: #00d2ff;
  --ff7-border-inner: #004d7a;
  --ff7-text-white: #ffffff;
  --ff7-text-yellow: #fff37a;
  --ff7-text-cyan: #70f0ff;
  --ff7-text-green: #50ff90;
  --ff7-gold: #ffd700;
  --ff7-box-bg: linear-gradient(180deg, rgba(8, 22, 68, 0.92) 0%, rgba(2, 6, 26, 0.96) 100%);
  --ff7-font-primary: 'Rajdhani', -apple-system, sans-serif;
  --ff7-font-title: 'Cinzel', serif;
  --ff7-font-pixel: 'Press Start 2P', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #02040a;
  font-family: var(--ff7-font-primary);
  color: var(--ff7-text-white);
}

/* Background Mako Canvas */
#mako-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* Application Layout Container */
.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 12px;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
}

/* FF7 Iconic Window Box Styling */
.ff7-box {
  background: var(--ff7-box-bg);
  border: 2px solid var(--ff7-border-outer);
  border-radius: 6px;
  box-shadow: 
    0 0 15px rgba(0, 210, 255, 0.25),
    inset 0 0 10px rgba(0, 77, 122, 0.5),
    inset 0 0 2px rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  position: relative;
}

/* Header Component */
.ff7-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ps1-badge {
  background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
  color: #fff;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 3px;
  border: 1px solid #555;
  letter-spacing: 1px;
}

.game-title {
  font-family: var(--ff7-font-title);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 10px rgba(112, 240, 255, 0.7);
}

.game-title .roman {
  color: var(--ff7-text-cyan);
  margin-left: 6px;
}

/* User Badge Header */
.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--ff7-border-inner);
}

.user-badge .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--ff7-border-outer);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-info .name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ff7-text-yellow);
}

.user-info .email {
  font-size: 0.7rem;
  color: #a0aec0;
}

/* Buttons */
.ff7-btn {
  font-family: var(--ff7-font-primary);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 1px;
  color: var(--ff7-text-white);
  background: linear-gradient(180deg, #132a68 0%, #081236 100%);
  border: 2px solid var(--ff7-border-outer);
  border-radius: 4px;
  padding: 10px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  text-decoration: none;
}

.ff7-btn:hover {
  background: linear-gradient(180deg, #1c3d96 0%, #0d1e57 100%);
  border-color: #ffffff;
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.6);
  transform: translateY(-1px);
}

.ff7-btn:active {
  transform: translateY(1px);
}

.ff7-btn.primary-btn, .ff7-btn.launch-btn {
  font-size: 1.2rem;
  padding: 14px 28px;
  border-color: var(--ff7-gold);
  color: var(--ff7-text-yellow);
}

.ff7-btn.mini {
  padding: 2px 8px;
  font-size: 0.8rem;
  border-radius: 50%;
  border-color: #e53e3e;
  background: #9b2c2c;
}

/* Main View Panel Routing */
.main-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.view-panel {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Center Cards */
.center-card, .login-card, .error-card, .dashboard-card {
  width: 100%;
  max-width: 480px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: center;
}

.finger-cursor {
  font-size: 1.4rem;
  margin-right: 8px;
  display: inline-block;
  animation: bounceCursor 1s infinite alternate;
}

@keyframes bounceCursor {
  0% { transform: translateX(0); }
  100% { transform: translateX(-6px); }
}

.ff7-desc {
  color: #cbd5e0;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Login Google Button */
.google-oauth-btn {
  background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
  color: #1a202c !important;
  border-color: #cbd5e0;
}

.google-oauth-btn:hover {
  background: #ffffff;
  border-color: var(--ff7-border-outer);
}

.g-icon {
  width: 20px;
  height: 20px;
}

/* Dev Login Box */
.dev-box {
  margin-top: 15px;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
  padding-top: 12px;
}

.dev-divider {
  font-size: 0.75rem;
  color: var(--ff7-text-cyan);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.dev-form {
  display: flex;
  gap: 8px;
}

.ff7-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--ff7-border-inner);
  border-radius: 4px;
  padding: 8px 12px;
  color: #fff;
  font-family: var(--ff7-font-primary);
  font-size: 0.9rem;
}

.ff7-input:focus {
  outline: none;
  border-color: var(--ff7-border-outer);
}

/* Launcher Dashboard */
.dashboard-card {
  max-width: 600px;
}

.save-status-bar {
  display: flex;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.5);
  padding: 10px;
  border-radius: 4px;
  border: 1px solid var(--ff7-border-inner);
  font-size: 0.85rem;
}

.status-item .label {
  color: #a0aec0;
  margin-right: 4px;
}

.status-item .value.cyan { color: var(--ff7-text-cyan); }
.status-item .value.green { color: var(--ff7-text-green); }
.status-item .value.yellow { color: var(--ff7-text-yellow); }

.hero-cover {
  background: linear-gradient(135deg, #091a3a 0%, #020716 100%);
  border: 1px solid var(--ff7-border-inner);
  padding: 30px 20px;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.hero-title {
  font-family: var(--ff7-font-title);
  font-size: 2rem;
  letter-spacing: 3px;
  text-shadow: 0 0 15px rgba(0, 210, 255, 0.8);
}

.hero-sub {
  font-size: 0.8rem;
  color: var(--ff7-text-cyan);
  letter-spacing: 2px;
  margin-top: 6px;
}

/* Game Stream Canvas / Video Wrapper */
.stream-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.screen-box {
  flex: 1;
  background: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ff7-border-outer);
  border-radius: 6px;
  overflow: hidden;
}

.game-canvas, .game-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Touch Controls Layout (Mobile) */
.touch-overlay {
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 10px 16px;
  pointer-events: none;
  z-index: 10;
}

.touch-overlay .t-btn {
  pointer-events: auto;
  background: rgba(0, 30, 80, 0.65);
  border: 2px solid rgba(0, 210, 255, 0.8);
  color: #fff;
  border-radius: 50%;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
  active-background: rgba(0, 100, 200, 0.9);
}

.touch-overlay .t-btn:active {
  background: rgba(0, 180, 255, 0.9);
  transform: scale(0.92);
}

/* D-Pad Container */
.dpad-container {
  width: 130px;
  height: 130px;
  position: relative;
}

.dpad-up { position: absolute; top: 0; left: 42px; width: 46px; height: 46px; border-radius: 6px 6px 0 0; }
.dpad-down { position: absolute; bottom: 0; left: 42px; width: 46px; height: 46px; border-radius: 0 0 6px 6px; }
.dpad-left { position: absolute; top: 42px; left: 0; width: 46px; height: 46px; border-radius: 6px 0 0 6px; }
.dpad-right { position: absolute; top: 42px; right: 0; width: 46px; height: 46px; border-radius: 0 6px 6px 0; }

/* PS1 Action Buttons */
.ps-buttons {
  width: 140px;
  height: 140px;
  position: relative;
}

.ps-btn {
  width: 48px;
  height: 48px;
  font-size: 1.1rem;
}

.btn-triangle { position: absolute; top: 0; left: 46px; color: #50ff90; border-color: #50ff90; }
.btn-square { position: absolute; top: 46px; left: 0; color: #ff70d2; border-color: #ff70d2; }
.btn-circle { position: absolute; top: 46px; right: 0; color: #ff5050; border-color: #ff5050; }
.btn-cross { position: absolute; bottom: 0; left: 46px; color: #50a0ff; border-color: #50a0ff; }

/* Center Start/Select */
.center-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.select-btn, .start-btn {
  border-radius: 12px !important;
  font-size: 0.65rem;
  padding: 4px 10px;
  height: 28px;
}

/* Shoulder Buttons */
.shoulder-controls {
  position: absolute;
  top: -60px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 16px;
}

.left-shoulders, .right-shoulders {
  display: flex;
  gap: 8px;
}

.s-btn {
  border-radius: 4px !important;
  font-size: 0.75rem;
  width: 42px;
  height: 30px;
}

/* Spinner */
.mako-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--ff7-border-inner);
  border-top-color: var(--ff7-border-outer);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.pulsate {
  animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* Footer Component */
.ff7-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  font-size: 0.8rem;
}

.mako-indicator.online {
  color: var(--ff7-text-green);
  font-weight: bold;
}
