/* ===== cobalt-blue GBA-SP palette ===== */
:root{
  --shell-light:#4b6dd4;
  --shell-dark :#2c4ba6;
  --bezel      :#262626;
  --lcd-top    :#add2ff;
  --lcd-bot    :#e6f3ff;
  --btn-face   :#4b5357;
  --btn-shadow :rgba(0,0,0,.45);
}

/* ==== reset & centring ==== */
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;overflow:hidden}
body.boot,body{             /* boot class removed after flash */
  font-family:'Press Start 2P',monospace;
  background:#f4f7ff;
  display:flex;align-items:center;justify-content:center;
}

/* ===== shell ===== */
.device{
  width:clamp(280px,90vw,360px);
  height:90vh;max-height:640px;
  display:flex;flex-direction:column;
  padding:1.4rem 1rem 1.4rem;
  border-radius:18px;
  background:linear-gradient(145deg, #5a7ae6 0%, #4b6dd4 25%, #3d5bb8 50%, #2c4ba6 75%, #1f3785 100%);
  box-shadow:
    0 2px 4px rgba(255,255,255,0.2) inset,
    0 -2px 8px rgba(0,0,0,0.3) inset,
    0 8px 32px rgba(0,0,0,0.4),
    0 2px 8px rgba(0,0,0,0.2);
  position:relative;
}

/* ===== TOP – screen ===== */
.screen{
  flex:1 1 40%;
  background:linear-gradient(145deg, #2c2c2c 0%, var(--bezel) 50%, #1a1a1a 100%);
  border:4px solid #000;
  border-radius:8px;
  padding:0.8rem 0.8rem 0.1rem;
  margin-bottom:20px;
  display:flex;flex-direction:column;
  position:relative;
  box-shadow:
    0 3px 6px rgba(0,0,0,0.6) inset,
    0 -1px 3px rgba(255,255,255,0.1) inset,
    0 4px 12px rgba(0,0,0,0.3);
}

/* Shell corner dots - positioned on blue shell around screen */
.device::before{
    content:'';
    position:absolute;
    top:calc(1rem - 14px);left:calc(0.9rem - 2.6px);right:calc(0.9rem - 2.6px);
    height:24px;
    background:
        radial-gradient(circle at 10.5px 10.5px, #1a2966 6.56px, transparent 6.56px),
        radial-gradient(circle at calc(100% - 10.5px) 10.5px, #1a2966 6.56px, transparent 6.56px);
    background-size:31.5px 31.5px, 31.5px 31.5px;
    background-repeat:no-repeat;
    background-position:left top, right top;
    z-index:1;
}
.device::after{
  content:'';
  position:absolute;
  top:calc(40% + 10px);left:calc(0.9rem - 2.6px);right:calc(0.9rem - 2.6px);
  height:24px;
  background:
    radial-gradient(circle at 10.5px 10.5px, #1a2966 6.56px, transparent 6.56px),
    radial-gradient(circle at calc(100% - 10.5px) 10.5px, #1a2966 6.56px, transparent 6.56px);
  background-size:31.5px 31.5px, 31.5px 31.5px;
  background-repeat:no-repeat;
  background-position:left top, right top;
  z-index:1;
}
.lcd{
  height:calc(100% - 26px);          /* space for logo */
  background:linear-gradient(135deg, var(--lcd-top) 0%, #cde5ff 30%, var(--lcd-bot) 70%, #d9ebff 100%);
  border:2px solid #1c1c1c;
  border-radius:3px;
  overflow:hidden;
  position:relative;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.4) inset,
    0 -1px 2px rgba(255,255,255,0.1) inset;
}

/* Brightness overlay for dimmed mode */
.lcd::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  z-index: 500;
  pointer-events: none;
}

.lcd.dimmed::before {
  opacity: 1;
}

/* Background GIF styles */
.lcd::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('../background.gif') center center no-repeat;
  background-size: cover;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.5s ease-in;
}

.lcd.show-background::after {
  opacity: 1;
}
  /* boot flash */
  body.boot .lcd::before{
    content:'';
    position:absolute;inset:0;background:#fff;z-index:10;
    animation:bootFlash .4s steps(1) forwards,
              bootFade  2.4s .4s forwards;
  }
  @keyframes bootFlash{0%,100%{background:#fff}50%{background:#000}}
  @keyframes bootFade {to{opacity:0}}

.lcd-content {
  padding: 0;
  color: #000;
  font-size: .55rem;
  position: relative;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-in, visibility 0.5s ease-in;
  height: 100%;
  overflow: hidden;
}

.lcd-content.show {
  opacity: 1;
  visibility: visible;
}

/* Game container layout with content and menu */
.game-container {
  display: flex;
  height: 100%;
  padding: 0.1rem;
  position: relative;
}

/* Fade overlay for navigation transitions */
.fade-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
  z-index: 1000;
}

.fade-overlay.fade-in {
  opacity: 1;
}

/* Menu instructions in bottom left */
.menu-instructions {
  position: absolute;
  bottom: .3rem;
  left: .5rem;
  font-size: .4rem;
  color: #002061;
  background-color: rgba(255, 255, 255, 0.8);
  padding: .2rem .4rem;
  border-radius: 2px;
  border: 1px solid #002061;
  z-index: 10;
  transition: opacity 0.3s ease-in-out;
  animation: blink-instruction 2s ease-in-out infinite;
}

/* Hide instructions in detail mode */
.game-container.detail-mode .menu-instructions {
  opacity: 0;
  pointer-events: none;
}

.game-content {
  flex: 1;
  padding: .6rem;
  overflow-y: auto;
  margin-right: 0.3rem;
}

/* Menu styling */
.game-menu {
  width: 28%;
  height: calc(100% - 0.6rem);
  max-height: 95%;
  background-color: #fff;
  border: 2px solid #333;
  border-radius: 3px;
  box-shadow: 
    0 0 0 1px #666,
    0 0 0 3px #fff,
    0 0 0 4px #333;
  margin: 0.3rem;
  padding: 0.3rem 0;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.menu-items {
  list-style-type: none;
  padding: 0;
  margin: 0;
  margin-top: 0.8rem;
  margin-left: 0.4rem;
  display: flex;
  flex-direction: column;
  width: calc(100% - 0.5rem);
}

/* Menu item with fixed spacing */
.menu-item {
  padding: 0.25rem 0.15rem 0.25rem 0.3rem;
  cursor: pointer;
  position: relative;
  font-size: 0.45rem;
  color: #333;
  display: flex;
  align-items: center;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  height: 1.1rem;
  line-height: 1;
}

/* Active menu item styling */
.menu-item.active {
  color: #002061;
  font-weight: bold;
}

/* Menu pointer - triangle that moves between items */
.menu-pointer {
  position: absolute;
  left: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.25rem 0 0.25rem 0.3rem;
  border-color: transparent transparent transparent #000066;
  transition: top 0.2s ease-out;
  animation: blink-pointer 0.8s step-end infinite;
  will-change: top;
}

/* Blinking animation for pointer */
@keyframes blink-pointer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Content sections */
.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

.content-section h2 {
  font-size: .7rem;
  color: #002061;
  margin-bottom: .6rem;
  text-shadow: 0 1px 1px rgba(255,255,255,0.7);
  background-color: white;
  padding: 0.3rem 0.5rem;
  border-radius: 3px;
  border: 1px solid #002061;
}

.content-section section {
  display: block;
}

section p {
  margin-bottom: .2rem;
  line-height: 1.3;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 3px;
  border-radius: 2px;
}

/* Detail view styles */
.detail-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--lcd-top) 0%, var(--lcd-bot) 100%);
  display: none;
  z-index: 10;
}

.detail-view.active {
  display: flex;
  flex-direction: column;
}

.detail-content {
  flex: 1;
  padding: .3rem;
  overflow: hidden;
  position: relative;
  /* Hide scrollbar for WebKit browsers (Chrome, Safari, Edge) */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for WebKit browsers */
.detail-content::-webkit-scrollbar {
  display: none;
}

.detail-content h2 {
  font-size: .6rem;
  color: #002061;
  margin-bottom: .3rem;
  text-shadow: 0 1px 1px rgba(255,255,255,0.7);
  text-align: center;
  border-bottom: 1px solid #002061;
  padding-bottom: .2rem;
}

.detail-body {
  font-size: .5rem;
  line-height: 1.4;
  color: #002061;
}

.detail-body h3 {
  font-size: .55rem;
  margin: .6rem 0 .3rem 0;
  color: #001a4d;
}

.detail-body h4 {
  font-size: .5rem;
  margin: .4rem 0 .2rem 0;
  color: #002061;
}

.detail-body p {
  margin-bottom: .3rem;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 3px;
  border-radius: 2px;
}

.detail-body ul {
  margin: .3rem 0 .3rem 0;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 3px;
  border-radius: 2px;
  padding-left: 1rem;
}

.detail-body li {
  margin-bottom: .2rem;
}

.experience-item, .education-item, .contact-item {
  background-color: rgba(255, 255, 255, 0.5);
  padding: .4rem;
  margin-bottom: .4rem;
  border-radius: 3px;
  border: 1px solid rgba(0, 32, 97, 0.2);
}

.company, .school {
  font-size: .45rem;
  color: #4b6dd4;
  margin: .2rem 0;
}

.skill-category {
  margin-bottom: .5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
}

.skill-item {
  background-color: #4b6dd4;
  color: white;
  padding: .15rem .3rem;
  border-radius: 2px;
  font-size: .4rem;
  display: inline-block;
}

.back-instruction {
  position: absolute;
  bottom: .3rem;
  right: .5rem;
  font-size: .4rem;
  color: #002061;
  background-color: rgba(255, 255, 255, 0.8);
  padding: .2rem .4rem;
  border-radius: 2px;
  border: 1px solid #002061;
  animation: blink-instruction 2s ease-in-out infinite;
}

/* Blinking animation for back instruction */
@keyframes blink-instruction {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Menu view state */
.menu-view {
  display: block;
}

.menu-view.active {
  display: block;
}

.game-container.detail-mode .menu-view {
  display: none;
}

.game-container.detail-mode .game-menu {
  display: none;
}

.logo{
  font-size:.6rem;color:#f7f7f7;letter-spacing:.3px;
  text-align:center;margin-top:2px;font-weight:normal;
}

/* ===== HINGE ===== */
.hinge{
  height:20px;margin:.32rem 0;
  border-radius:10px;
  background:linear-gradient(180deg,#5571db 0%,#2c4ba6 50%, #1f3785 100%);
  box-shadow:inset 0 3px 6px rgba(255,255,255,.2),
              inset 0 -2px 4px rgba(0,0,0,.6),
              0 1px 2px rgba(0,0,0,.3);
  position:relative;
}
.hinge::before{
  content:'';
  position:absolute;
  top:50%;left:50%;
  transform:translate(-50%, -50%);
  width:60%;height:2px;
  background:rgba(255,255,255,.15);
  border-radius:1px;
}

/* ===== BOTTOM – controls ===== */
.controls{flex:1 1 50%;position:relative;perspective:500px}

/* D-pad with recessed area */
.dpad{
  position:absolute;left:20%;top:35%;
  transform:translate(-50%,-50%);
  width:90px;height:90px;
  background:linear-gradient(145deg, #1f3785 0%, #2c4ba6 30%, #3d5bb8 60%, #4b6dd4 100%);
  border-radius:50%;
  box-shadow:
    0 -1px 3px rgba(255,255,255,0.1) inset,
    0 3px 8px rgba(0,0,0,0.8) inset,
    0 2px 6px rgba(0,0,0,0.3);
  display:flex;align-items:center;justify-content:center;
  position:relative;
}
.dpad::before{
  content:'';
  position:absolute;
  width:64px;height:64px;
  background:linear-gradient(145deg, #6b7075 0%, #5a5e63 30%, #4a4e52 70%, #3a3e42 100%);
  clip-path:polygon(
   37% 0,63% 0,63% 37%,100% 37%,100% 63%,63% 63%,
   63% 100%,37% 100%,37% 63%,0 63%,0 37%,37% 37%);
  box-shadow:
    0 1px 3px rgba(255,255,255,0.3) inset,
    0 -2px 6px rgba(0,0,0,0.8) inset,
    0 2px 8px rgba(0,0,0,0.4),
    0 1px 3px rgba(0,0,0,0.2);
  cursor:pointer;
  transition:transform 0.1s ease;
  transform-style:preserve-3d;
  z-index:1;
}

/* D-pad directional areas */
.dpad-up, .dpad-down, .dpad-left, .dpad-right{
  position:absolute;
  cursor:pointer;
  z-index:3;
}
.dpad-up{
  top:13px;left:50%;transform:translateX(-50%);
  width:26px;height:26px;
}
.dpad-down{
  bottom:13px;left:50%;transform:translateX(-50%);
  width:26px;height:26px;
}
.dpad-left{
  left:13px;top:50%;transform:translateY(-50%);
  width:26px;height:26px;
}
.dpad-right{
  right:13px;top:50%;transform:translateY(-50%);
  width:26px;height:26px;
}

/* D-pad press effects */
.dpad.pressing-up::before{
  transform:rotateX(14deg);
  box-shadow:inset 2px 2px 4px rgba(255,255,255,0.5),
             inset -3px -3px 6px rgba(0,0,0,0.9),
             0 4px 8px rgba(0,0,0,0.25),
             0 2px 4px rgba(0,0,0,0.15);
}
.dpad.pressing-down::before{
  transform:rotateX(-14deg);
  box-shadow:inset 2px 2px 4px rgba(255,255,255,0.5),
             inset -3px -3px 6px rgba(0,0,0,0.9),
             0 1px 3px rgba(0,0,0,0.3);
}
.dpad.pressing-left::before{
  transform:rotateY(-12deg);
  box-shadow:inset 2px 2px 4px rgba(255,255,255,0.5),
             inset -3px -3px 6px rgba(0,0,0,0.9),
             3px 2px 6px rgba(0,0,0,0.25);
}
.dpad.pressing-right::before{
  transform:rotateY(16deg);
  box-shadow:inset 2px 2px 4px rgba(255,255,255,0.5),
             inset -3px -3px 6px rgba(0,0,0,0.9),
             -3px 2px 6px rgba(0,0,0,0.25);
}

/* A/B pill */
.ab-pill{
  position:absolute;right:2%;top:35%;
  transform:translateY(-50%) rotate(-15deg);
  width:130px;height:64px;border-radius:32px;
  background:linear-gradient(145deg, #1f3785 0%, #2747a0 30%, #2c4ba6 70%, #3d5bb8 100%);
  box-shadow:
    0 -1px 3px rgba(255,255,255,0.1) inset,
    0 2px 6px rgba(0,0,0,0.8) inset,
    0 2px 8px rgba(0,0,0,0.3);
  display:flex;align-items:center;justify-content:space-between;
  padding:0 12px;
}
.ab-btn{
  transform:rotate(15deg);
  width:40px;height:40px;border-radius:50%;border:none;
  background:linear-gradient(145deg, #6b7075 0%, var(--btn-face) 50%, #3a3e42 100%);
  box-shadow:
    0 1px 3px rgba(255,255,255,0.4) inset,
    0 -2px 4px rgba(0,0,0,0.6) inset,
    0 3px 6px rgba(0,0,0,0.25),
    0 1px 2px rgba(0,0,0,0.15);
  font-size:.65rem;font-weight:bold;color:#2a2e32;cursor:pointer;
  transition:all 0.1s ease;
}
.ab-btn:active,
.ab-btn.pressed{
  transform:rotate(15deg) translateY(1px);
  box-shadow:inset 1px 1px 2px rgba(255,255,255,0.3),
             inset -3px -3px 5px rgba(0,0,0,0.7),
             0 1px 3px rgba(0,0,0,0.3);
}

/* Speaker grille 4×4 */
.speaker{
  position:absolute;bottom:90px;left:50%;
  transform:translateX(-50%);
  display:grid;gap:12px;
  grid-template:repeat(4,4px)/repeat(4,4px);
}
.speaker div{
  width:4px;height:5px;border-radius:50%;background:#1f1f1f;
}

/* Power indicators - two small rectangles */
.power-indicators{
  position:absolute;right:-12px;top:5%;
  display:flex;flex-direction:column;gap:10px;
}
.power-indicator{
  width:6px;height:12px;
  background:linear-gradient(90deg, #4b5357, #4b5357);
  border-radius:1px;
  box-shadow:inset 1px 0 2px rgba(0,0,0,0.4),
             inset -1px 0 1px rgba(255,255,255,0.1);
}
.power-indicator.on{
  background:linear-gradient(90deg, #228B22, #32CD32);
  box-shadow:inset 1px 0 2px rgba(0,0,0,0.4),
             inset -1px 0 1px rgba(255,255,255,0.2),
             0 0 3px rgba(50,205,50,0.3);
}

/* Start / Select with recessed areas */
.startselect{
  position:absolute;bottom:20px;left:50%;transform:translateX(-50%);
  display:flex;gap:32px;font-size:.4rem;color:#1a2966;text-align:center;
}
.startselect > div{
  position:relative;
  display:flex;flex-direction:column;
  align-items:center;
  gap:12px;
}
.startselect > div::before{
  content:'';
  position:absolute;
  bottom:-9px;left:50%;
  transform:translateX(-50%);
  width:40px;height:40px;
  background:linear-gradient(145deg, #1f3785 0%, #2c4ba6 50%, #3d5bb8 100%);
  border-radius:50%;
  box-shadow:
    0 -1px 2px rgba(255,255,255,0.1) inset,
    0 2px 6px rgba(0,0,0,0.8) inset,
    0 1px 3px rgba(0,0,0,0.2);
  z-index:-1;
}
.startselect button{
  width:22px;height:22px;border-radius:50%;border:none;
  background:linear-gradient(145deg, #6b7075 0%, var(--btn-face) 50%, #3a3e42 100%);
  box-shadow:
    0 1px 2px rgba(255,255,255,0.4) inset,
    0 -1px 3px rgba(0,0,0,0.6) inset,
    0 2px 4px rgba(0,0,0,0.2),
    0 1px 1px rgba(0,0,0,0.1);
  cursor:pointer;
  transition:all 0.1s ease;
}
.startselect button:active{
  transform:translateY(1px);
  box-shadow:inset 1px 1px 1px rgba(255,255,255,0.3),
             inset -2px -2px 4px rgba(0,0,0,0.7),
             0 1px 2px rgba(0,0,0,0.25);
}

/* Brightness button - centered above start/select */
.brightness{
  position:absolute;bottom:85%;left:50%;transform:translateX(-50%);
  font-size:.32rem;color:#000;text-align:center;
}
.brightness > div{
  position:relative;
}
.brightness > div::before{
  content:'';
  position:absolute;
  top:-4px;left:50%;
  transform:translateX(-50%);
  width:24px;height:24px;
  background:linear-gradient(145deg, #1f3785 0%, #2c4ba6 50%, #3d5bb8 100%);
  border-radius:50%;
  box-shadow:
    0 -1px 2px rgba(255,255,255,0.1) inset,
    0 2px 4px rgba(0,0,0,0.8) inset,
    0 1px 2px rgba(0,0,0,0.2);
  z-index:-1;
}
.brightness button{
  width:18px;height:18px;border-radius:50%;border:none;
  background:var(--btn-face);
  box-shadow:inset 1px 1px 2px rgba(255,255,255,0.4),
             inset -1px -1px 3px rgba(0,0,0,0.6),
             0 2px 4px rgba(0,0,0,0.2),
             0 1px 1px rgba(0,0,0,0.1);
  cursor:pointer;
  transition:all 0.1s ease;
  display:flex;align-items:center;justify-content:center;
  position:relative;
  left:50%;
  transform:translateX(-50%);
}
.brightness button svg{
  width:10px;height:10px;
  fill:#2a2e32;
}
.brightness button:active{
  transform:translateX(-50%) translateY(1px);
  box-shadow:inset 1px 1px 1px rgba(255,255,255,0.3),
             inset -2px -2px 4px rgba(0,0,0,0.7),
             0 1px 2px rgba(0,0,0,0.25);
}

/* Loading screen styles - positioned inside LCD */
.loading-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--lcd-top) 0%, #cde5ff 30%, var(--lcd-bot) 70%, #d9ebff 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
  border-radius: 3px;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-logo-svg {
  width: 144px;
  height: 93px;
  margin: 1rem 0;
  animation: spin3d 3s linear infinite;
  image-rendering: pixelated;
  image-rendering: -webkit-optimize-contrast;
  transform-style: preserve-3d;
  filter: contrast(1.1);
}

@keyframes spin3d {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

.loading-message {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  color: #002061;
  text-align: center;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
  animation: pulse 1s infinite;
  line-height:1rem;
  margin-bottom: 0.5rem;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading-logo {
  font-family: 'Press Start 2P', monospace;
  font-size: 1rem;
  color: #002061;
  text-align: center;
  margin-top: 0.5rem;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
  letter-spacing: 0.1em;
}

/* Hide LCD content initially */
.lcd-content {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-in, visibility 0.5s ease-in;
}

.lcd-content.show {
  opacity: 1;
  visibility: visible;
}

/* Contact link styling */
.contact-link {
  color: #4b6dd4;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.1rem 0.2rem;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.contact-link:hover {
  background-color: rgba(75, 109, 212, 0.1);
}

.contact-link.active {
  background-color: #4b6dd4;
  color: white;
  text-decoration: none;
}

/* Detail view navigation pointer */
.detail-view-pointer {
  position: absolute;
  left: 0.3rem;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.25rem 0 0.25rem 0.3rem;
  border-color: transparent transparent transparent #002061;
  transition: top 0.2s ease-out;
  animation: blink-pointer 0.8s step-end infinite;
  will-change: top;
  z-index: 5;
  display: none;
}

.detail-view.active .detail-view-pointer {
  display: block;
}

/* Interactive elements in detail view */
.detail-interactive {
  position: relative;
  cursor: pointer;
}

.detail-interactive.active {
  background-color: rgba(75, 109, 212, 0.1);
  border-radius: 2px;
}

/* Contact page specific styles */
.contact-carousel {
  margin: 1rem 0 2rem 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  border: 1px solid rgba(0, 32, 97, 0.2);
}

.contact-carousel-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  height: 5rem; /* Fixed height to prevent resizing */
  position: relative;
}

.carousel-arrow {
  width: 1.5rem;
  height: 1.5rem;
  color: #002061;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s ease;
  flex-shrink: 0;
}

.carousel-arrow:hover {
  opacity: 1;
}

.carousel-arrow svg {
  width: 100%;
  height: 100%;
}

.contact-icon-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 100%;
  min-width: 8rem; /* Fixed minimum width to prevent layout shift */
}

.contact-carousel-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 0.5rem;
  border-radius: 4px;
}

.contact-carousel-item.active {
  opacity: 1;
  border: 2px solid #002061;
  background-color: rgba(75, 109, 212, 0.2);
}

.contact-carousel-item.active .carousel-icon,
.contact-carousel-item.active .carousel-label {
  animation: blink-contact 1s ease-in-out infinite;
}

.carousel-icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.carousel-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: #002061;
  text-align: center;
  line-height: 1.1;
  word-break: break-word;
  max-width: 100%;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  background: rgba(0, 32, 97, 0.3);
  border-radius: 0;
  transition: all 0.3s ease;
  /* Pixelated square dots */
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.carousel-dot.active {
  background: #002061;
  transform: scale(1.2);
}

/* Blinking animation for active contact item */
@keyframes blink-contact {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}

/* Blogs carousel styles */
.blogs-carousel {
  margin: 0.4rem 0 0.4rem 0;
  padding: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  border: 1px solid rgba(0, 32, 97, 0.2);
}

.blogs-carousel-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
  height: 6rem;
  position: relative;
}

.blogs-icon-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 100%;
  width: 12rem;
  max-width: 12rem;
}

.blogs-carousel-item {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 4px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  cursor: pointer;
  height: 100%;
  width: 12rem;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.8);
}

.blogs-carousel-item.active {
  display: flex;
  opacity: 1;
  border: 2px solid #002061;
  background-color: rgba(75, 109, 212, 0.2);
}

.blogs-carousel-item.active .carousel-icon,
.blogs-carousel-item.active .carousel-label {
  animation: blink-blogs 1s ease-in-out infinite;
}

/* Specific styling for blogs carousel icons and labels */
.blogs-carousel-item .carousel-icon {
  width: 2.8rem;
  height: 2.8rem;
  margin-top: 0.3rem;
  margin-bottom: 0.3rem;
  flex-shrink: 0;
}

.blogs-carousel-item .carousel-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.48rem;
  color: #002061;
  text-align: center;
  line-height: 1.1;
  word-break: break-word;
  max-width: 100%;
  margin-bottom: 0.3rem;
  flex-grow: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Blinking animation for active blogs item */
@keyframes blink-blogs {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}

/* Videos carousel styles */
.videos-carousel {
  margin: 0.4rem 0 0.4rem 0;
  padding: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  border: 1px solid rgba(0, 32, 97, 0.2);
}

.videos-carousel-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
  height: 6rem;
  position: relative;
}

.videos-icon-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 100%;
  width: 12rem;
  max-width: 12rem;
}

.videos-carousel-item {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 4px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  cursor: pointer;
  height: 100%;
  width: 12rem;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.8);
}

.videos-carousel-item.active {
  display: flex;
  opacity: 1;
  border: 2px solid #002061;
  background-color: rgba(75, 109, 212, 0.2);
}

/* Specific styling for videos carousel icons and labels */
.videos-carousel-item .carousel-icon {
  width: 2.8rem;
  height: 2.8rem;
  margin-top: 0.3rem;
  margin-bottom: 0.3rem;
  flex-shrink: 0;
}

.videos-carousel-item .carousel-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.48rem;
  color: #002061;
  text-align: center;
  line-height: 1.1;
  word-break: break-word;
  max-width: 100%;
  margin-bottom: 0.3rem;
  flex-grow: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
}

.videos-carousel-item.active .carousel-icon,
.videos-carousel-item.active .carousel-label {
  animation: blink-videos 1s ease-in-out infinite;
}

/* Blinking animation for active videos item */
@keyframes blink-videos {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}

/* Instructional text in carousel sections */
.videos-carousel p,
.blogs-carousel p,
.contact-carousel p {
  font-size: 0.35rem !important;
  line-height: 1.1;
  margin: 0.2rem 0 0 0;
  padding: 0.15rem 0.25rem;
  background-color: rgba(255, 255, 255, 0.6) !important;
}

/* Specific constraints for blogs and videos sections to prevent overflow */
#blogs-detail .detail-content,
#videos-detail .detail-content {
  overflow: hidden;
  max-height: 100%;
  padding: .3rem .3rem .1rem .3rem;
}

#blogs-detail .detail-body,
#videos-detail .detail-body {
  height: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#blogs-detail .blogs-carousel,
#videos-detail .videos-carousel {
  margin: 0.2rem 0 0.2rem 0;
  padding: 0.4rem;
}

/* Ensure instructional text fits */
#blogs-detail .detail-body p,
#videos-detail .detail-body p {
  margin-top: 0.1rem;
  margin-bottom: 0;
  flex-shrink: 0;
}

/* Make carousel dots smaller */
#blogs-detail .carousel-dot,
#videos-detail .carousel-dot {
  width: 6px;
  height: 6px;
}