html, body { 
  height: 100%; 
  overscroll-behavior: none; 
  margin: 0;
  font-family: system-ui, Arial, sans-serif;
  background: #0f1115;
  color: #f5f7fa;
}

body {
  display: grid;
  place-items: center;
  min-height: 100dvh;
}

:root { 
  --card_w: 320px; 
  --card_h: 440px; 
}

.deck_wrap {
  width: min(92vw, 380px);
  margin: 0 auto;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.deck_barrier {
  position: relative;
  width: var(--card_w);
  height: var(--card_h);
  margin: 0 auto;
}

.deck {
  position: relative;
  width: 100%;
  height: 100%;
}

/* ===== SIMPLE CARD - NO 3D ===== */
.card {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--card_w);
  height: var(--card_h);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  /* NO overflow:hidden here - prevents clipping during rotation */
  touch-action: none;
  user-select: none;
  transform-origin: center center;
  display: flex;
  flex-direction: column;
}

.card.top {
  z-index: 10;
}

.card:not(.top) {
  z-index: 1;
}

.card[data-state="outgoing"] {
  pointer-events: none;
  z-index: 5;
}

/* The inner content wrapper */
.card_inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
}

.face.front {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
}

.face.back {
  display: none;
}

/* For simpler card structure (no card_inner) */
.card > div:first-child:not(.card_inner) {
  background: #fff;
}

.card img {
  width: 100%;
  flex: 1;
  min-height: 0;
  object-fit: contain;
  background: #fff;
  pointer-events: none;
  border-radius: 0 0 16px 16px;
}

/* ===== HUD & CONTROLS ===== */
.hud {
  text-align: center;
  opacity: .8;
  margin-top: 14px;
  font-size: 14px;
}

.deck_controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-top: 12px;
}

.ctrl_btn, .ctrl_link {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: #2a2f3a;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
  cursor: pointer;
}

#menu_panel {
  width: min(92vw, 380px);
  margin: 10px auto 0;
  padding: 14px;
  border-radius: 12px;
  background: #1e222b;
  display: none;
}

#menu_panel.is_open {
  display: block;
}
