/* Dice Roller - Minimal Casino Theme */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --felt-green: #1a472a;
  --felt-dark: #0d2818;
  --gold: #d4af37;
  --gold-dim: rgba(212, 175, 55, 0.6);
}

html, body {
  height: 100%;
  overflow: hidden;
  touch-action: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--felt-dark);
  color: #fff;
}

.app {
  position: relative;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, #2d5a3d 0%, var(--felt-green) 40%, var(--felt-dark) 100%);
  overflow: hidden;
}

/* Subtle felt texture */
.app::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

/* Subtle edge glow */
.felt-edge {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5);
  border: 3px solid rgba(93, 64, 55, 0.4);
  pointer-events: none;
  z-index: 10;
}

/* Canvas */
#diceCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Result - top center, minimal */
.result {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid var(--gold-dim);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 20;
}

.result.visible {
  opacity: 1;
}

/* Controls - bottom, horizontal strip */
.controls {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 20;
}

/* Dice selector - compact pills */
.dice-selector {
  display: flex;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 20px;
  padding: 4px;
  gap: 2px;
}

.dice-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dice-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.dice-btn.active {
  background: var(--gold);
  color: #1a1a1a;
}

/* Roll button - compact */
.roll-button {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  background: linear-gradient(to bottom, #c41e3a 0%, #8b0000 100%);
  color: #fff;
  box-shadow: 0 3px 0 #5c0000, 0 4px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.1s ease;
}

.roll-button:hover {
  background: linear-gradient(to bottom, #d4283f 0%, #9b0000 100%);
}

.roll-button:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 #5c0000, 0 1px 4px rgba(0, 0, 0, 0.4);
}

.roll-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Shake toggle */
.shake-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border: none;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.shake-toggle:hover {
  background: rgba(0, 0, 0, 0.7);
  color: rgba(255, 255, 255, 0.8);
}

.shake-toggle.active {
  background: rgba(212, 175, 55, 0.3);
  color: var(--gold);
  border: 1px solid var(--gold-dim);
}

.shake-icon {
  width: 18px;
  height: 18px;
}

.shake-status {
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Safe area for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .controls {
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

/* Smaller screens */
@media (max-width: 380px) {
  .controls {
    gap: 8px;
  }

  .dice-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .roll-button {
    padding: 8px 18px;
    font-size: 12px;
  }

  .shake-toggle {
    padding: 6px 10px;
  }

  .shake-icon {
    width: 16px;
    height: 16px;
  }
}

/* Landscape mode */
@media (max-height: 450px) {
  .result {
    top: 8px;
    font-size: 22px;
    padding: 6px 16px;
  }

  .controls {
    bottom: 8px;
  }
}
