/* ==========================================================================
   AVIELET.COM - PEAK 2003 FLASH PORTAL STYLESHEET
   Inspired by Newgrounds (2003), Miniclip, Y8 & Albino Blacksheep
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&family=Rubik:wght@500;700;900&display=swap');

:root {
  --bg-dark: #0d0e12;
  --panel-bg: #181b24;
  --panel-header: linear-gradient(180deg, #ff7b00 0%, #b84500 100%);
  --panel-header-green: linear-gradient(180deg, #39ff14 0%, #0d7a00 100%);
  --panel-header-blue: linear-gradient(180deg, #00b4ff 0%, #00478f 100%);
  --border-bevel-light: #4a5268;
  --border-bevel-dark: #07080a;
  --neon-orange: #ff8800;
  --neon-green: #39ff14;
  --neon-yellow: #ffe600;
  --neon-red: #ff2244;
  --text-main: #f0f4ff;
  --text-muted: #9aa4bf;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 123, 0, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(57, 255, 20, 0.07) 0%, transparent 45%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 3px);
  color: var(--text-main);
  font-family: 'Rubik', Tahoma, Verdana, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Screen shake for Nolan BWAAAH & Combos */
@keyframes heavyShake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-10px, -6px) rotate(-1.5deg); }
  20% { transform: translate(10px, 8px) rotate(1.5deg); }
  30% { transform: translate(-12px, 4px) rotate(-1deg); }
  40% { transform: translate(8px, -8px) rotate(1deg); }
  50% { transform: translate(-8px, 6px) rotate(-1.5deg); }
  60% { transform: translate(10px, -4px) rotate(1deg); }
  70% { transform: translate(-6px, 8px) rotate(-0.5deg); }
  80% { transform: translate(6px, -6px) rotate(0.5deg); }
  90% { transform: translate(-4px, 4px) rotate(0deg); }
}

body.screen-shake-heavy {
  animation: heavyShake 0.45s infinite;
}

/* Top Marquee News Ticker */
.top-ticker-bar {
  background: #000;
  border-bottom: 2px solid var(--neon-orange);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'VT323', monospace;
  font-size: 1.25rem;
  color: var(--neon-yellow);
}

.ticker-badge {
  background: var(--neon-red);
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  padding: 4px 8px;
  border: 1px solid #fff;
  white-space: nowrap;
  animation: blinkBadge 1s infinite;
}

@keyframes blinkBadge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.ticker-scroll {
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
}

.ticker-track {
  display: inline-block;
  padding-left: 100%;
  animation: tickerMove 38s linear infinite;
}

.ticker-track:hover {
  animation-play-state: paused;
}

@keyframes tickerMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Main Portal Header */
.portal-header {
  max-width: 1380px;
  margin: 10px auto;
  padding: 12px 18px;
  background: linear-gradient(180deg, #252b3b 0%, #12151e 100%);
  border: 3px outset var(--border-bevel-light);
  box-shadow: 0 6px 20px rgba(0,0,0,0.8);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mascot {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px var(--neon-orange));
  transition: transform 0.2s;
  cursor: pointer;
}

.brand-mascot:hover {
  transform: scale(1.18) rotate(-8deg);
}

.brand-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.75rem;
  color: var(--neon-orange);
  text-shadow: 3px 3px 0 #000, 0 0 12px rgba(255, 136, 0, 0.7);
  letter-spacing: 1px;
}

.brand-title span {
  color: var(--neon-green);
}

.brand-subtitle {
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  color: #cbd5f0;
  margin-top: 4px;
}

/* Instant Soundboard Action Buttons in Header */
.soundboard-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.retro-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.68rem;
  padding: 9px 12px;
  color: #fff;
  background: linear-gradient(180deg, #3b4359 0%, #1c202b 100%);
  border: 3px outset #636e8c;
  cursor: pointer;
  text-transform: uppercase;
  transition: transform 0.08s, filter 0.15s;
  user-select: none;
}

.retro-btn:hover {
  filter: brightness(1.22);
  border-color: var(--neon-yellow);
}

.retro-btn:active {
  border-style: inset;
  transform: translateY(2px);
}

.retro-btn.btn-orange {
  background: linear-gradient(180deg, #ff8800 0%, #a84400 100%);
  border-color: #ffbb66;
}

.retro-btn.btn-green {
  background: linear-gradient(180deg, #28cc00 0%, #0e6600 100%);
  border-color: #77ff55;
}

.retro-btn.btn-blue {
  background: linear-gradient(180deg, #0099ff 0%, #004499 100%);
  border-color: #66ccff;
}

.retro-btn.btn-red {
  background: linear-gradient(180deg, #ff2244 0%, #99001b 100%);
  border-color: #ff8899;
}

/* 3-Column Classic Portal Grid */
.portal-layout {
  max-width: 1380px;
  margin: 0 auto 30px;
  padding: 0 10px;
  display: grid;
  grid-template-columns: 270px 1fr 270px;
  gap: 14px;
  align-items: start;
}

@media (max-width: 1120px) {
  .portal-layout {
    grid-template-columns: 1fr;
  }
}

.portal-box {
  background: var(--panel-bg);
  border: 3px outset var(--border-bevel-light);
  box-shadow: 0 4px 12px rgba(0,0,0,0.65);
  margin-bottom: 14px;
  overflow: hidden;
}

.box-header {
  background: var(--panel-header);
  padding: 8px 12px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.72rem;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  border-bottom: 2px solid #000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.box-header.green { background: var(--panel-header-green); }
.box-header.blue { background: var(--panel-header-blue); }

.box-body {
  padding: 12px;
}

/* Lactose Intolerance Meter */
.lactose-meter-wrap {
  background: #090b0f;
  border: 2px inset #333;
  height: 26px;
  position: relative;
  margin: 8px 0;
  overflow: hidden;
}

.lactose-bar-fill {
  height: 100%;
  width: 14%;
  background: linear-gradient(90deg, #00cc44, #88ff00);
  transition: width 0.3s ease;
}

.lactose-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
}

/* Playable Games Grid */
.games-grid-playable {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 700px) {
  .games-grid-playable {
    grid-template-columns: 1fr;
  }
}

.game-card {
  background: #10131a;
  border: 3px outset #4a536b;
  padding: 10px;
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
  position: relative;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--neon-orange);
  background: #191f2c;
}

.game-card.playable-featured {
  border-color: var(--neon-green);
}

.game-thumb {
  width: 92px;
  height: 92px;
  background: radial-gradient(circle, #2e3852 0%, #0e1017 100%);
  border: 2px inset #333;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.game-thumb img {
  width: 84px;
  height: 84px;
  object-fit: contain;
}

.badge-hot {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--neon-green);
  color: #000;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  padding: 3px 5px;
  font-weight: bold;
}

.badge-locked {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ff2244;
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.48rem;
  padding: 3px 5px;
}

.game-info h3 {
  font-size: 0.98rem;
  color: var(--neon-yellow);
  margin-bottom: 4px;
}

.game-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 6px;
}

.game-meta {
  font-family: 'VT323', monospace;
  font-size: 0.95rem;
  color: var(--neon-green);
}

/* Fake / Joke Games Grid */
.games-grid-fake {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

/* Active Flash Player Stage */
.flash-stage-container {
  background: #050608;
  border: 4px inset #394154;
  min-height: 460px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.flash-stage-topbar {
  background: #1e2330;
  padding: 6px 12px;
  border-bottom: 2px solid #000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'VT323', monospace;
  font-size: 1.15rem;
}

.flash-stage-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
  position: relative;
  min-height: 410px;
}

/* Fake Ads & Leaderboard */
.leaderboard-list {
  list-style: none;
  font-family: 'VT323', monospace;
  font-size: 1.15rem;
}

.leaderboard-list li {
  display: flex;
  justify-content: space-between;
  padding: 5px 4px;
  border-bottom: 1px dashed #2e3446;
}

.leaderboard-list li span.rank-1 { color: var(--neon-yellow); }

.fake-ad-banner {
  background: linear-gradient(135deg, #2b0938 0%, #0f172a 100%);
  border: 2px dashed var(--neon-yellow);
  padding: 10px;
  text-align: center;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.15s;
}

.fake-ad-banner:hover {
  transform: scale(1.02);
}

.fake-ad-banner img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  margin: 4px auto;
  display: block;
}

.fake-ad-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.62rem;
  color: var(--neon-yellow);
  margin-bottom: 4px;
  line-height: 1.4;
}

/* Fake User Comments */
.comment-item {
  background: #12151e;
  border: 1px solid #2a3142;
  padding: 8px 10px;
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.comment-avatar {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: #23293a;
  border: 1px solid var(--neon-orange);
  flex-shrink: 0;
}

.comment-user {
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  color: var(--neon-orange);
}

.comment-text {
  font-size: 0.83rem;
  color: #d6def5;
  margin-top: 2px;
}

/* ==========================================================================
   GLOBAL EASTER EGG OVERLAYS (TOASTY, NOLAN IMAX, CERVEZA CRISTAL)
   ========================================================================== */

.toasty-popup {
  position: fixed;
  bottom: -320px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transition: bottom 0.22s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.toasty-popup.active {
  bottom: -10px;
}

.toasty-popup img {
  width: 175px;
  height: auto;
  filter: drop-shadow(0 0 14px rgba(255, 230, 0, 0.9));
}

.toasty-bubble {
  background: #fff;
  color: #000;
  border: 4px solid #000;
  border-radius: 12px;
  padding: 8px 12px;
  text-align: center;
  margin-bottom: 4px;
  box-shadow: 4px 4px 0 #ff2244;
}

.toasty-main-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.85rem;
  color: #d9001b;
}

.toasty-sub-text {
  font-size: 0.85rem;
  font-weight: 900;
  color: #111;
  margin-top: 3px;
}

/* Nolan IMAX 70mm Overlay */
.nolan-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nolan-overlay.active {
  opacity: 1;
}

.imax-bar {
  background: #000;
  color: #a8b2cc;
  font-family: 'VT323', monospace;
  font-size: 1.15rem;
  letter-spacing: 3px;
  height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: height 0.28s ease;
  border-color: #d4af37;
}

.nolan-overlay.active .imax-bar {
  height: 95px;
}

.nolan-center-stare {
  text-align: center;
  background: radial-gradient(circle, rgba(0,0,0,0.82) 0%, transparent 70%);
  padding: 20px;
}

.nolan-center-stare img {
  width: 190px;
  filter: contrast(1.35) sepia(0.25) drop-shadow(0 0 25px #00b4ff);
}

.nolan-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.25rem;
  letter-spacing: 8px;
  color: #fff;
  margin-top: 10px;
  text-shadow: 0 0 16px #00b4ff;
}

.nolan-sub {
  font-family: 'VT323', monospace;
  font-size: 1.4rem;
  color: #ffd700;
  margin-top: 6px;
}

/* Cerveza Cristal VHS Overlay & Generic Joke Modal */
.cerveza-overlay,
.joke-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9995;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cerveza-tv-frame,
.joke-modal-box {
  background: linear-gradient(180deg, #1b2234 0%, #0d111a 100%);
  border: 4px outset var(--neon-yellow);
  max-width: 640px;
  width: 100%;
  padding: 20px;
  text-align: center;
  position: relative;
  box-shadow: 0 0 40px rgba(255, 230, 0, 0.5);
}

.cerveza-badge {
  background: #d9001b;
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  padding: 6px;
  margin-bottom: 12px;
}

.obiwan-quote {
  font-style: italic;
  color: #9bd0ff;
  margin-bottom: 14px;
  font-size: 1rem;
}

.cerveza-reveal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 14px 0;
}

.cerveza-aviel-face {
  width: 115px;
  height: 115px;
  object-fit: contain;
  animation: bounceBeer 0.6s infinite alternate;
}

.cerveza-aviel-face.flip {
  transform: scaleX(-1);
}

@keyframes bounceBeer {
  from { transform: translateY(0) rotate(-5deg); }
  to { transform: translateY(-12px) rotate(6deg); }
}

.cerveza-bottle {
  background: linear-gradient(180deg, #156b26 0%, #093b12 100%);
  border: 3px solid #ffd700;
  border-radius: 14px 14px 6px 6px;
  padding: 12px 18px;
  color: #fff;
  box-shadow: 0 0 25px #39ff14;
}

.cristal-logo {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.9rem;
  color: #ffd700;
  line-height: 1.4;
}

.cristal-sub {
  display: block;
  font-family: 'VT323', monospace;
  font-size: 1rem;
  margin-top: 4px;
}

.cerveza-lyrics {
  font-family: 'Press Start 2P', monospace;
  font-size: 1rem;
  color: var(--neon-green);
  margin: 14px 0;
}

/* ==========================================================================
   FINAL POLISH: 2003 CRT MONITOR SCANLINES & ONIO RAIN SHOWER
   ========================================================================== */

body.crt-active::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background:
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.35) 50%),
    radial-gradient(circle at center, transparent 60%, rgba(0, 0, 0, 0.45) 100%);
  background-size: 100% 4px, 100% 100%;
}

.flash-stage-container:fullscreen {
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px;
}

.flash-stage-container:fullscreen canvas {
  max-height: calc(100vh - 70px);
  width: auto !important;
  margin: 0 auto;
}

.onio-rain-item {
  position: fixed;
  top: -60px;
  z-index: 9997;
  pointer-events: none;
  font-size: 2.2rem;
  animation: onioFall linear forwards;
}

@keyframes onioFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(110vh) rotate(540deg); opacity: 0; }
}
