* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent: #a78bfa;
  --accent2: #f472b6;
  --accent-dark: #7c3aed;
  --ink: #f1effa;
  --line: rgba(255, 255, 255, .1);
  --card: rgba(0, 0, 0, .28);
}

html, body { height: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: radial-gradient(1100px 700px at 50% -10%, #33165a, #130a22 70%);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.game { width: min(94vw, 460px); display: flex; flex-direction: column; gap: .85rem; }

header { text-align: center; }
h1 { font-size: 1.9rem; letter-spacing: 1px; }
.tagline { color: #d8c7ff; font-size: .88rem; margin-top: .25rem; }

.hud { display: flex; gap: .5rem; align-items: stretch; flex-wrap: wrap; }
.stat {
  flex: 1 1 90px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .45rem .7rem;
}
.stat .label { font-size: .64rem; text-transform: uppercase; letter-spacing: 1.2px; opacity: .6; }
.stat strong { font-size: 1.15rem; line-height: 1.2; }
.stat strong.bump { animation: pop .25s ease; }
@keyframes pop { 50% { transform: scale(1.2); } }

.hud-buttons { display: flex; gap: .5rem; }
.icon-btn {
  width: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font-size: 1.05rem;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease, opacity .2s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, .12); }
.icon-btn:active { transform: scale(.94); }

/* Zone du gros bouton */
.stage { position: relative; display: flex; justify-content: center; padding: .3rem 0; }

.clicker {
  position: relative;
  width: min(68vw, 260px);
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, #b79bff, var(--accent-dark) 70%);
  box-shadow: 0 14px 34px rgba(124, 58, 237, .45), inset 0 -8px 22px rgba(0, 0, 0, .35);
  transition: transform .08s ease, box-shadow .15s ease;
  touch-action: manipulation;
}
.clicker:hover { box-shadow: 0 16px 40px rgba(124, 58, 237, .6), inset 0 -8px 22px rgba(0, 0, 0, .35); }
.clicker:active { transform: scale(.94); }
.clicker .emoji { font-size: clamp(3rem, 18vw, 5rem); line-height: 1; filter: drop-shadow(0 4px 8px rgba(0,0,0,.35)); }
.clicker .label { font-weight: 800; letter-spacing: 1px; font-size: .95rem; text-transform: uppercase; opacity: .9; }
.clicker.hit .emoji { animation: squish .18s ease; }
@keyframes squish { 50% { transform: scale(.86) rotate(-4deg); } }

/* +N flottants */
.floats { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.float {
  position: absolute;
  font-weight: 800;
  color: #f9e2ff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .5);
  font-size: 1rem;
  animation: rise 0.9s ease-out forwards;
  white-space: nowrap;
}
@keyframes rise {
  0%   { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -70px) scale(1.25); }
}

/* Boutique */
.shop { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: .8rem; }
.shop h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: 1.5px; opacity: .65; margin-bottom: .55rem; }
.items { display: flex; flex-direction: column; gap: .5rem; }

.item {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  text-align: left;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease, opacity .2s ease;
}
.item:hover:not(:disabled) { background: rgba(167, 139, 250, .16); border-color: var(--accent); }
.item:active:not(:disabled) { transform: scale(.99); }
.item:disabled { opacity: .45; cursor: not-allowed; }
.item .ico { font-size: 1.5rem; line-height: 1; }
.item .info { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.item .name { font-weight: 700; font-size: .95rem; }
.item .sub { font-size: .74rem; opacity: .65; }
.item .cost { font-weight: 800; font-size: .88rem; color: var(--accent); white-space: nowrap; }
.item .count {
  min-width: 1.6rem;
  text-align: center;
  font-weight: 800;
  font-size: .8rem;
  background: rgba(0, 0, 0, .35);
  border-radius: 8px;
  padding: .1rem .35rem;
}

.rules {
  background: rgba(0, 0, 0, .25);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .75rem 1rem;
  font-size: .86rem;
  line-height: 1.55;
  user-select: text;
  -webkit-user-select: text;
}
.rules summary { cursor: pointer; font-weight: 700; color: #d8c7ff; }
.rules ul { margin: .6rem 0 0 1.1rem; }
.rules li { margin: .18rem 0; }
