/* ==========================================================================
   Burgi e.V. – Teile-Puzzle (Entdecke Bentheim)
   Merged UI skin based on your Memory-Game look + puzzle-specific rules.
   Keep this file as: /css/tiles-style.css
   ========================================================================== */


/* ---------------------------------------------------------
   PAGE + GAME CONTAINER (borrowed style language from memory-style.css)
--------------------------------------------------------- */
.container{
    display: flex;
    align-items: center;
    justify-content: center;
    background:#f9f9e0;         /* matches site background */
    padding: 10px 0 30px 0;
}

.game-container{
    position: relative;
    width: 660px;
    max-width: 92vw;
    min-height: 520px;
    border-radius: 12px;
    box-shadow: rgba(99, 99, 99, 0.20) 0px 2px 8px 0px;
    background-image: linear-gradient(140deg, #f9f9e0, #f2f0e5);
    padding: 14px 16px 16px 16px;
}

/* Keep Comic Sans consistent with the site */
.game-container, .game-container *{
    font-family: "Comic Sans MS", "Comic Sans", cursive;
    color:#444;
}

.header{
    text-align: center;
    color:#F5AEBE;
    text-shadow: 1px 0px 1px rgba(0,0,0,0.55);
    margin-bottom: 10px;
}

#gameTitle{
    font-weight: 200;
    font-size: 26px;
    margin: 2px 0 6px 0;
}

.subline{
    color:#CF1A7E;
    text-shadow: none;
    font-size: 0.95rem;
    margin-bottom: 6px;
}

/* ---------------------------------------------------------
   CONTROLS (match the memory-game "pill" + button feeling)
--------------------------------------------------------- */
.controls{
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 10px 0 14px 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(0,0,0,0.08);
}

.leftCtl{
    display:flex;
    align-items:center;
    gap: 10px;
}

.rightCtl{
    display:flex;
    align-items:center;
    gap: 10px;
    flex-wrap: wrap;
}

.controls select{
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.10);
    background: rgba(255,255,255,0.85);
    font-size: 1rem;
}

.btn{
    padding: 10px 18px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    background-color:#F5AEBE;
    color:#fff;
    box-shadow: 1px 0px 1px rgba(0,0,0,0.55);
    font-size: 1rem;
}

.btn:hover{
    background-color: transparent;
    color:#CF1A7E;
    border: 1px solid #CF1A7E;
}

.btn.primary{
    background-color:#F5AEBE;
}

/* Hide next image if you don’t want it right now */
 /*#nextImage{ display:none; }*/

/* ---------------------------------------------------------
   BOARD (critical for visibility)
--------------------------------------------------------- */
#board.board{
    position: relative;
    width: 600px;
    max-width: 88vw;
    aspect-ratio: 1 / 1;
    margin: 10px auto 0 auto;
    overflow: visible;
}

/* Full image overlay, shown when solved */
.fullImage{
    position:absolute;
    inset:0;
    pointer-events:none;
    background-repeat:no-repeat;
    background-size: cover;
    opacity:0;
    transition: opacity 0.5s ease;
}
#board.solved .fullImage{ opacity: 1; }

/* ---------------------------------------------------------
   TILES
--------------------------------------------------------- */
.tile{
    position:absolute;
    box-sizing: border-box;
    cursor: grab;
    z-index: 1;
    transition: filter 120ms ease, transform 120ms ease;
}

.tile:active{ cursor: grabbing; }

.tile__img{
    width:100%;
    height:100%;
    background-repeat:no-repeat;
    background-size: var(--imgW) var(--imgH);
}

/* On top while dragging + “picked up” look */
.tile.is-dragging{
    z-index: 9999;
    cursor: grabbing;
    filter: drop-shadow(0 12px 18px rgba(0,0,0,0.28));
    transform: scale(1.03);
}

/* Optional: if you add JS toggle for rotation */
.tile.is-rotating{
    filter: drop-shadow(0 10px 16px rgba(0,0,0,0.25));
}

/* ---------------------------------------------------------
   STATS + HINT (pill style like memory game)
--------------------------------------------------------- */
.progress-container{
    text-align:center;
    display:flex;
    justify-content: space-around;
    gap: 10px;
    width:100%;
    margin: 16px 0 8px 0;
    flex-wrap: wrap;
}

.pill{
    padding: 10px 16px;
    border-radius: 25px;
    color:#CF1A7E;
    border: 1px solid #CF1A7E;
    background: rgba(255,255,255,0.35);
}

.toast{
    text-align:center;
    margin: 10px 0;
    color:#CF1A7E;
    min-height: 22px;
}

.hint{
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(0,0,0,0.08);
    font-size: 0.95rem;
}

/* ---------------------------------------------------------
   MOBILE TWEAKS
--------------------------------------------------------- */
@media screen and (max-width: 767px){
    .game-container{
        width: 94vw;
        padding: 12px;
    }
    #board.board{
        max-width: 92vw;
    }
    .controls{
        justify-content: center;
    }
}

/*---------------------------------------------------------------------*/

.startScreen{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(249,249,224,0.82);
  border-radius: 12px;
  z-index: 20000;
}

.startCard{
  width: min(520px, 90%);
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  padding: 16px 18px;
  text-align:center;
  box-shadow: rgba(99, 99, 99, 0.20) 0px 2px 8px 0px;
}

.startTitle{
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 10px;
}

.startText{
  font-size: 1.05rem;
  line-height: 1.4;
  margin-bottom: 14px;
}

.hintRow{
  display:flex;
  align-items:flex-start;
  gap:10px;
}

.burgiHintIcon{
  width:44px;
  height:auto;
  flex:0 0 auto;
  margin-top:2px;
}

.hintText{
  line-height:1.3;
}


/* --- Controls layout: compact, no wasted width --- */
.controls{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
  padding:5px 12px;
  border-radius:12px;
  width: fit-content;
  margin: 0 auto 12px auto;
  background:rgba(255,255,255,0.55);
  border:1px solid rgba(0,0,0,0.08);
}
.controls .statusPill{
  padding:6px 10px;
  border-radius:999px;
  background:rgba(255,255,255,0.65);
  border:1px solid rgba(0,0,0,0.10);
  white-space:nowrap;
}
.controls .sep{ margin:0 8px; opacity:0.55; }

.restartHidden{ display:none !important; }

/* Help button: top-right of game card */
.game-container{ position:relative; }
.helpBtn{
  position:absolute;
  top:14px;
  right:14px;
  width:34px;
  height:34px;
  border-radius:50%;
  border:1px solid rgba(0,0,0,0.10);
  background:rgba(255,255,255,0.75);
  color:#c11a7e;
  font-weight:700;
  cursor:pointer;
  box-shadow:0 4px 12px rgba(0,0,0,0.12);
}
.helpBtn:hover{ background:rgba(255,255,255,0.92); }

/* Board wrapper so overlays never affect layout */
.boardWrap{ position:relative; }

/* Solved label shown under the board when completed */
.solvedLabel{
  text-align:center;
  margin:10px auto 0 auto;
  font-size:1.05rem;
  font-weight:600;
  color:#333;
  min-height:1.4em;
}

/* Pop animation on solve */
@keyframes winPop {
  0% { transform: scale(1); }
  55% { transform: scale(1.035); }
  100% { transform: scale(1); }
}
.boardWrap.winPop{ animation: winPop 220ms ease-out; transform-origin:50% 50%; }

/* Generic overlay */
.overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding-top:40px;
  background:rgba(255,255,255,0.75);
  opacity:0;
  pointer-events:none;
  transition:opacity .25s ease;
  z-index:2000;
}
.overlay.open{ opacity:1; pointer-events:auto; }

.overlayCard{
  width:min(720px, 92%);
  background:rgba(255,255,255,0.92);
  border-radius:18px;
  padding:16px 16px 14px 16px;
  box-shadow:0 10px 28px rgba(0,0,0,0.20);
  position:relative;
  text-align:center;
}
.overlayTitle{ font-size:1.25rem; font-weight:800; margin-bottom:10px; }
.overlayText{ font-size:1.05rem; color:#333; line-height:1.35; }

.overlayClose{
  position:absolute;
  right:10px;
  top:8px;
  width:36px;
  height:36px;
  border-radius:50%;
  border:1px solid rgba(0,0,0,0.10);
  background:rgba(255,255,255,0.85);
  cursor:pointer;
  font-size:20px;
  line-height:34px;
  color:#c11a7e;
}

/* Gallery */
.galleryStage{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin:8px 0 10px 0;
}
.galleryNav{
  width:44px;
  height:44px;
  border-radius:50%;
  border:1px solid rgba(0,0,0,0.12);
  background:#fff;
  cursor:pointer;
  font-size:28px;
  line-height:42px;
}
.galleryFrame{
  width:min(560px, 86vw);
  background:#fff;
  border-radius:14px;
  padding:10px;
  box-shadow:0 3px 12px rgba(0,0,0,0.12);
}
#galleryImg{ width:100%; height:auto; border-radius:10px; display:block; }
.galleryLabel{ margin:8px 0 10px 0; font-size:1.1rem; font-weight:700; color:#333; }
.galleryControls{ display:flex; justify-content:center; gap:10px; }

/* Next (›) button */
.nextBtn {
  width:40px;            /* little breathing space */
  height:32px;
  padding:0;
  margin-left:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;   /* pill shape */
  background:#f8d7e6;
  border:1px solid #e6b4c5;
  cursor:pointer;
  transition:transform 0.15s ease, background 0.15s ease;
}

/* Arrow icon inside */
.arrowIcon {
  width:20px;  
  height:20px;
  display:block;
  pointer-events:none;
}

/* Hover / press feedback */
.nextBtn:hover {
  background:#f5c4dd;
}

.nextBtn:active {
  transform:scale(0.93);
}

/* --- Accessibility helper (screen-reader only) --- */
.srOnly{
  position:absolute !important;
  width:1px; height:1px;
  padding:0; margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* --- Next image arrow button (uses SVG background) --- */
#nextImage.nextBtn{
  width:40px;
  height:32px;
  padding:0;
  border-radius:999px;

  display:inline-flex;
  align-items:center;
  justify-content:center;

  background-color:#f7c7dd;
  border:1px solid rgba(0,0,0,0.12);
  box-shadow:0 2px 8px rgba(0,0,0,0.12);

  background-image:url("../img/tiles/arrow.svg");
  background-repeat:no-repeat;
  background-position:center;
  background-size:20px 20px;

  cursor:pointer;
}
#nextImage.nextBtn:hover{ filter:brightness(0.98); }
#nextImage.nextBtn:active{ transform:scale(0.96); }
