:root{
  --bg: #0d0a12;
  --purple: #7a1a8c;
  --purple-deep: #4a0e5c;
  --led-off: #3a2a1a;
  --led-on: #39ff6a;
  --ink: #f2e9ff;
  --muted: #c6c3c9;
}
*{ box-sizing: border-box; }
html,body{
  margin:0; padding:0; height:100%;
  background: radial-gradient(circle at 50% 20%, #241633 0%, var(--bg) 70%);
  color: var(--ink);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow-x:hidden;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.page{
  min-height:100%;
  display:grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "head"
    "board"
    "link";
  justify-items:center;
  align-items:center;
  justify-content:center;
  padding: 28px 16px 60px;
  gap: 10px;
  row-gap: 18px;
}
header{ grid-area: head; }
.board-column{ grid-area: board; display:flex; flex-direction:column; align-items:center; gap: 10px; width: 100%; }
.button-group{ grid-area: link; display:flex; flex-direction:column; align-items:stretch; gap: 14px; width: 100%; max-width: 340px; }
.btn-link{ width: 100%; max-width: none; box-sizing: border-box; }
.scratch-img{
  width: 100%;
  max-width: 340px;
  height: auto;
  display: none;
  margin: 0;
  border-radius: 16px;
  pointer-events: auto;
  user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.1s ease;
}
.scratch-img:active,
.scratch-img.pressed{
  transform: scale(0.93);
  filter: brightness(0.82);
}
.board-caption-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 90%;
  gap: 10px;
}
.scratch-img-inline{
  display: block;
  width: 144px;
  height: auto;
  flex-shrink: 0;
  margin-left: auto;
  border-radius: 8px;
  pointer-events: auto;
  user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.1s ease;
}
.scratch-img-inline:active,
.scratch-img-inline.pressed{
  transform: scale(0.9);
  filter: brightness(0.82);
}

/* PC / écran large en paysage : image décalée à gauche, texte à droite */
@media (orientation: landscape){
  .page{
    grid-template-columns: minmax(240px, 920px) 1fr;
    grid-template-areas:
      "board ."
      "board head"
      "board scratch"
      "board link"
      "board .";
    grid-template-rows: 1fr auto auto auto 1fr;
    align-items: center;
    justify-items: start;
    column-gap: clamp(24px, 5vw, 64px);
    row-gap: 14px;
    padding: 24px 6vw;
    max-width: 1500px;
    margin: 0 auto;
    width: 100%;
  }
  .board-column{
    justify-self: center;
    align-self: center;
  }
  .board-wrap{
    width: 100%;
    max-width: min(68vw, 82vh, 920px);
  }
  header{
    align-self: end;
    text-align: left;
  }
  .button-group{
    align-self: start;
  }
  .scratch-img{
    display: block;
    grid-area: scratch;
    align-self: center;
    width: 80%;
  }
  .scratch-img-inline{
    display: none;
  }
  .board-caption-row{
    justify-content: center;
  }
}
header{
  text-align:center;
  margin-bottom: 10px;
}
header h1{
  font-size: clamp(1.4rem, 3.2vw, 2.2rem);
  letter-spacing: 0.04em;
  margin: 0 0 3px;
  background: linear-gradient(90deg, #e6b8ff, #ffffff, #b8ffe0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
header p{
  margin:0;
  color: var(--muted);
  font-size: 0.95rem;
}
.board-caption{
  margin: 0;
  color: var(--muted);
  font-size: 1.3rem;
  text-align: center;
  flex: 1;
  animation: captionBlink 1.2s ease-in-out infinite;
}
@keyframes captionBlink{
  0%, 100%{ opacity: 1; }
  50%{ opacity: 0.15; }
}
.status{
  margin-top: 0;
  min-height: 1.4em;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  color: var(--led-on);
  text-shadow: 0 0 8px rgba(57,255,106,0.6);
  transition: opacity 0.15s ease;
  opacity: 0;
}
.status.visible{ opacity: 1; }

.board-wrap{
  position: relative;
  width: min(92vw, 900px);
  aspect-ratio: 1285 / 1147;
  filter: drop-shadow(0 20px 45px rgba(0,0,0,0.55));
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.board-wrap img{
  position:absolute; inset:0;
  width:100%; height:100%;
  display:block;
  pointer-events:none;
  user-select:none;
  -webkit-user-select:none;
  -webkit-user-drag:none;
  -webkit-touch-callout: none;
}
svg.overlay{
  position:absolute; inset:0;
  width:100%; height:100%;
  -webkit-user-select:none;
  user-select:none;
  -webkit-touch-callout: none;
}
.pad{
  fill: rgba(255,255,255,0.0);
  stroke: rgba(255,255,255,0);
  stroke-width: 3;
  cursor: pointer;
  transition: fill 0.12s ease, stroke 0.12s ease;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
.pad.touched{
  fill: rgba(255,255,255,0.92);
  stroke: rgba(255,255,255,1);
}
.led-halo{
  fill: var(--led-on);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  mix-blend-mode: screen;
}
.led-halo-outer{ opacity: 0; }
.led.on .led-halo-outer{ opacity: 0.55; }
.led.on .led-halo-core{ opacity: 0.85; }
.led-rect{
  fill: var(--led-off);
  stroke: rgba(0,0,0,0.35);
  stroke-width: 1;
  transition: fill 0.12s ease, filter 0.12s ease;
  pointer-events: none;
}
.led.on .led-rect{
  fill: var(--led-on);
  filter: drop-shadow(0 0 6px var(--led-on)) drop-shadow(0 0 16px var(--led-on)) drop-shadow(0 0 30px var(--led-on));
}

.btn-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 68px;
  padding: 0 24px;
  border-radius: 20px;
  text-decoration: none;
  color: #fff2ff;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-deep) 100%);
  border: 1.5px solid #c98bd9;
  box-shadow: 0 6px 18px rgba(122,26,140,0.45), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn-link:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(122,26,140,0.6), inset 0 1px 0 rgba(255,255,255,0.2);
  background: linear-gradient(135deg, #922aa8 0%, var(--purple-deep) 100%);
}
.btn-link:active{ transform: translateY(0); }
.btn-title{
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.btn-title.regular{ font-weight: 400; }
.btn-text{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.3;
}
.btn-sub{
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--muted);
  opacity: 0.85;
}
.btn-icon{
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: block;
  pointer-events: none;
  user-select: none;
}
.cart-link-logo{
  height: 32px;
  width: auto;
  display: block;
  pointer-events: none;
  user-select: none;
  background: #ffffff;
  border-radius: 8px;
  padding: 4px 8px;
}
