  html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100%;
  }

  .stars {
    clip-path: inset(0 0 0 var(--sidebar-offset));
  }

  @media (max-width: 900px) {
    .stars {
      clip-path: none;
    }
  }

  #app {
    flex: 1;
    width: 100%;
  }

  .dice-roller-app {
    --dr-primary: #6366f1;
    --dr-primary-hover: #4f46e5;
    --dr-bg: #1e1e2e;
    --dr-surface: #2a2a3e;
    --dr-surface-light: #3a3a4e;
    --dr-text: #e4e4e7;
    --dr-text-muted: #a1a1aa;
    --dr-accent: #f59e0b;
    --dr-success: #22c55e;
    --dr-border: #404050;
    --dr-d4: #22c55e;
    --dr-d6: #3b82f6;
    --dr-d8: #8b5cf6;
    --dr-d10: #ef4444;
    --dr-d12: #f59e0b;
    --dr-d20: #ec4899;
    
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dr-text);
    height: 100vh;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  .dice-roller-app * {
    box-sizing: border-box;
  }

  .dr-main-layout {
    display: flex;
    gap: 0;
    width: 100%;
    height: 100vh;
    align-items: stretch;
    padding-left: 0;
  }

  /* Main content layout - override shared layout styles for dice roller */
  .main-content.dr-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 48px;
    position: relative;
    margin-left: var(--sidebar-offset);
    width: calc(100% - var(--sidebar-offset));
    transition: none;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }
  
  /* Remove spacing pseudo-elements from shared layout */
  .main-content.dr-container::before,
  .main-content.dr-container::after {
    display: none !important;
  }

  .dr-game-container {
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    margin: 0;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .dr-total-display {
    position: relative;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #B900FF 0%, #832EC5 100%);
    border-radius: 12px;
    padding: 16px 32px;
    text-align: center;
    width: auto;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(185, 0, 255, 0.4);
    z-index: 10;
  }

  .dr-total-display.is-hidden {
    visibility: hidden;
  }

  .dr-total-label {
    display: block;
    font-size: 0.66rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
  }

  .dr-total-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #FFFFFF;
  }

  /* Sidebar layout inherited from shared-sidebar-layout.css */
  /* Using .sidebar class from shared layout */

  .dr-sidebar-total {
    background: linear-gradient(135deg, #B900FF 0%, #832EC5 100%);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
  }

  .dr-sidebar-total-label {
    display: block;
    font-size: 0.66rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
  }

  .dr-sidebar-total-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #FFFFFF;
  }

  .dr-sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .dr-sidebar-title {
    font-size: 0.66rem;
    font-weight: 600;
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .dr-sidebar-dice-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
  }

  .dr-sidebar-dice-btn {
    position: relative;
    background: #F5F5F5;
    border: 2px solid #E0E0E0;
    color: #333333;
    padding: 4px 2px 20px 2px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 88px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: visible;
  }
  
  .dr-sidebar-dice-btn canvas {
    max-height: 60px;
    pointer-events: none;
  }

  .dr-sidebar-dice-btn::after {
    content: attr(data-sides);
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    font-weight: 700;
    color: #666666;
  }

  .dr-sidebar-dice-btn:hover:not(:disabled) {
    background: #E8E8E8;
    transform: translateY(-1px);
  }

  .dr-sidebar-dice-btn:active:not(:disabled) {
    transform: scale(0.95);
  }

  .dr-sidebar-dice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
  }

  .dr-sidebar-dice-btn.dr-d4 { border-color: #22c55e; }
  .dr-sidebar-dice-btn.dr-d6 { border-color: #3b82f6; }
  .dr-sidebar-dice-btn.dr-d8 { border-color: #8b5cf6; }
  .dr-sidebar-dice-btn.dr-d10 { border-color: #ef4444; }
  .dr-sidebar-dice-btn.dr-d12 { border-color: #f59e0b; }
  .dr-sidebar-dice-btn.dr-d20 { border-color: #ec4899; }

  .dr-sidebar-dice-btn.dr-selected {
    border-color: #832EC5;
    box-shadow: 0 0 0 2px rgba(131, 46, 197, 0.2);
  }
  .dr-sidebar-dice-btn.dr-selected.dr-d4 {
    background: rgba(131, 46, 197, 0.15);
  }
  .dr-sidebar-dice-btn.dr-selected.dr-d6 {
    background: rgba(131, 46, 197, 0.15);
  }
  .dr-sidebar-dice-btn.dr-selected.dr-d8 {
    background: rgba(131, 46, 197, 0.15);
  }
  .dr-sidebar-dice-btn.dr-selected.dr-d10 {
    background: rgba(131, 46, 197, 0.15);
  }
  .dr-sidebar-dice-btn.dr-selected.dr-d12 {
    background: rgba(131, 46, 197, 0.15);
  }
  .dr-sidebar-dice-btn.dr-selected.dr-d20 {
    background: rgba(131, 46, 197, 0.15);
  }

  .dr-sidebar-check {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #832EC5;
    color: white;
    font-size: 0.75rem;
    min-width: 22px;
    height: 22px;
    padding: 0 4px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    z-index: 10;
  }

  .dr-sidebar-clear-btn {
    width: 100%;
    background: #FFFFFF;
    border: 2px solid #EF4444;
    color: #333333;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .dr-sidebar-clear-btn:hover:not(:disabled) {
    background: #FEF2F2;
    transform: translateY(-1px);
  }

  .dr-sidebar-clear-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .dr-history-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .dr-reset-btn {
    width: 100%;
    background: #FFFFFF;
    border: 2px solid #EF4444;
    color: #333333;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .dr-reset-btn:hover:not(:disabled) {
    background: #FEF2F2;
    transform: translateY(-1px);
  }

  .dr-reset-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .dr-history-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .dr-history-item {
    background: #F5F5F5;
    border-radius: 8px;
    padding: 8px 10px;
  }

  .dr-history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
  }

  .dr-history-roll-num {
    font-size: 0.66rem;
    font-weight: 600;
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .dr-history-total {
    font-size: 1rem;
    font-weight: 700;
    color: #FFFFFF;
    background: linear-gradient(135deg, #B900FF 0%, #832EC5 100%);
    padding: 2px 10px;
    border-radius: 12px;
  }

  .dr-history-dice {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .dr-history-die {
    font-size: 0.75rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 500;
    background: #832EC5;
    color: #FFFFFF;
  }

  .dr-history-die.d4 { background: rgba(34, 197, 94, 0.2); color: #16a34a; }
  .dr-history-die.d6 { background: rgba(59, 130, 246, 0.2); color: #2563eb; }
  .dr-history-die.d8 { background: rgba(139, 92, 246, 0.2); color: #7c3aed; }
  .dr-history-die.d10 { background: rgba(239, 68, 68, 0.2); color: #dc2626; }
  .dr-history-die.d12 { background: rgba(245, 158, 11, 0.2); color: #d97706; }
  .dr-history-die.d20 { background: rgba(236, 72, 153, 0.2); color: #db2777; }

  .dr-history-empty {
    color: #999999;
    font-style: italic;
    text-align: center;
    padding: 20px 16px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
  }

  /* Responsive sidebar width breakpoints inherited from shared-sidebar-layout.css */
  @media (max-width: 900px) {
    .dr-history-section {
      max-height: 200px;
    }
  }



  .dr-3d-viewport {
    width: 100%;
    flex: 1;
    min-height: 0;
    min-height: 400px;
    position: relative;
    perspective: 1500px;
    background: transparent;
    margin: 0 auto;
  }
  
  .dr-3d-viewport canvas {
    background: transparent !important;
  }

  .dr-roll-btn-main {
    background: linear-gradient(135deg, #B900FF 0%, #832EC5 100%);
    border: none;
    color: white;
    padding: 18px 64px;
    border-radius: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 8px 32px rgba(185, 0, 255, 0.4);
    margin-top: auto;
    margin-bottom: 0;
    align-self: center;
  }

  .dr-roll-btn-main:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(185, 0, 255, 0.5);
  }

  .dr-roll-btn-main:active:not(:disabled) {
    transform: scale(0.98);
  }

  .dr-roll-btn-main:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .dr-result-text {
    font-size: 2rem;
    font-weight: 700;
    color: #FFFFFF;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  }

  .dr-3d-viewport canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
    cursor: pointer;
  }

  .dr-no-dice-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--dr-text-muted);
    font-style: italic;
    z-index: 1;
  }

  .dr-number-overlay {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    width: 0;
    height: 0;
    overflow: visible;
  }

  .dr-number-overlay span {
    color: #fff;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 8px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
  }

  @media (max-width: 480px) {
    .dice-roller-app {
      padding: 0.75rem;
    }
    .dr-sidebar-dice-buttons {
      grid-template-columns: repeat(2, 1fr);
    }
    .dr-sidebar-total-value {
      font-size: 2rem;
    }
    .dr-3d-viewport {
      min-height: 280px;
      max-height: 400px;
    }
  }

  @media (min-width: 768px) and (max-width: 900px) {
    .dr-3d-viewport {
      min-height: 350px;
      max-height: 500px;
    }
  }

  @media (min-width: 901px) {
    .dr-3d-viewport {
      min-height: 450px;
      max-height: 600px;
    }
  }
