:root{
  --bg: #0f1115;
  --panel: #1a1f2b;
  --panel-2: #1f2430;
  --text: #e8e8e8;
  --muted: #a8b0c1;
  --line: #2b3242;
  --brand: #7aa2f7;
  --brand-2:#5c86e6;
  --danger:#f7768e;
  --success:#9ece6a;
  --warn:#e0af68;
}

*{ box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

a{ color: var(--brand); text-decoration: none; }
a:hover{ text-decoration: underline; }
.muted{ color: var(--muted); }

/* ---------- Header ---------- */
.site-header{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #171b24, #141925);
}
.site-header h1{
  margin:0;
  font-size: 20px;
  letter-spacing: .5px;
}
#authBar button{
  cursor:pointer;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
}
#authBar .btn button{
  background: var(--brand);
  border-color: transparent;
  color: #0b1220;
  font-weight: 600;
}

/* ---------- Layout / tiles ---------- */
main{
  max-width: 1100px;
  margin: 16px auto;
  padding: 0 12px 32px;
}

.grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 960px){
  .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px){
  .grid{ grid-template-columns: 1fr; }
}

.tile{
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  padding: 12px;
  display:flex;
  flex-direction: column;
  gap: 8px;
}
.tile .img{
  display:block;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #0b0e14;
  border: 1px solid var(--line);
}
.tile .img img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}
.tile .title{ font-weight: 700; }
.tile .subtitle{
  color: var(--muted);
  font-size: 14px;
}
.tile .actions{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tile .actions button{
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
}
.tile .actions .viewBtn{ background: #2a3350; }
.tile .actions .contactBtn{ background: #2b3a2f; }

/* ---------- Universal form controls ---------- */
input, textarea, select, button{
  font-size: 16px;
  line-height: 1.35;
}
input, textarea, select{
  width:100%;
  padding: 12px;
  margin: 8px 0;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0f1115;
  color: inherit;
}
textarea{ resize: vertical; }

button, .btn{
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}
button:hover, .btn:hover{ background: #242a38; }
button:disabled, .btn:disabled{
  opacity: .6;
  cursor: not-allowed;
  filter: grayscale(.2);
}
select{
  background: #161a23;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

/* Focus ring (keyboard-friendly) */
:where(a,button,input,select,textarea):focus-visible{
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-color: var(--brand-2);
}

/* ---------- Modal ---------- */
.modal.hidden { display:none; }
.modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.6);
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal > .modal-content{
  width: min(720px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
  -webkit-overflow-scrolling: touch;
}
.form-row{
  display:flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.actions{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.actions .primary{
  background: var(--brand);
  color:#0b1220;
  border-color: transparent;
  font-weight: 600;
}

/* Mobile modal: sheet-style */
@media (max-width: 640px){
  .modal{ padding: 0; }
  .modal > .modal-content{
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    padding: 16px 14px 20px;
  }
}

/* ---------- Casino page (panels + tabs) ---------- */
.page-header{
  display:flex;
  align-items:center;
  gap:10px;
  margin: 6px 0 12px;
}
.breadcrumb a{ color: var(--muted); }
.breadcrumb a:hover{ color: var(--text); }

.panel{
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.panel + .panel{ margin-top: 14px; }
.panel h2, .panel h3{ margin: 0 0 8px; }

.tabbar{
  display:flex;
  gap: 8px;
  margin-bottom: 12px;
}
.tabbtn{
  background: #1a2030;
  color: #cbd3e6;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  padding: 8px 12px;
}
.tabbtn.active{
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
}

/* Character picker + auth bar */
#charPicker{ display: none; }
#authMsg{ color: var(--muted); }
#authBtns button{
  background: var(--brand);
  border-color: transparent;
  color:#0b1220;
  font-weight:600;
}

/* ---------- Roulette ---------- */
.roulette-header{
  display:flex; align-items:center; gap:10px; margin-bottom:6px;
  color: #cbd3e6;
}
#rouletteStatus, #slotsStatus{
  color: var(--muted);
  min-height: 1.25rem;
  margin-top: 6px;
}

.result-pill{
  display:inline-block;
  margin-left:8px;
  padding:2px 10px;
  border-radius: 9999px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.15);
}
.result-pill.red{ background:#8f1d2c; color:#fff; }
.result-pill.black{ background:#0f131a; color:#fff; }
.result-pill.green{ background:#0b3b2b; color:#d2ffe8; }

/* ---------- Slot machine ---------- */
/* ---------- Slot machine ---------- */
.reels{
  display:flex;
  gap:14px;
  justify-content:center;      /* center the reels block */
  align-items:center;
  margin:18px 0 6px;
}

/* 3×3 window — slightly wider/taller cells */
.reel{
  --cell-h: 88px;              /* was 80px — makes cells a bit bigger */
  width: var(--cell-h);        /* square cells, fixes “narrow” look */
  height: calc(var(--cell-h) * 3);
  overflow: hidden;
  position: relative;
  background:#151b27;
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.03);
}

/* tall, scrollable stack built by JS */
.reel .strip{
  display:flex;
  flex-direction:column;
  will-change: transform;
}

/* each visible cell */
.reel .cell{
  height: var(--cell-h);
  display:grid;
  place-items:center;
  font-size: 48px;             /* scale emoji up a touch for 88px cells */
  user-select: none;
}

/* center-row highlight (two guide lines at row boundaries) */
.reel::before,
.reel::after{
  content:"";
  position:absolute; left:0; right:0;
  border-top: 2px solid rgba(255,255,255,.18);
  pointer-events:none;
}
.reel::before{ top: var(--cell-h); }
.reel::after { top: calc(var(--cell-h) * 2); }


/* make the auth/character area look like part of the page, not a big box */
.card.ghost{
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding: 8px 0 0;
}
#slotsResult{
  font-weight:600;
  margin-top: 6px;
}
.win{ color: var(--success); }
.smallwin{ color: var(--warn); }
.lose{ color: var(--muted); }

/* Utility badges */
.badge{
  display:inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #1a2030;
  color: #cbd3e6;
  font-size: 12px;
}

/* ---------- Helpers for spacing ---------- */
.row{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.mt-8{ margin-top:8px; } .mt-12{ margin-top:12px; } .mt-16{ margin-top:16px; }
.mb-8{ margin-bottom:8px; } .mb-12{ margin-bottom:12px; } .mb-16{ margin-bottom:16px; }
