/* Games drawer + full-screen modal */
.games-drawer-section { margin-top: 0.75rem; }
.games-drawer-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #888);
  margin: 0 0 0.5rem;
}
.games-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--view-primary, #b8653a) 16%, transparent);
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--view-primary, #b8653a) 8%, transparent),
    rgba(255, 255, 255, 0.02)
  );
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s, background 0.15s;
}
.games-card:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--view-accent, #a85a62) 26%, transparent);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--view-primary, #b8653a) 10%, transparent),
    rgba(255, 255, 255, 0.025)
  );
  transform: translateY(-1px);
}
.games-card:disabled, .games-card--done {
  opacity: 0.55;
  cursor: default;
}
.games-card-type { font-weight: 600; font-size: 0.95rem; }
.games-card-progress { font-size: 0.8rem; color: var(--text-muted, #888); margin-top: 0.25rem; }
.games-card-hint { font-size: 0.75rem; color: color-mix(in srgb, var(--view-primary, #b8653a) 75%, var(--text-muted, #888)); margin-top: 0.35rem; }
.games-card-rules { font-size: 0.8rem; color: var(--text-muted, #999); margin: 0.65rem 0 0; line-height: 1.4; }

.g-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: gFadeIn 0.2s ease;
}

.g-modal-embedded {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  width: 100%;
  padding: 0;
  overflow: hidden;
  background: transparent;
}

.g-modal-embedded .g-modal {
  width: 100%;
  max-width: none;
  flex: 1;
  min-height: 0;
  margin: 0;
  box-shadow: none;
  border: none;
  border-radius: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  max-height: none;
  overflow: hidden;
}
@keyframes gFadeIn { from { opacity: 0; } to { opacity: 1; } }

.g-modal {
  width: min(100%, 420px);
  max-height: 92vh;
  overflow: auto;
  background: var(--surface, #121212);
  border: 1px solid var(--border, #333);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.g-modal-header {
  flex-shrink: 0;
  padding: 0.5rem 1.25rem 0.35rem;
  text-align: center;
}
.g-modal-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #888);
}
.g-modal-sub { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--text-muted, #888); }
.games-play-scroll {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.g-modal-body {
  flex: 1;
  min-height: 0;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  overflow: hidden;
}
.g-modal-embedded .g-modal-body {
  overflow: hidden;
  justify-content: center;
}
.g-modal-stage { width: 100%; display: flex; justify-content: center; flex-shrink: 0; }
.g-modal-stage--compact .g-wheel-wrap { width: 60vw; height: 60vw; }
.g-modal-footer {
  flex-shrink: 0;
  padding: 0.75rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.g-btn {
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border, #444);
  background: var(--surface-2, #222);
  color: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.g-btn-primary {
  background: var(--accent, #3d7a52);
  border-color: var(--accent, #3d7a52);
  color: #fff;
  font-weight: 600;
}
.g-btn:disabled { opacity: 0.5; cursor: wait; }

.g-result-headline { font-size: 1.35rem; margin: 0; text-align: center; }
.g-result-detail { font-size: 0.9rem; color: var(--text-muted, #aaa); margin: 0; text-align: center; max-width: 320px; }
.g-result-reward { color: #6b9e78; }
.g-result-punishment { color: #c45c5c; }
.g-result-task { color: #c9b86c; }
.g-error { color: #c45c5c; text-align: center; }
.g-reporting { font-size: 0.85rem; color: var(--text-muted, #888); margin: 0.5rem 0 0; font-style: italic; }
.g-sync-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 180px;
  padding: 1.5rem;
}
.g-sync-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent, #3d7a52);
  border-radius: 50%;
  animation: gSyncSpin 0.85s linear infinite;
}
@keyframes gSyncSpin {
  to { transform: rotate(360deg); }
}
.g-sync-text {
  margin: 0;
  font-size: 1rem;
  color: var(--text-muted, #bbb);
}
.g-thinking {
  margin: 0 0 0.75rem;
  text-align: center;
  font-size: 1rem;
  color: var(--text-muted, #bbb);
  font-style: italic;
}
.games-card--pending {
  border-color: #c9b86c;
}

.g-modal--locked .g-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.g-chaster { font-size: 0.95rem; font-weight: 600; margin: 0.5rem 0 0; text-align: center; flex-shrink: 0; }
.g-chaster--add { color: #c45c5c; }
.g-chaster--reward { color: #6b9e78; }

/* Dice */
.g-dice-pair { display: flex; gap: 1.25rem; justify-content: center; }
.g-dice-scene { width: 72px; height: 72px; perspective: 400px; }
.g-dice-cube {
  width: 72px; height: 72px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  padding: 8px;
  background: #f5f0e8;
  border-radius: 10px;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.35);
}
.g-dice-cube.rolling { animation: gDiceShake 0.12s infinite; }
@keyframes gDiceShake {
  0%, 100% { transform: rotate(-8deg) scale(1.02); }
  50% { transform: rotate(8deg) scale(0.98); }
}
.g-dice-pip {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: transparent;
  justify-self: center;
  align-self: center;
}
.g-dice-pip.on { background: #1a1a1a; }

/* Wheel — 70% viewport width for legibility */
.g-wheel-wrap {
  position: relative;
  width: 70vw;
  height: 70vw;
  max-width: min(70vw, 520px);
  max-height: min(70vw, 520px);
  margin: 0 auto;
  overflow: hidden;
  flex-shrink: 0;
  contain: layout style paint;
}
.g-wheel-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.45));
}
.g-wheel-rotor {
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
  will-change: transform;
}
.g-wheel-rotor.spinning {
  transition: none;
}
.g-result-headline,
.g-result-detail {
  opacity: 0;
}
.g-result-headline.g-result-reveal,
.g-result-detail.g-result-reveal {
  animation: gResultReveal 0.55s ease forwards;
}
.g-result-detail.g-result-reveal {
  animation-delay: 0.12s;
}
@keyframes gResultReveal {
  to {
    opacity: 1;
  }
}
.g-wheel-slice {
  vector-effect: non-scaling-stroke;
}
.g-wheel-pointer {
  position: absolute;
  top: -2%;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: clamp(10px, 2vw, 14px) solid transparent;
  border-right: clamp(10px, 2vw, 14px) solid transparent;
  border-top: clamp(18px, 3.5vw, 26px) solid #e8e0d0;
  z-index: 5;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.4));
}
.g-wheel-svg-text {
  font-family: system-ui, -apple-system, sans-serif;
  letter-spacing: 0.03em;
  paint-order: stroke fill;
  stroke: rgba(0, 0, 0, 0.85);
  stroke-width: 0.45px;
}
.g-wheel-hub {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.g-wheel-hub-ring {
  pointer-events: none;
}
