/* =========================================================
   RESET
========================================================= */
*,
*::before,
*::after{
  box-sizing:border-box;
}

/* =========================================================
   BASE
========================================================= */
html, body{
  width:100%;
  height:100%;
  margin:0;
  padding:0;
  background:#1e1e1e;
  font-family:'Press Start 2P', cursive;
  overflow:hidden; /* 🔒 rien ne scroll hors du PC */
}

/* =========================================================
   ✅ ZONE PC (LE CADRE QUI CLIP TOUT)
   -> RIEN ne peut sortir visuellement de cette zone.
========================================================= */
.pc{
  position:relative;
  width:100vw;
  height:100vh;
  overflow:hidden; /* 🔥 le clipping */
}

/* =========================================================
   WINDOW (PC) — DESIGN ORIGINAL, MAIS DANS .pc
========================================================= */
.window{
  position:absolute; /* ✅ reste dans .pc */
  width:55vw;
  height:80vh;

  /* ✅ min raisonnables pour éviter les breaks */
  min-width:320px;
  min-height:340px;

  /* ✅ ne dépasse JAMAIS la zone PC */
  max-width:calc(100% - 16px);
  max-height:calc(100% - 16px);

  background:#000;

  border:2px solid #444;
  box-shadow:
    inset 2px 2px 0 #aaa,
    inset -2px -2px 0 #111,
    0 12px 30px rgba(0,0,0,.65);

  border-radius:10px;
  display:none;
  overflow:hidden;
}

/* =========================================================
   TOP BAR (BLEUE)
========================================================= */
.bar{
  height:32px;
  min-height:32px;
  max-height:32px;

  background:linear-gradient(#0a64ad,#084d8c);
  color:#fff;

  display:flex;
  align-items:center;
  justify-content:space-between;

  padding:0 10px;
  font-size:14px;
  cursor:move;
  user-select:none;
  flex-shrink:0;
}

.close{
  position:absolute;
  top:0;
  right:0;
  width:30px;
  height:30px;
  background:red;
  color:white;
  border:none;
  border-radius:10%;
  font-size:18px;
  font-weight:bold;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:3;
}

/* =========================================================
   SCREEN (ZONE SCROLLABLE)
========================================================= */
.screen{
  position:relative;
  height:calc(100% - 32px);
  min-height:0;     /* 🔥 FIX overflow */
  overflow:auto;    /* ✅ scroll interne */
}

/* =========================================================
   LOADING
========================================================= */
.loading{
  position:absolute;
  inset:0;
  background:#000;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}

.loading-logo{
  width:60%;
  max-width:300px;
  margin-bottom:20px;
}

.loading-title{
  color:#fff;
  font-size:14px;
  margin-bottom:16px;
}

.loading-bar{
  width:60%;
  height:12px;
  border:2px solid #fff;
}

.loading-fill{
  height:100%;
  width:0;
  background:#fff;
}

/* =========================================================
   DESKTOP (DANS .pc)
========================================================= */
.desktop{
  position:absolute;
  inset:0;
  display:none;
}

.desktop-bg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  pointer-events:none;
}

/* =========================================================
   ICONS (DANS .pc)
========================================================= */
.icon{
  position:absolute;
  width:130px;
  display:flex;
  flex-direction:column;
  align-items:center;
  font-size:11px;
  color:#fff;
  cursor:pointer;
  user-select:none;
  touch-action:none;
}

.icon svg{
  width:100px;
  height:80px;
  margin-bottom:6px;
}

.icon-label{
  width:150px;
  background:rgba(0,0,0,.65);
  padding:6px;
  text-align:center;
  line-height:1.3;
}

/* =========================================================
   FOLDER WINDOWS (DANS .pc)
========================================================= */
.folder-window{
  position:absolute; /* ✅ reste dans .pc */
  width:420px;

  max-width:calc(100% - 16px);
  max-height:calc(100% - 16px);

  background:#111;
  border:2px solid #555;
  box-shadow:
    inset 1px 1px 0 #aaa,
    inset -1px -1px 0 #000,
    0 8px 18px rgba(0,0,0,.65);

  display:none;
  z-index:20;
  overflow:hidden;
}

/* BARRE JAUNE */
.folder-bar{
  height:30px;
  min-height:30px;
  max-height:30px;

  background:linear-gradient(#f2d96c,#d1b347);
  font-size:11px;
  font-weight:bold;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:0 10px;
  cursor:move;
}

.folder-close{
  background:#cc0000;
  border:none;
  color:#fff;
  width:18px;
  height:18px;
  cursor:pointer;
  border-radius:3px;
  font-size:11px;
}

/* =========================================================
   FILES
========================================================= */
.file{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 16px;
  font-size:12px;
  color:#fff;
  cursor:pointer;
  user-select:none;
}

.file:hover{
  background:#1e90ff;
}

/* =========================================================
   TEXT VIEWER (DANS .pc)
========================================================= */
.text-viewer{
  position:absolute; /* ✅ reste dans .pc */
  display:none;

  width:460px;
  max-width:calc(100% - 16px);
  max-height:calc(100% - 16px);

  overflow:hidden;
  z-index:25;
}

.text-viewer.active{
  display:flex;
  flex-direction:column;
}

.text-viewer .text-content{
  padding:20px;
  display:flex;
  flex-direction:column;
  gap:18px;
  font-size:15px;
  line-height:1.6;
  color:#fff;
  overflow-y:auto;
  min-height:0; 
}

/* image projet */
.project-image{
  width:100%;
  max-height:220px;
  object-fit:cover;
  border-radius:8px;
  display:none;
}

/* texte projet */
.project-text{
  max-height:180px;
  overflow-y:auto;
  padding-right:8px;
  color:#fff;
}

/* bouton projet */
.project-link{
  display:block;
  margin:12px auto 0;
  width:240px;
  padding:14px 0;
  text-align:center;
  white-space:nowrap;
  background:#1e90ff;
  color:#fff;
  text-decoration:none;
  font-size:13px;
  line-height:1;
  border-radius:8px;
  box-shadow:0 4px 0 #0b4ea2;
  cursor:pointer;
  flex-shrink:0;
}

.project-link:hover{ background:#1873cc; }
.project-link:active{
  transform:translateY(2px);
  box-shadow:0 2px 0 #0b4ea2;
}

/* =========================================================
   📱 MOBILE
========================================================= */
@media (max-width:768px){

  .window{
    width:90vw;
    height:85vh;
    max-width:calc(100% - 12px);
    max-height:calc(100% - 12px);
    min-width:unset;
    min-height:unset;
  }

  .text-viewer{
    width:90vw;
    max-width:calc(100% - 12px);
    max-height:calc(100% - 12px);
  }

  .text-viewer .text-content{
    padding:12px;
    gap:10px;
    font-size:11px;
    line-height:1.45;
  }

  .project-image{ max-height:120px; }
  .project-text{ max-height:110px; }

  .project-link{
    width:100%;
    padding:14px 0;
    font-size:11px;
  }

  .folder-window{
    width:90vw;
    max-width:calc(100% - 12px);
    max-height:calc(100% - 12px);
  }

  .folder-bar{
    height:24px;
    font-size:9.5px;
    padding:0 8px;
  }

  .folder-close{
    width:30px;
    height:25px;
    font-size:9px;
  }

  .file{
    padding:8px 10px;
    font-size:10px;
  }
}
