:root {
  --bg: #070b14;
  --bg2: #0f172a;
  --card: rgba(14, 20, 37, 0.84);
  --card-solid: #141c32;
  --text: #ecf2ff;
  --muted: #9fb1d9;
  --primary: #6a8cff;
  --primary-2: #8a6dff;
  --success: #33d69f;
  --danger: #ff6b7a;
  --border: rgba(255,255,255,.14);
  --shadow: 0 10px 34px rgba(0,0,0,.15);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 650px at 100% -20%, rgba(106, 140, 255, .28), transparent 60%),
    radial-gradient(900px 550px at -10% 110%, rgba(138, 109, 255, .22), transparent 60%),
    url('images/fond.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.bg-default { background-image:
    radial-gradient(1200px 650px at 100% -20%, rgba(106, 140, 255, .28), transparent 60%),
    radial-gradient(900px 550px at -10% 110%, rgba(138, 109, 255, .22), transparent 60%),
    url('images/fond.png');
}

.container {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.card,
.topbar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(9px);
}

.card {
  padding: 18px;
  margin-top: 16px;
}

.hero {
  margin-top: 10vh;
  text-align: center;
  padding: 30px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.08;
}

.lead {
  max-width: 720px;
  margin: 12px auto 0;
  color: var(--muted);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
}

.glass {
  background: linear-gradient(160deg, rgba(20,29,54,.85), rgba(12,18,34,.78));
}

.user { display: flex; align-items: center; gap: 12px; }

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.name { font-weight: 800; letter-spacing: .2px; }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.links a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 10px;
  font-weight: 700;
}
.links a:hover { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  background: rgba(255,255,255,.08);
  transition: transform .15s ease, filter .15s ease, opacity .15s ease;
}

.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-primary {
  border-color: rgba(151,168,255,.38);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.actions.center { justify-content: center; }

.msg {
  margin-top: 12px;
  min-height: 20px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  border: 1px dashed rgba(255,255,255,.16);
}

.msg.success { color: #c6ffe9; border-color: rgba(51,214,159,.45); background: rgba(19,120,83,.18); }
.msg.error { color: #ffd2d7; border-color: rgba(255,107,122,.45); background: rgba(134,32,43,.2); }
.msg.info { color: #d9e4ff; border-color: rgba(106,140,255,.45); background: rgba(48,74,170,.18); }

.hint { color: var(--muted); font-size: 13px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px,1fr));
  gap: 14px;
  margin-top: 16px;
}

.grid.two-col {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.hover-lift { transition: transform .18s ease, border-color .18s ease; }
.hover-lift:hover { transform: translateY(-2px); border-color: rgba(151,168,255,.15); }

.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
}

label { font-weight: 700; display: block; margin-bottom: 6px; }

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.02);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid rgba(138,109,255,.46);
  outline-offset: 1px;
}

code {
  color: #d9e4ff;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  padding: 1px 6px;
}

canvas {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.wheel-card {
  text-align: center;
}

.wheel-layout {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.wheel-main {
  min-width: 0;
}

.reward-panel {
  text-align: left;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  padding: 12px;
}

.reward-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.reward-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(0,0,0,.12);
}

.reward-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.reward-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1);
  flex: 0 0 auto;
}

.reward-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reward-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.wheel-stage {
  position: relative;
  width: min(620px, 95vw);
  margin: 14px auto 0;
  filter: drop-shadow(0 14px 22px rgba(0,0,0,.28));
}

.wheel-stage canvas {
  width: 100%;
  height: auto;
  border-radius: 50%;
}

.wheel-pointer {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 34px solid transparent;
  border-right: 34px solid transparent;
  border-top: 58px solid #f7f7f7;
  z-index: 5;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.26));
}

.wheel-pointer::after {
  content: '';
  position: absolute;
  left: -36px;
  top: -62px;
  width: 0;
  height: 0;
  border-left: 36px solid transparent;
  border-right: 36px solid transparent;
  border-top: 62px solid rgba(170,170,170,.45);
  z-index: -1;
  transform: translateY(-2px);
}

.wheel-center-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 29%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #f2f2f2;
  border: 8px solid #ececec;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.9), 0 6px 14px rgba(0,0,0,.15);
  display: grid;
  place-items: center;
  z-index: 4;
  pointer-events: none;
}

.wheel-center-btn span {
  font-weight: 900;
  letter-spacing: 1px;
  color: #2ea8e6;
  font-size: clamp(22px, 3.5vw, 48px);
}

.list-muted {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.lb-item,
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px dashed rgba(255,255,255,.1);
}
.lb-item:first-child,
.history-item:first-child { border-top: 0; }

.lb-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-rank {
  width: 24px;
  text-align: center;
  font-weight: 800;
  opacity: .9;
}

.lb-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255,255,255,.12);
}

.lb-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.table { width: 100%; margin-top: 10px; }
.table .row {
  display: grid;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,.10);
  align-items: center;
}
.table .row.head { border-top: none; color: var(--muted); font-weight: 900; }
.table input { padding: 8px 10px; border-radius: 10px; }


@media (max-width: 980px) {
  .wheel-layout {
    grid-template-columns: 1fr;
  }

  .reward-panel {
    max-width: min(620px, 100%);
    margin: 0 auto;
  }
}

@media (max-width: 740px) {
  .wheel-layout {
    gap: 12px;
  }

  .reward-panel {
    padding: 10px;
  }

  .reward-item {
    padding: 8px;
  }

  .reward-name {
    max-width: 180px;
  }

  .wheel-pointer {
    top: 5px;
    border-left-width: 22px;
    border-right-width: 22px;
    border-top-width: 36px;
  }
  .wheel-pointer::after {
    left: -24px;
    top: -40px;
    border-left-width: 24px;
    border-right-width: 24px;
    border-top-width: 40px;
  }
}

@media (max-width: 740px) {
  .container { padding: 14px; }
  .card { padding: 14px; border-radius: 14px; }
  .topbar { border-radius: 14px; }
  .links a { margin-left: 8px; }
  .hero { margin-top: 6vh; }
  .msg { font-size: 14px; }
}

/* ====== V3 Classic wheel look (proche screenshot) ====== */
body.wheel-theme-classic {
  background-color: #dddddd !important;
  color: #1b1b1b;
}

body.wheel-theme-classic .topbar,
body.wheel-theme-classic .card {
  background: rgba(255, 255, 255, .65);
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
  backdrop-filter: blur(6px);
}

body.wheel-theme-classic .sub,
body.wheel-theme-classic .hint,
body.wheel-theme-classic .list-muted,
body.wheel-theme-classic .links a { color: #4b5563; }

body.wheel-theme-classic .msg {
  background: rgba(255,255,255,.85);
  border: 1px dashed rgba(0,0,0,.18);
}

body.wheel-theme-classic .pill {
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(0,0,0,.12);
  color: #0f172a;
}

body.wheel-theme-classic .wheel-stage {
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.22));
}

body.wheel-theme-classic .reward-panel {
  background: rgba(255,255,255,.86);
  border-color: rgba(0,0,0,.12);
}

body.wheel-theme-classic .reward-item {
  background: rgba(255,255,255,.78);
  border-color: rgba(0,0,0,.1);
}

body.wheel-theme-classic .reward-meta {
  color: #4b5563;
}

body.wheel-theme-classic .wheel-pointer {
  top: 8px;
  border-left: 36px solid transparent;
  border-right: 36px solid transparent;
  border-top: 60px solid #f2f2f2;
  filter: drop-shadow(0 4px 2px rgba(0,0,0,.22));
}

body.wheel-theme-classic .wheel-pointer::after {
  left: -38px;
  top: -64px;
  border-left: 38px solid transparent;
  border-right: 38px solid transparent;
  border-top: 64px solid rgba(160,160,160,.56);
}

body.wheel-theme-classic .wheel-center-btn {
  background: #efefef;
  border: 9px solid #ececec;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.92), 0 8px 16px rgba(0,0,0,.14);
}

body.wheel-theme-classic .wheel-center-btn span {
  color: #2ea8e6;
  letter-spacing: 0.7px;
}

body.wheel-theme-classic .btn {
  color: #ffffff;
  border-color: rgba(46, 168, 230, .35);
  background: linear-gradient(135deg, #43b5ee, #278fca);
}

.style-badge {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.14);
  background: rgba(255,255,255,.72);
  color: #1f2937;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 740px) {
  body.wheel-theme-classic .wheel-pointer {
    top: 6px;
    border-left-width: 24px;
    border-right-width: 24px;
    border-top-width: 40px;
  }
  body.wheel-theme-classic .wheel-pointer::after {
    left: -26px;
    top: -44px;
    border-left-width: 26px;
    border-right-width: 26px;
    border-top-width: 44px;
  }
}
