* {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-sm);
  z-index: 10000;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-sm);
}

body {
  background-color: var(--color-surface);
  color: var(--color-text);
  margin: 0;
  padding: 0;
}

/* 
 * Theme-specific CSS variables are loaded dynamically based on game type.
 * See /themes/ directory for theme files.
 */

:root {
  /* Non-theme-specific spacing and layout values */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  
  /* Border radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;

  /* react-md-editor font settings */
  --editor-font-family: ui-monospace, sfmono-regular, menlo, monaco, consolas, "Liberation Mono", "Courier New", monospace;
  --editor-font-size: 14px;
  --editor-line-height: 1.5;
  --editor-letter-spacing: 0;
  --editor-tab-size: 4;
  --editor-font-variant-ligatures: none;
}

/* System Notification Panel */
.system-notification {
  position: fixed;
  top: var(--space-sm);
  left: var(--space-sm);
  right: var(--space-sm);
  z-index: 9999;
  padding: var(--space-md);
  text-align: center;
  font-weight: 500;
  box-shadow: var(--shadow-medium);
  border: 2px solid var(--color-interactive);
  border-radius: var(--radius-md);
  filter: drop-shadow(0 4px 8px var(--color-overlay));
  animation: fade-in 0.3s ease-in-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.system-notification-normal {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.system-notification-urgent {
  background-color: var(--color-danger);
  color: var(--color-text-inverse);
  animation: urgent-pulse 2s infinite;
}

@keyframes urgent-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md, 1rem);
  background: var(--color-surface, #fff);
  z-index: 9999;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-primary-light, #e3f2fd);
  border-top-color: var(--color-primary, #06c);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  color: var(--color-text-muted, #6c757d);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
}

.system-notification-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  max-width: 1200px;
  margin: 0 auto;
}

.system-notification-message {
  flex: 1;
}

.system-notification-dismiss {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.system-notification-dismiss:hover {
  opacity: 1;
  background-color: var(--color-interactive-hover);
}

@media screen and (width <= 768px) {
  body {
    font-size: 16px;
    overflow-x: hidden;
  }
  
  * {
    box-sizing: border-box;
  }

  .gameslist {
    padding: var(--space-md);
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .allgames {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .joingame,
  .newgame {
    width: 100%;
    margin-bottom: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  h1 {
    font-size: 20px;
  }

  input,
  textarea,
  button {
    font-size: 16px;
    padding: var(--space-md);
  }

  .game-container {
    padding: var(--space-md);
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-menu {
    margin-top: var(--space-md);
  }

  .tab-bar {
    flex-wrap: wrap;
    margin-bottom: var(--space-sm);
  }

  .tab-bar button {
    flex: 1 0 45%;
    margin-bottom: var(--space-xs);
    margin-right: var(--space-xs);
    border-radius: 6px;
    max-width: none;
  }

  .tab-bar button.active::after {
    display: none;
  }

  .game-card {
    min-height: auto;
  }

  .game-cards-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .allgames {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .newgame {
    position: static;
    max-height: none;
  }
}

.hidden {
    display: none;
}

.gameslist {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl);
    background-color: var(--color-surface-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-light);
}

.allgames {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-xl);
    align-items: start;
}

/* Ensure proper responsive behavior for intermediate screen sizes */
@media screen and (width <= 1024px) {
    .allgames {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .newgame {
        position: static;
        max-height: none;
    }
}

.joingame,
.newgame {
    background-color: var(--color-surface);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--color-border);
}

.joingame {
    min-height: 400px;
}

.newgame {
    height: fit-content;
    max-height: 700px;
    position: sticky;
    top: var(--space-lg);
    overflow: visible;
}

/* Games Menu Typography */
.gameslist h1,
.gameslist h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--color-text);
    line-height: 1.2;
}

/* Games List Styling */
.joingame ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: var(--space-md);
}

.game-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-light);
    transition: all 0.2s ease;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.game-card:hover {
    box-shadow: var(--shadow-medium);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.game-card:focus-within {
    box-shadow: var(--shadow-medium);
    border-color: var(--color-primary);
    outline: 2px solid var(--color-primary-light);
    outline-offset: 2px;
}

.game-link:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-md);
}

.game-link:active {
    transform: translateY(1px);
}

/* Game Link Styling */
.game-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
}

.game-link h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 var(--space-sm) 0;
    color: var(--color-text);
    line-height: 1.3;
}

.game-link h4 {
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0 0 var(--space-sm) 0;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-link span {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    font-style: italic;
    display: block;
    margin-bottom: var(--space-sm);
}

.game-link .game-description {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Create Game Form Styling */
.newgame form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    height: 100%;
}

.newgame .form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
}

.newgame label {
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.newgame input,
.newgame select {
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background-color: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.newgame input:focus,
.newgame select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.newgame button {
    padding: var(--space-md) var(--space-lg);
    background-color: var(--color-action);
    color: var(--color-surface);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.newgame button:hover {
    background-color: var(--color-action-hover);
    transform: translateY(-1px);
}

.newgame button:active {
    transform: translateY(0);
}

/* Game Description Editor Styling */
.newgame .form-field:has(#game-description) {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.newgame .form-field #game-description {
    min-height: 150px;
    flex: 1;
}

.newgame .form-field .w-md-editor-text {
    min-height: 150px;
    height: auto;
    flex: 1;
}

.newgame input::placeholder,
.newgame .form-field .w-md-editor-text-input::placeholder {
    color: var(--color-text-muted);
    -webkit-text-fill-color: var(--color-text-muted);
}

/* Make sure the text in the shown and hidden versions of the text in the editor match */
.w-md-editor .w-md-editor-text,
.w-md-editor .w-md-editor-text-input,
.w-md-editor .w-md-editor-text-pre,
.language-markdown .code-line,
.language-markdown .token {
  font-family: var(--editor-font-family) !important;
  font-size: var(--editor-font-size);
  line-height: var(--editor-line-height);
  letter-spacing: var(--editor-letter-spacing);
  tab-size: var(--editor-tab-size);
  font-variant-ligatures: var(--editor-font-variant-ligatures);
}

/* Quota exceeded message styling */
.quota-exceeded-message {
    background-color: var(--color-surface-light);
    border: 1px solid var(--color-error);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-top: var(--space-md);
    color: var(--color-text);
    font-weight: 600;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Game quota display styling */
.game-quota {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

.quota-warning {
    color: var(--color-text);
    font-weight: 600;
}

.error-container {
    background-color: var(--color-error-light);
    border: 1px solid var(--color-error);
    border-radius: 3px;
    padding: 10px;
    margin-top: 10px;
}

.error-container.hidden {
    display: none;
}

.error-message {
    color: var(--color-error);
    margin-bottom: 10px;
}

.error-container button {
    background-color: var(--color-error);
    color: var(--color-text-inverse);
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

.error-container button:hover {
    background-color: var(--color-error-hover);
}


.game-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.user-menu {
  position: relative;
}

.user-menu img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
}

.dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  z-index: 1001;
  box-shadow: var(--shadow-medium);
  min-width: 200px;
}

.dropdown button {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background-color: var(--color-action);
  color: var(--color-surface);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dropdown button:hover {
  background-color: var(--color-action-hover);
  transform: translateY(-1px);
}

.dropdown button:active {
  transform: translateY(0);
}

.dropdown-separator {
  border-top: 1px solid var(--color-border);
  margin: var(--space-sm) 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.user-avatar-small {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}

.user-email {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-selector {
  margin-bottom: var(--space-sm);
}

.language-selector label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.language-selector select {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background-color: var(--color-surface);
  border: none;
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 0.875rem;
  cursor: pointer;
  box-sizing: border-box;
}

.version-info {
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: var(--space-sm);
  padding: var(--space-xs) 0;
}

.top-bar h1 {
  display: flex;
  align-items: center;
}

.top-bar .info-icon-button,
.top-bar .edit-icon-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  font-size: 0.8em;
  margin-left: 10px;
}

.top-bar .info-icon-button {
  color: var(--color-primary);
}

.top-bar .edit-icon-button {
  color: var(--color-primary);
}

.tab-bar {
  display: flex;
  margin-bottom: 0;
  border-bottom: 2px solid var(--color-border);
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab-bar button {
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-bottom: none;
  background-color: var(--color-surface-light);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
  border-radius: 8px 8px 0 0;
  margin-right: 2px;
  min-width: 0;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-bar button:hover {
  background-color: var(--color-interactive-hover);
  color: var(--color-text);
  transform: translateY(-1px);
}

.tab-bar button.active {
  background-color: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-primary);
  font-weight: 600;
  z-index: 1;
}

.tab-bar button.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-surface);
}

/* Death overlay - covers entire character sheet when HP = 0 */
.player-sheet.character-deceased {
  position: relative;
  filter: grayscale(70%) opacity(0.5);  /* More pronounced fade */
}

.death-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;  /* Position banner at top, not center */
  justify-content: center;
  pointer-events: none;
  z-index: 100;
}

.death-banner {
  position: sticky;           /* Stick to top while scrolling */
  top: 120px;                 /* Stay 120px from top of viewport */
  margin-top: 120px;          /* Initial offset from top of sheet */
  background-color: var(--color-danger);
  color: var(--color-text-inverse);
  padding: 1.5rem 3rem;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-align: center;
  text-transform: uppercase;
  border: 4px solid var(--color-text);
  border-radius: var(--radius-md);
  box-shadow: var(--color-shadow-dramatic);
  z-index: 100;               /* Same as overlay, below top nav */
  max-width: 90vw;            /* Responsive on mobile */
}

/* Tab strikethrough for dead characters */
.deceased-character-name {
  text-decoration: line-through;
  opacity: 0.6;
}

/* Mobile responsive */
@media (width <= 768px) {
  .death-banner {
    font-size: 1.3rem;
    padding: 1rem 2rem;
  }
}

.section {
  margin-bottom: 20px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

/* Edit mode styling for sections */
.section.editing {
  border: 2px solid var(--color-primary);
  background-color: var(--color-primary-light);
  box-shadow: var(--color-shadow-medium);
  position: relative;
}

.section-editing-indicator {
  position: absolute;
  top: -12px;
  right: 10px;
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 1;
}

/* Lifted styling for sections when drag is unlocked */
.sections-unlocked .section {
  box-shadow: var(--color-shadow-section);
  transform: translateY(-2px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sections-unlocked .section:hover {
  transform: translateY(-4px);
  box-shadow: var(--color-shadow-strong);
}

.section h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title-edit {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 15px;
  padding: 8px 12px;
  border: 2px solid var(--color-primary);
  border-radius: 4px;
  background-color: var(--color-surface);
  color: var(--color-text);
}

.new-section {
  margin-top: 20px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.new-section-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.new-section input,
.new-section select {
  flex: 1;
  min-width: 150px;
}

.sheet-header {
  margin-bottom: 20px;
}

.edit-character-name {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.edit-character-name input {
  flex: 1;
  min-width: 200px;
  font-size: 1.5rem;
  font-weight: bold;
  padding: 8px 12px;
  border: 2px solid var(--color-primary);
  border-radius: 4px;
  background-color: var(--color-surface);
  color: var(--color-text);
}

.view-character-name h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
}

/* NotificationToast.css */

.toast-manager {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px; /* Space between each toast */
  z-index: 1000; /* Make sure it's on top of other UI elements */
}

.notification-toast {
  background-color: var(--color-toast-error); /* For errors: red background */
  color: var(--color-text-inverse);
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: var(--color-shadow-light);
  animation: slide-in 0.3s ease-out;
  transition: transform 0.3s ease-out, opacity 0.3s ease-in;
  opacity: 1;
  max-width: 300px;
}

.notification-toast.success {
  background-color: var(--color-toast-success); /* For success: green background */
}

.notification-toast.fade-out {
  opacity: 0;
  transform: translateY(-20px); /* Move up when fading out */
  transition: opacity 0.3s ease-in, transform 0.3s ease-in;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.info-icon {
  margin-left: 0.5rem;
  cursor: pointer;
}

.item-length-controls {
  display: flex;
  align-items: center;
}

.item-length-controls button {
  width: 2rem;
  height: 2rem;
  margin: 0 0.5rem;
}


.react-tooltip {
  max-width: 250px; /* Adjust to the width you prefer */
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Ensure long words are broken if needed */
  text-align: left; /* Align text left for readability */
  padding: 10px; /* Optional: Adds padding around the text */
}

.own-ops {
  margin-left: 1em;
}

.own-ops .own-sheet {
  background-color: var(--color-primary-light); /* Light blue background */
  color: var(--color-text); /* Black text */
  padding: 2px 6px; /* Padding inside the box */
  border-radius: 8px; /* Rounded corners */
  text-transform: uppercase; /* Make the text uppercase */
  font-weight: bold; /* Make the text bold */
  display: inline-block; /* Ensure it behaves as a box */
  margin-left: 10px; /* Add some space between the pencil icon and the span */
  font-size: 50%;
  vertical-align: middle;
  line-height: 1;
}

.burn-checkbox {
  width: 24px;
  height: 24px;
  margin-right: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  cursor: pointer;
}

.burn-checkbox.ticked {
  background-color: var(--color-accent-ticked);
  color: var(--color-text-inverse);
}

.burn-checkbox.burnt {
  background-color: var(--color-accent-burnt);
  color: var(--color-text-inverse);
}


.tick-checkbox {
  width: 24px;
  height: 24px;
  margin-right: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  cursor: pointer;
}

.tick-checkbox.ticked {
  background-color: var(--color-accent-ticked);
  color: var(--color-text-inverse);
}

.tick-checkbox.unticked {
  background-color: transparent;
}

.tick-checkbox:not(:disabled),
.burn-checkbox:not(:disabled) {
  cursor: pointer;
}

.tick-checkbox:disabled,
.burn-checkbox:disabled {
  cursor: default;
  opacity: 0.6;
}

/* Clock Styles */
.clock-container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  min-width: 0; /* Allow flexbox to shrink */
}

.clock-bar {
  display: flex;
  flex: 1;
  width: 200px; /* Fixed width for consistent bar lengths */
  min-height: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  overflow: hidden;
}

.clock-segment {
  flex: 1;
  height: 24px;
  border: none;
  border-right: 1px solid var(--color-border);
  background-color: transparent;
  cursor: pointer;
  transition: background-color 0.2s ease;
  min-width: 2px; /* Very small minimum to prevent rounding issues */
}

.clock-segment:last-child {
  border-right: none;
}

.clock-segment.filled {
  background-color: var(--color-accent-ticked);
}

.clock-segment.unfilled {
  background-color: transparent;
}

.clock-segment:not(:disabled):hover {
  opacity: 0.8;
}

.clock-segment:disabled {
  cursor: default;
  opacity: 0.6;
}

/* Clock Filled Bar Mode (for high segment counts) */
.clock-bar-filled {
  display: flex;
  flex: 1;
  width: 200px;
  min-height: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.clock-bar-filled-progress {
  height: 24px; /* Same as clock segments */
  background-color: var(--color-accent-ticked);
  transition: width 0.2s ease;
  border-radius: inherit;
}

.clock-bar-filled:hover .clock-bar-filled-progress {
  opacity: 0.8;
}

.clock-bar-filled.disabled {
  cursor: default;
}

.clock-bar-filled.disabled .clock-bar-filled-progress {
  opacity: 0.6;
}

/* Clock Edit Mode Styles */
.clock-edit-main-line {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  margin-bottom: var(--space-sm);
  min-width: 0; /* Allow flexbox to shrink */
}

.clock-name-input {
  flex: 1;
  min-width: 80px;
  margin-right: 8px;
}

.clock-number-input {
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.clock-edit-separator {
  font-size: 1.2em;
  color: var(--color-text-secondary);
  margin: 0 4px;
  flex-shrink: 0;
}

.clock-edit-label {
  font-size: 0.9em;
  color: var(--color-text-secondary);
  margin-left: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}


.clock-description-input {
  width: 100%;
  margin-top: var(--space-sm);
}

.clock-progress-element {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* Info icon positioning fix */
.section-item span .btn-icon.info {
  margin-left: var(--space-xs);
  vertical-align: text-top;
  line-height: 1;
  display: inline-block;
  transform: translateY(-1px);
}

/* Responsive adjustments for very narrow screens */
@media (width <= 480px) {
  .clock-edit-main-line {
    flex-wrap: wrap;
    gap: var(--space-xs);
  }

  .clock-name-input {
    flex-basis: 100%;
    margin-bottom: var(--space-xs);
    margin-right: 0;
  }
}

.section-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.section-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  max-width: 100%;
  grid-column: 1 / -1;
  margin-bottom: 0.75rem;
}

.section-item span {
  flex: 0 0 200px;
  font-weight: 500;
  padding-top: 0.25rem;
  text-align: left;
}

.section-item input[type="text"] {
  flex: 1;
  max-width: 400px;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 3px;
}

@media screen and (width <= 600px) {
  .section-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .section-item span {
    flex: none;
    padding-top: 0;
  }
  
  .section-item input[type="text"] {
    max-width: none;
  }
}

/* Override section-items grid for delta green stats to take full width */
.section-items .delta-green-stats-grid {
  grid-column: 1 / -1;
}

/* Override section-items grid for delta green derived attributes to take full width */
.section-items .delta-green-derived-grid {
  grid-column: 1 / -1;
}

/* Override section-items grid for rich text content to take full width */
.section-items .rich-text-content {
  grid-column: 1 / -1;
}

.object-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.markdown-tippy .tippy-content {
  padding: 10px;
  margin: 0;
}

.markdown-tippy .tippy-content p {
  margin-top: 0;
}

.markdown-tippy .tippy-content h1,
.markdown-tippy .tippy-content h2,
.markdown-tippy .tippy-content h3,
.markdown-tippy .tippy-content h4,
.markdown-tippy .tippy-content h5,
.markdown-tippy .tippy-content h6 {
  margin-top: 0;
}

.markdown-tippy .tippy-content p:last-child {
  margin-bottom: 0;
}

.info-icon-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: var(--color-primary);
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.info-icon-button:hover,
.info-icon-button:focus {
  background: none;
  color: var(--color-primary);
  outline: none;
}

.delete-section-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--color-surface);
  padding: 20px;
  border-radius: 5px;
  box-shadow: var(--color-shadow);
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 1000;
}

.delete-section-modal h2 {
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center;
}

.delete-section-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.delete-section-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

.delete-section-item:last-child {
  border-bottom: none;
}

.delete-section-name {
  flex-grow: 1;
  margin-right: 10px;
}

.delete-section-button {
  background-color: transparent;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  padding: 5px;
}

.delete-section-button:hover {
  color: var(--color-danger-hover);
}


.delete-section-warning {
  background-color: var(--color-warning-light);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 15px;
  font-size: 0.9em;
  line-height: 1.4;
  text-align: center;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--color-overlay);
  z-index: 999;
}


.delete-player-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--color-surface);
  padding: 20px;
  border-radius: 5px;
  box-shadow: var(--color-shadow);
  max-width: 400px;
  width: 90%;
}

.delete-player-warning {
  color: var(--color-danger);
  margin-bottom: 20px;
}

.confirm-checkbox {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.confirm-checkbox input {
  margin-right: 10px;
}

.modal-buttons {
  display: flex;
  justify-content: space-between;
}



.edit-icon-button {
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 10px;
  color: var(--color-primary);
}

.edit-game-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--color-surface);
  padding: 20px;
  border-radius: 5px;
  box-shadow: var(--color-shadow-light);
  max-width: 500px;
  width: 90%;
}

.edit-game-modal input,
.edit-game-modal .w-md-editor {
  width: 100%;
  margin-bottom: 10px;
}


.create-npc-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--color-surface);
  padding: 20px;
  border-radius: 5px;
  box-shadow: var(--color-shadow);
  max-width: 400px;
  width: 90%;
}

.create-npc-modal h2 {
  margin-top: 0;
  margin-bottom: 20px;
}

.create-npc-modal input {
  width: 90%;
  padding: 10px;
  margin-bottom: 20px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}


.footer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--color-surface-light);
  padding: 10px;
  text-align: center;
  border-top: 1px solid var(--color-border);
  overflow-x: auto;
  white-space: nowrap;
}

.footer-bar-links {
  display: inline-block;
  white-space: nowrap;
}

.footer-bar-links a {
  margin: 0 10px;
  color: var(--color-primary);
  text-decoration: none;
}

.footer-bar-links a:hover {
  text-decoration: underline;
}

.footer-bar p {
  margin-top: 5px;
  font-size: 0.8em;
  color: var(--color-text);
}

.game-container,
.gameslist {
  margin-bottom: 5em;
}

/* Delta Green Statistics grid styling */
.delta-green-stats-grid {
  margin-top: 10px;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.stats-header {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 80px 80px minmax(200px, 2fr);
  gap: 0;
  background-color: var(--color-surface-light);
  border-bottom: 2px solid var(--color-border);
  font-weight: bold;
  align-items: center;
}

.stats-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 80px 80px minmax(200px, 2fr);
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  align-items: center;
}

.stats-row:last-child {
  border-bottom: none;
}

.stats-row:nth-child(even) {
  background-color: var(--color-surface-light);
}

.stats-col-statistic,
.stats-col-score,
.stats-col-x5,
.stats-col-features {
  padding: 12px 8px;
  border-right: 1px solid var(--color-border);
  display: flex;
  align-items: center;
}

.stats-col-features {
  border-right: none;
}

.stats-col-statistic {
  font-weight: 500;
}

.stats-col-score,
.stats-col-x5 {
  justify-content: center;
}

.stats-col-x5 {
  font-weight: 500;
}

.delta-green-stats-grid input[type="number"] {
  width: 50px;
  text-align: center;
  border: 1px solid var(--color-border);
  padding: 6px;
  margin: 0;
  border-radius: 3px;
}

.delta-green-stats-grid input[type="text"] {
  width: 100%;
  border: 1px solid var(--color-border);
  padding: 6px;
  margin: 0;
  border-radius: 3px;
}

.delta-green-stats-grid input:disabled {
  border: none;
  background: transparent;
  color: inherit;
}

.delta-green-stats-grid input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-focus);
}

@media screen and (max-width: 768px) {
  .stats-header,
  .stats-row {
    grid-template-columns: minmax(120px, 1fr) 60px 60px minmax(150px, 1.5fr);
    font-size: 14px;
  }
  
  .stats-col-statistic,
  .stats-col-score,
  .stats-col-x5,
  .stats-col-features {
    padding: 8px 4px;
  }
  
  .delta-green-stats-grid input[type="number"] {
    width: 40px;
    padding: 4px;
  }
  
  .delta-green-stats-grid input[type="text"] {
    padding: 4px;
    font-size: 13px;
  }
}

/* Delta Green Derived Attributes grid styling */
.delta-green-derived-grid {
  margin-top: 10px;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.derived-header {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) 80px minmax(140px, 1fr) 50px;
  gap: 0;
  background-color: var(--color-surface-light);
  border-bottom: 2px solid var(--color-border);
  font-weight: bold;
  align-items: center;
}

.derived-row {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) 80px minmax(140px, 1fr) 50px;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  align-items: center;
}

.derived-row:last-child {
  border-bottom: none;
}

.derived-row:nth-child(even) {
  background-color: var(--color-surface-light);
}

.derived-row.disorder-warning {
  background-color: var(--color-accent-disorder1);
  box-shadow: inset 4px 0 0 var(--color-danger);
}

.derived-row.disorder-warning:nth-child(even) {
  background-color: var(--color-accent-disorder2);
}

/* WP Depletion Styling */
.derived-row.wp-depleted {
  background-color: var(--color-accent-disorder1);
  box-shadow: inset 4px 0 0 var(--color-danger);
}

.derived-row.wp-depleted:nth-child(even) {
  background-color: var(--color-accent-disorder2);
}

/* HP Depletion Styling */
.derived-row.hp-depleted {
  background-color: var(--color-accent-disorder1);
  box-shadow: inset 4px 0 0 var(--color-danger);
}

.derived-row.hp-depleted:nth-child(even) {
  background-color: var(--color-accent-disorder2);
}

.derived-col-attribute,
.derived-col-maximum,
.derived-col-current,
.derived-col-roll {
  padding: 12px 8px;
  border-right: 1px solid var(--color-border);
  display: flex;
  align-items: center;
}

.derived-col-roll {
  border-right: none;
  justify-content: center;
  align-items: center;
  padding: 8px;
}

.derived-col-roll .dice-button {
  margin-left: 0;
}

/* Sanity Loss Panel */
.sanity-loss-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background-color: var(--color-surface-light);
}

.sanity-loss-panel h4 {
  margin: 0 0 8px;
  color: var(--color-danger);
  font-size: 1rem;
}

.sanity-loss-description {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.sanity-loss-static-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  justify-content: center;
}

.sanity-loss-static-buttons .btn-sanity-loss {
  min-width: 40px;
  padding: 6px 8px;
}
.sanity-loss-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  justify-content: center;
}

.btn-sanity-loss {
  padding: 6px 12px;
  font-size: 0.9rem;
  font-weight: bold;
  border: 1px solid var(--color-danger);
  background-color: var(--color-surface);
  color: var(--color-danger);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 60px;
  text-align: center;
}

.btn-sanity-loss:hover:not(:disabled) {
  background-color: var(--color-danger);
  color: var(--color-surface);
  transform: translateY(-1px);
}

.btn-sanity-loss:active:not(:disabled) {
  transform: translateY(0);
}

.btn-sanity-loss:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.custom-actions-panel {
  margin: 16px 0;
}

.derived-col-current {
  border-right: 1px solid var(--color-border);
}

.derived-col-attribute {
  font-weight: 500;
}

.derived-col-maximum {
  justify-content: center;
  font-weight: 500;
}

.current-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  width: 100%;
}

.current-input {
  width: 50px;
  text-align: center;
  border: 1px solid var(--color-border);
  padding: 6px;
  margin: 0;
  border-radius: 3px;
}

.current-input:disabled {
  border: none;
  background: transparent;
  color: inherit;
}

.current-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-focus);
}

.adjust-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  padding: 0;
  color: var(--color-text);
  flex-shrink: 0;
}

.adjust-btn:hover:not(:disabled) {
  background-color: var(--color-surface-light);
  border-color: var(--color-primary);
}

.adjust-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--color-surface-light);
}

.disorder-notice {
  grid-column: 1 / -1;
  padding: 10px;
  text-align: center;
  font-weight: bold;
  margin: 0;
  min-height: 20px;
  height: 44px;
  box-sizing: border-box;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.disorder-notice.disorder {
  background-color: var(--color-warning-light);
  border-color: var(--color-warning-border);
  color: var(--color-warning);
}

.disorder-notice.sane {
  background-color: var(--color-info-light);
  border-color: var(--color-info-border);
  color: var(--color-accent-sane);
}

@media screen and (max-width: 768px) {
  .derived-header,
  .derived-row {
    grid-template-columns: minmax(150px, 2fr) 60px minmax(100px, 1fr) 40px;
    font-size: 14px;
  }
  
  .derived-col-attribute,
  .derived-col-maximum,
  .derived-col-current,
  .derived-col-roll {
    padding: 8px 4px;
  }
  
  .current-input {
    width: 40px;
    padding: 4px;
  }
  
  .adjust-btn {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }
}

/* Delta Green SAN Loss - Consistent spacing for all items */
.section-item.object-item {
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
}

/* Delta Green SAN Loss - Adapted item styling */
.section-item.adapted-item {
  background-color: var(--color-warning-light);
  border-color: var(--color-warning-border);
}

.adapted-label {
  color: var(--color-warning);
  font-weight: 600;
  margin-left: 0.5rem;
  font-size: 0.9em;
}

/* Delta Green SAN Loss - Make wrapper transparent to CSS Grid layout */
.delta-green-sanloss-section {
  display: contents;
}

/* Delta Green Skills grid styling */
.section-items .delta-green-skills-grid {
  grid-column: 1 / -1;
}

.delta-green-skills-grid {
  margin-top: 10px;
  width: 100%;
  columns: 320px;
  column-gap: 20px;
  column-fill: balance;
}

.delta-green-skills-grid.no-used-column {
  columns: 280px;
}

.skills-item {
  display: grid;
  grid-template-columns: 40px 1fr 80px;
  gap: 0;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0;
  margin-bottom: 2px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.delta-green-skills-grid.no-used-column .skills-item {
  grid-template-columns: 1fr 80px;
}

.skills-col-used,
.skills-col-name,
.skills-col-roll,
.skills-col-controls {
  padding: 8px 6px;
  display: flex;
  align-items: center;
}

.skills-col-used {
  justify-content: center;
  border-right: 1px solid var(--color-border);
}

.skills-col-name {
  justify-content: flex-start;
  border-right: 1px solid var(--color-border);
  font-weight: normal;
}

.skills-col-roll {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-right: 1px solid var(--color-border);
}

.skills-col-controls {
  justify-content: center;
  gap: 2px;
}

.skills-col-used input[type="checkbox"] {
  margin: 0;
  transform: scale(1.1);
}

.roll-display {
  font-family: 'Courier New', monospace;
  font-weight: 500;
}

.adjust-btn.small {
  width: 28px;
  height: 20px;
  font-size: 10px;
  margin: 0 1px;
  padding: 0;
}



/* Inline control layouts for compact numeric inputs */
.roll-inline-controls,
.score-inline-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.roll-input-inline,
.score-input-inline {
  width: 60px;
  text-align: center;
}



.show-empty-toggle {
  margin-bottom: 15px;
  padding: 10px;
  background-color: var(--color-surface-light);
  border-radius: 4px;
}

.show-empty-toggle label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
}

@media screen and (max-width: 768px) {
  .delta-green-skills-grid {
    columns: 1;
    column-gap: 0;
  }
  
  .skills-item {
    grid-template-columns: 30px 1fr 60px;
    font-size: 14px;
  }
  
  .delta-green-skills-grid.no-used-column .skills-item {
    grid-template-columns: 1fr 60px;
  }
  
  .skills-col-used,
  .skills-col-name,
  .skills-col-roll,
  .skills-col-controls {
    padding: 6px 4px;
  }
  
  .adjust-btn.small {
    width: 24px;
    height: 18px;
    font-size: 9px;
  }
  
}

/* Post-session upgrades button styling */
.section-items .post-session-upgrades {
  grid-column: 1 / -1;
}

.post-session-upgrades {
  margin-top: 15px;
  text-align: center;
}


/* Dice Roll Panel Styles */
.dice-roll-panel {
  position: fixed;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--color-shadow-strong);
  z-index: 1000;
  max-width: 400px;
  max-height: 500px;
  height: 500px;
  overflow: hidden;
  transition: transform 0.3s ease-in-out;
  will-change: transform;
  display: flex;
  flex-direction: column;
}

.dice-roll-panel.hidden {
  display: none;
}

.dice-roll-panel.visible {
  display: flex;
}

.dice-roll-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--color-surface-light);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.dice-roll-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--color-text);
}

.panel-close-button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--color-text);
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.panel-close-button:hover {
  background: var(--color-surface-light);
  color: var(--color-text);
}

.dice-roll-content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.dice-roll-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dice-roll-item {
  margin-bottom: 12px;
  padding: 8px;
  background: var(--color-surface-light);
  border-radius: 4px;
  border-left: 3px solid var(--color-primary);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.dice-roll-item.border-critical-success {
  border-left-color: var(--color-accent-critical-success);
}

.dice-roll-item.border-success {
  border-left-color: var(--color-accent-success);
}

.dice-roll-item.border-failure {
  border-left-color: var(--color-accent-failure);
}

.dice-roll-item.border-fumble {
  border-left-color: var(--color-accent-fumble);
}

.dice-roll-item.border-neutral {
  border-left-color: var(--color-accent-neutral);
}

.dice-roll-item.slide-in {
  animation: slide-in-from-top 0.4s ease-out;
}

@keyframes slide-in-from-top {
  0% {
    transform: translateY(-100%);
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
    max-height: 200px;
    margin-bottom: 12px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

.dice-roll-item p {
  margin: 0;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  white-space: pre-wrap;
  color: var(--color-text);
}

/* Formatted dice roll styles */

.roll-header {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.roll-result {
  margin-bottom: 4px;
  font-weight: 500;
}

.roll-details {
  font-size: 11px;
  color: var(--color-text-secondary);
  font-family: 'Courier New', monospace;
}

/* Grade styling */
.grade-critical-success {
  color: var(--color-accent-critical-success);
  font-weight: 600;
}

.grade-success {
  color: var(--color-accent-success);
  font-weight: 600;
}

.grade-failure {
  color: var(--color-accent-failure);
  font-weight: 600;
}

.grade-fumble {
  color: var(--color-accent-fumble);
  font-weight: 600;
}

.grade-neutral {
  color: var(--color-accent-neutral);
  font-weight: 500;
}

.no-rolls {
  text-align: center;
  color: var(--color-text-muted);
  font-style: italic;
  margin: 20px 0;
}

.dice-roll-toggle {
  position: fixed;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: var(--color-shadow-section);
  z-index: 999;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
  display: flex;
  align-items: center;
  justify-content: center;
}

.roll-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--color-danger);
  color: var(--color-text-inverse);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-surface);
  min-width: 18px;
}

.dice-roll-toggle:hover {
  background: var(--color-primary);
  box-shadow: var(--color-shadow-darker);
}

.dice-roll-toggle.shake {
  animation: shake 0.6s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
  20%, 40%, 60%, 80% { transform: translateX(3px); }
}

/* Desktop layout - panel slides from right */
@media screen and (width >= 769px) {
  .dice-roll-panel {
    right: 0;
    top: 50vh;
    transform: translateY(-50%) translateX(100%);
    width: 350px;
    height: 70vh;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
  }
  
  .dice-roll-panel.visible {
    transform: translateY(-50%) translateX(0);
  }
  
  .dice-roll-toggle {
    right: 20px;
    top: 50vh;
    transform: translateY(-50%);
  }
  
  .dice-roll-toggle.shake {
    animation: shake-desktop 0.6s ease-in-out;
  }
  
  @keyframes shake-desktop {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateY(-50%) translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateY(-50%) translateX(3px); }
  }
}

/* Mobile layout - panel slides from bottom */
@media screen and (width <= 768px) {
  .dice-roll-panel {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 60vh;
    max-height: 60vh;
    border-radius: 12px 12px 0 0;
    transform: translateY(100%);
    display: flex;
    flex-direction: column;
  }
  
  .dice-roll-panel.visible {
    transform: translateY(0);
  }
  
  .dice-roll-toggle {
    bottom: 20px;
    right: 20px;
  }
  
  .dice-roll-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
  }
}

/* Dice Roll Special Animations */

/* Panel Animations */
.panel-animation {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
  background: transparent;
}

/* Fireworks Animation for Panel */
.firework {
  position: absolute;
  font-size: 24px;
  animation: firework-explode 5s ease-out;
  text-shadow: var(--color-animation-firework-glow);
  filter: drop-shadow(var(--color-animation-firework-shadow));
}

.firework-1 { 
  left: 20%; 
  animation-delay: 0.2s; 
}

.firework-2 { 
  left: 80%; 
  animation-delay: 0.5s; 
}

.firework-3 { 
  left: 50%; 
  animation-delay: 0.8s; 
}

.firework-4 { 
  left: 70%; 
  animation-delay: 1.1s; 
}

.firework-5 { 
  left: 30%; 
  animation-delay: 1.4s; 
}

.firework-6 { 
  left: 90%; 
  animation-delay: 1.7s; 
}

.firework-7 { 
  left: 10%; 
  animation-delay: 2.0s; 
}

.firework-8 { 
  left: 60%; 
  animation-delay: 2.3s; 
}

@keyframes firework-explode {
  0% {
    top: 100%;
    opacity: 0;
    transform: scale(0.5);
  }

  20% {
    top: 30%;
    opacity: 1;
    transform: scale(1);
  }

  40% {
    top: 20%;
    opacity: 1;
    transform: scale(1.2) rotate(45deg);
  }

  60% {
    top: 10%;
    opacity: 0.8;
    transform: scale(1.5) rotate(90deg);
  }

  100% {
    top: 0%;
    opacity: 0;
    transform: scale(2) rotate(180deg);
  }
}

/* Skulls Animation for Panel */
.skull {
  position: absolute;
  font-size: 28px;
  animation: skull-fall 5s ease-in;
  text-shadow: var(--color-animation-skull-glow);
  filter: drop-shadow(var(--color-animation-skull-shadow));
}

.skull-1 { 
  left: 15%; 
  animation-delay: 0.3s; 
}

.skull-2 { 
  left: 85%; 
  animation-delay: 0.7s; 
}

.skull-3 { 
  left: 45%; 
  animation-delay: 1.1s; 
}

.skull-4 { 
  left: 75%; 
  animation-delay: 1.5s; 
}

.skull-5 { 
  left: 25%; 
  animation-delay: 1.9s; 
}

.skull-6 { 
  left: 65%; 
  animation-delay: 2.3s; 
}

@keyframes skull-fall {
  0% {
    top: -10%;
    opacity: 0;
    transform: rotate(0deg) scale(0.8);
  }

  20% {
    opacity: 1;
    transform: rotate(45deg) scale(1);
  }

  50% {
    top: 40%;
    opacity: 1;
    transform: rotate(180deg) scale(1.1);
  }

  80% {
    top: 80%;
    opacity: 0.7;
    transform: rotate(270deg) scale(0.9);
  }

  100% {
    top: 110%;
    opacity: 0;
    transform: rotate(360deg) scale(0.5);
  }
}

/* Button Animations */
.button-animation {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 50%;
  overflow: hidden;
}

/* Button Fireworks */
.button-firework {
  position: absolute;
  font-size: 12px;
  animation: button-firework-burst 5s ease-out;
}

.button-firework-1 { 
  top: 20%; 
  left: 20%; 
  animation-delay: 0.5s; 
}

.button-firework-2 { 
  top: 20%; 
  right: 20%; 
  animation-delay: 1s; 
}

.button-firework-3 { 
  bottom: 20%; 
  left: 20%; 
  animation-delay: 1.5s; 
}

.button-firework-4 { 
  bottom: 20%; 
  right: 20%; 
  animation-delay: 2s; 
}

@keyframes button-firework-burst {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }

  20% {
    opacity: 1;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.2) rotate(180deg);
  }

  80% {
    opacity: 0.6;
    transform: scale(1.5) rotate(270deg);
  }

  100% {
    opacity: 0;
    transform: scale(2) rotate(360deg);
  }
}

/* Button Skulls */
.button-skull {
  position: absolute;
  font-size: 14px;
  animation: button-skull-orbit 5s ease-in-out;
}

.button-skull-1 { 
  animation-delay: 0.5s; 
}

.button-skull-2 { 
  animation-delay: 1.5s; 
}

.button-skull-3 { 
  animation-delay: 2.5s; 
}

@keyframes button-skull-orbit {
  0% {
    top: 50%;
    left: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg) translateX(0) rotate(0deg);
  }

  25% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(90deg) translateX(20px) rotate(-90deg);
  }

  50% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(180deg) translateX(25px) rotate(-180deg);
  }

  75% {
    opacity: 0.7;
    transform: translate(-50%, -50%) rotate(270deg) translateX(20px) rotate(-270deg);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(360deg) translateX(0) rotate(-360deg);
  }
}

.dice-roll-list-container {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.simple-dice-buttons {
  flex-shrink: 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--color-border);
  background: inherit;
}

.dice-button-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.simple-dice-button {
  flex: 1;
  min-width: 40px;
  max-width: 60px;
  padding: 6px 4px;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface-light);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.simple-dice-button:hover {
  background: var(--color-surface-light);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.simple-dice-button:active {
  transform: translateY(0);
  background: var(--color-surface-medium);
}

/* Responsive adjustments */
@media (max-width <= 480px) {
  .dice-button-row {
    gap: 4px;
  }
  
  .simple-dice-button {
    min-width: 35px;
    max-width: 50px;
    padding: 4px 6px;
    font-size: 11px;
  }
}

/* Standard Button Classes */
.btn-standard {
  padding: var(--space-md) var(--space-lg);
  background-color: var(--color-action);
  color: var(--color-surface);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-standard:hover:not(:disabled) {
  background-color: var(--color-action-hover);
  transform: translateY(-1px);
}

.btn-standard:active {
  transform: translateY(0);
}

.btn-standard:disabled {
  background-color: var(--color-secondary);
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-standard:disabled:hover {
  background-color: var(--color-secondary);
  transform: none;
}

/* Danger Button Variant */
.btn-danger {
  padding: var(--space-md) var(--space-lg);
  background-color: var(--color-danger);
  color: var(--color-surface);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-danger:hover:not(:disabled) {
  background-color: var(--color-danger-hover);
  transform: translateY(-1px);
}

.btn-danger:active {
  transform: translateY(0);
}

.btn-danger:disabled {
  background-color: var(--color-secondary);
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-danger:disabled:hover {
  background-color: var(--color-secondary);
  transform: none;
}

/* Small Button Variant */
.btn-small,
.btn-standard.btn-small,
.btn-secondary.btn-small,
.btn-danger.btn-small {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
  min-height: 2.5em; /* Consistent height for all small buttons */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  vertical-align: top; /* Force top alignment for cross-browser consistency */
}

/* Large Button Variant */
.btn-large {
  padding: var(--space-lg) var(--space-xl);
  font-size: 1.125rem;
}

/* Secondary Button Variant */
.btn-secondary {
  padding: var(--space-md) var(--space-lg);
  background-color: var(--color-secondary);
  color: var(--color-surface);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--color-secondary-dark);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-secondary:disabled {
  background-color: var(--color-secondary);
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-secondary:disabled:hover {
  background-color: var(--color-secondary);
  transform: none;
}

/* Icon-only buttons (like info and edit icons) */
.btn-icon {
  background: none;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  padding: var(--space-xs);
  font-size: 0.8em;
  margin-left: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-icon:hover {
  background-color: var(--color-surface-light);
  color: var(--color-danger-hover);
}

.btn-icon:focus {
  background-color: var(--color-surface-light);
  color: var(--color-danger-hover);
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.btn-icon.info {
  color: var(--color-primary);
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.btn-icon.info:hover,
.btn-icon.info:focus {
  background: none;
  color: var(--color-primary-hover);
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.btn-icon.edit {
  font-size: 0.75rem;
  margin-left: var(--space-sm);
}


/* Button spacing */
.btn-standard,
.btn-danger,
.btn-secondary {
  margin: var(--space-xs);
}

/* Generic section edit form styles */
.section-items-edit {
  margin-top: 10px;
}

.section-item-edit {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background-color: var(--color-surface-light);
}

.section-item-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}

.section-item-content > textarea,
.section-item-content > .item-length-controls {
  grid-column: 1 / -1;
}

.item-length-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.section-item-edit input,
.section-item-edit textarea,
.section-item-edit select {
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: 3px;
}

.section-item-edit label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
}


/* Edit form buttons use browser defaults like Delta Green Stats */

/* Delta Green Weapons Section */
.section-items .weapons-note,
.section-items .weapons-table-container {
  grid-column: 1 / -1;
}

.weapons-note {
  font-style: italic;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
  padding: var(--space-xs);
  background: var(--color-surface-secondary);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-accent);
  font-size: 0.875rem;
  width: 100%;
  box-sizing: border-box;
  display: block;
  clear: both;
}

.weapons-table-container {
  overflow-x: auto;
  width: 100%;
  display: block;
  clear: both;
}

.weapons-table {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr 1.2fr 1fr 1.2fr 1fr 1fr;
  gap: 1px;
  background: var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  width: 100%;
}

.weapons-header {
  display: contents;
}

.weapons-header > div {
  background: var(--color-surface-secondary);
  padding: var(--space-xs);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.weapon-row {
  display: contents;
}

.weapon-row > div {
  background: var(--color-surface);
  padding: var(--space-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.weapon-col-name {
  justify-content: flex-start;
  font-weight: 500;
}

.weapon-col-ammo {
  justify-content: flex-end !important;
}

.weapon-name {
  font-weight: 500;
}

.weapon-skill,
.weapon-damage,
.weapon-lethality,
.weapon-ammo {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  justify-content: center;
}

/* Override section-items grid for bonds to take full width */
.section-items .bonds-container {
  grid-column: 1 / -1;
}

/* Bonds container for multiple rows */
.bonds-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

/* Individual bond row grid layout */
.bond-row {
  display: grid;
  grid-template-columns: min-content auto 1fr 1fr;
  gap: var(--space-xs) var(--space-sm);
  align-items: center;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
}

.bond-value {
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
  min-width: 2em;
}

.bond-name {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.bond-symptoms {
  font-style: italic;
  color: var(--color-text-secondary);
}

/* Highlighting for bonds with zero value - similar to disorder warning */
.bond-row.bond-item-zero {
  background-color: var(--color-accent-disorder1);
  box-shadow: inset 4px 0 0 var(--color-danger);
}

.bond-row.bond-item-zero .bond-value {
  font-weight: 600;
}

.no-skill {
  color: var(--color-text-secondary);
  font-style: italic;
}


/* Weapon edit form specific styling */
.weapon-edit-form .form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.weapon-edit-form .form-field label {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

/* Preset weapon selection styling */
.preset-weapon-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.preset-label {
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  min-width: fit-content;
}

.preset-select {
  flex: 1;
  min-width: 200px;
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.875rem;
}


/* Mobile responsive adjustments */
@media (width <= 768px) {
  .weapons-table {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .weapons-header {
    display: none;
  }

  .weapon-row {
    display: block;
    margin-bottom: var(--space-sm);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
  }

  .weapon-row > div {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-bottom: 1px solid var(--color-border);
    min-height: auto;
  }

  .weapon-row > div:last-child {
    border-bottom: none;
  }

  .weapon-row > div::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
    grid-column: 1;
  }

  .weapon-col-name::before,
  .weapon-col-skill::before,
  .weapon-col-range::before,
  .weapon-col-damage::before,
  .weapon-col-ap::before,
  .weapon-col-lethality::before,
  .weapon-col-radius::before,
  .weapon-col-ammo::before {
    content: attr(data-label);
  }

  .weapon-col-name,
  .weapon-col-skill,
  .weapon-col-range,
  .weapon-col-damage,
  .weapon-col-ap,
  .weapon-col-lethality,
  .weapon-col-radius,
  .weapon-col-ammo {
    justify-content: flex-start;
    text-align: left;
  }

  .weapon-col-name {
    grid-template-columns: 100px 1fr auto;
  }

  .weapon-col-name .weapon-name {
    grid-column: 2;
  }

  .weapon-col-name .btn-icon {
    grid-column: 3;
    margin-left: var(--space-xs);
  }
}

/* Dice Roll Modal */
.dice-roll-modal {
  background: var(--color-surface);
  border-radius: 8px;
  max-width: 500px;
  min-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--color-shadow-light);
  border: none;
  padding: 0;
  position: relative;
  margin: auto;
  top: 50%;
  transform: translateY(-50%);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 10px;
  border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  color: var(--color-text);
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--color-text);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-focus);
}

.form-help {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 5px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}


.roll-result-container {
  position: relative;
  text-align: center;
}

.roll-result-container h3 {
  margin: 0 0 20px;
}

.roll-result-container h3:not([class]) {
  color: var(--color-text);
}

/* Skill dice buttons */
.dice-button {
  background-color: var(--color-interactive-bg);
  border: 1px solid var(--color-interactive-border);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  margin-left: 8px;
  border-radius: 4px;
  transition: all 0.2s;
  color: var(--color-primary);
}

.dice-button:hover {
  background-color: var(--color-interactive-hover);
  border-color: var(--color-primary);
  transform: scale(1.1);
}

.dice-button:active {
  transform: scale(0.95);
  background-color: var(--color-interactive-active);
}

.dice-button:disabled {
  background-color: var(--color-muted-bg);
  border-color: var(--color-muted-border);
  color: var(--color-muted-text);
  cursor: not-allowed;
  opacity: 0.6;
}

.dice-button:disabled:hover {
  background-color: var(--color-muted-bg);
  border-color: var(--color-muted-border);
  transform: none;
}

/* Post-Session Upgrade Modal */
.post-session-upgrade-modal {
  background: var(--color-surface);
  border-radius: 8px;
  max-width: 600px;
  min-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--color-shadow-light);
  border: none;
  padding: 0;
  position: relative;
  margin: auto;
  top: 50%;
  transform: translateY(-50%);
}

.upgrade-instructions {
  background: var(--color-highlight-bg);
  border: 1px solid var(--color-highlight-border);
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 20px;
  font-style: italic;
  color: var(--color-text-secondary);
}

.skills-upgrade-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.skill-upgrade-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 15px;
  align-items: center;
  padding: 10px 15px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-background);
}

.skill-info h4 {
  margin: 0 0 5px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.current-value {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.upgrade-controls {
  display: flex;
  align-items: center;
}

.rolling-status {
  font-style: italic;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.rolling-status.error {
  color: var(--color-danger);
  font-weight: 500;
}


.upgrade-preview {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-success);
  text-align: right;
}

.upgrade-preview.at-maximum {
  color: var(--color-text-secondary);
  font-style: italic;
}

@media screen and (width <= 768px) {
  .post-session-upgrade-modal {
    min-width: unset;
    max-width: calc(100vw - 20px);
    width: calc(100vw - 20px);
  }
  
  .skill-upgrade-item {
    grid-template-columns: 1fr;
    gap: 10px;
    text-align: center;
  }
  
  .upgrade-controls {
    justify-content: center;
  }
  
  .roll-result {
    align-items: center;
  }
  
  .upgrade-preview {
    text-align: center;
  }
}


@media screen and (width <= 768px) {
  .dice-roll-modal {
    min-width: unset;
    max-width: calc(100vw - 20px);
    width: calc(100vw - 20px);
  }
  
  .modal-header {
    padding: 15px 15px 10px;
  }
  
  .modal-body {
    padding: 15px;
  }
  
  .dice-button {
    font-size: 14px;
    padding: 1px 4px;
    margin-left: 4px;
  }
}

/* Auto-populate section styling */
.auto-populate-section {
  margin-bottom: 20px;
  padding: 15px;
  border: 2px solid var(--color-primary);
  border-radius: 6px;
  background-color: var(--color-surface-light);
  box-shadow: var(--color-shadow-light);
}

.auto-populate-section h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  font-weight: 600;
}

.auto-populate-section h3::before {
  content: "⚡";
  margin-right: 8px;
  font-size: 1.2em;
}

.auto-populate-section p {
  margin-bottom: 15px;
  color: var(--color-text);
  font-style: italic;
}

.auto-populate-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.auto-populate-form select {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background-color: var(--color-surface);
  color: var(--color-text);
  font-size: 14px;
}


@media screen and (width <= 768px) {
  .auto-populate-form {
    flex-direction: column;
    align-items: stretch;
  }
  
  .auto-populate-form select {
    min-width: unset;
    margin-bottom: 10px;
  }
  
  .section-item-content {
    grid-template-columns: 1fr;
  }
  
  .section-item-edit {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}