/* === BLOQUAGE LONG PRESS — TETRIBUS === */

/* ==========================================================
   Copyright (c) 2026 Jordan
   All Rights Reserved.
   See LICENSE for terms.
   ========================================================== */

#view-tetribus,
#tetribus,
#game-area,
#canvas-wrapper,
#game-canvas {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

#view-tetribus {
  position: fixed;
  inset: 0;

  width: 100vw;
  height: 100vh;

  margin: 0;
  padding: 0;
  overflow: hidden;

  background: #121212;
  z-index: 9999;
}

#tetribus {
  font-family: "Trebuchet MS", "Gill Sans", "Candara", sans-serif;
  background: radial-gradient(circle at 20% 10%, #1f1f1f, #121212 60%);
  color: #f1f1f1;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* CONTENEUR PRINCIPAL */
#tetribus #game-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
#tetribus #header {
  padding: 10px;
  background: linear-gradient(180deg, #1b1b1b, #141414);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  pointer-events: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#tetribus #header h1 {
  font-size: 20px;
  color: #f3701e;
}

#tetribus #score,
#tetribus #level {
  font-size: 12px;
  color: #c7c7c7;
  letter-spacing: 0.3px;
}

#tetribus #score-value,
#tetribus #level-value {
  font-weight: bold;
  color: #f3701e;
}

#tetribus #tetribus-back {
  width: 40px;
  height: 40px;

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

  background: #1a1a1a;
  border: none;
  border-radius: 12px;

  padding: 0;
  margin: 0;

  font-size: 0;
  line-height: 1;
  font-family: system-ui, "Trebuchet MS", "Gill Sans", "Candara", sans-serif;
  color: #f1f1f1;

  box-sizing: border-box;

  appearance: none;
  -webkit-appearance: none;

  cursor: pointer;
  pointer-events: auto;

  /* RESET ABSOLU */
  background-image: none !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 6px 14px rgba(0, 0, 0, 0.35) !important;
}

#tetribus #tetribus-back::before {
  content: "";
  width: 18px;
  height: 18px;
  display: block;
  background-color: #f3701e;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polyline points="14 6 8 12 14 18" fill="none" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></svg>');
}

/* ZONE DE JEU */
#tetribus #game-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

#tetribus #canvas-wrapper {
  flex: 1;
  position: relative;
  background: #0f0f0f;
}

#tetribus #game-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: block;

  background: #1a1a1a; /* zone jouable */
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06); /* effet couloir */
}

/* CONTRÔLES */
#tetribus #controls-area {
  height: 132px;
  background: linear-gradient(180deg, #151515, #0f0f0f);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#tetribus .control-btn {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(circle at 30% 30%, #2a2a2a, #141414 60%), #141414;
  color: #f1f1f1;
  font-size: 0;
  font-weight: 600;

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

  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 10px 24px rgba(0, 0, 0, 0.45);

  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;

  pointer-events: auto;
  touch-action: manipulation;
}

#tetribus .control-btn:active {
  transform: translateY(2px) scale(0.97);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 6px 14px rgba(0, 0, 0, 0.5);
}

.control-btn {
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease,
    background 0.15s ease;
}

/* GAME OVER */
#tetribus #game-over {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(18, 18, 18, 0.96);
  padding: 30px;
  border-radius: 16px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  min-width: 250px;
  z-index: 1000;
  color: #f1f1f1;
}

#tetribus #game-over h2 {
  color: #ff6b6b;
  margin-bottom: 15px;
  font-size: 28px;
}

#tetribus #game-over p {
  font-size: 18px;
  margin-bottom: 20px;
}

#tetribus #restart-btn {
  background: #f3701e;
  color: #ffffff;
  border: none;
  padding: 15px 35px;
  font-size: 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: bold;
}

#tetribus #restart-btn:active {
  background: #e9772f;
}

/* UTILITAIRES */
#tetribus .hidden {
  display: none !important;
}

/* GAUCHE */
.btn-left::before,
.btn-right::before,
.btn-rotate::before {
  content: "";
  width: 30px;
  height: 30px;
  display: block;
}

/* PLAYSTATION-STYLE SYMBOLS */
.btn-left::before {
  border: 3px solid #55a7ff; /* carré bleu */
  border-radius: 6px;
  box-shadow: 0 0 0 2px rgba(85, 167, 255, 0.15);
}

.btn-right::before {
  border: 3px solid #ff6b6b; /* cercle rouge */
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.15);
}

.btn-rotate::before {
  width: 54px;
  height: 54px;
  background-color: #66d08a; /* croix verte */
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><line x1="6" y1="6" x2="18" y2="18" stroke="black" stroke-width="4" stroke-linecap="round"/><line x1="18" y1="6" x2="6" y2="18" stroke="black" stroke-width="4" stroke-linecap="round"/></svg>');
  box-shadow: 0 0 0 2px rgba(102, 208, 138, 0.15);
}
