// Chat Message Card Styles - Applied globally for chat messages
.chat-log .message-content {
  .prismrpg-chat-card {
    font-family: var(--font-primary);
    border-radius: 6px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.02) 100%);
    border: 1px solid rgba(0,0,0,0.2);
    margin: 2px 0;

  .chat-header {
    display: flex;
    gap: 8px;
    padding: 6px 8px;
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    border-bottom: 1px solid #444;

    .chat-portrait {
      flex-shrink: 0;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      overflow: hidden;
      border: 2px solid #666;
      box-shadow: 0 1px 4px rgba(0,0,0,0.4);

      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }

    .chat-title {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 2px;

      .actor-name {
        font-weight: bold;
        font-size: 0.95em;
        color: #e0e0e0;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
        line-height: 1.1;
      }

      .roll-name {
        font-size: 0.8em;
        color: #aaa;
        line-height: 1.1;
      }

      .roll-type-badge {
        display: inline-block;
        padding: 1px 6px;
        border-radius: 10px;
        font-size: 0.7em;
        font-weight: bold;
        text-transform: uppercase;
        margin-top: 2px;
        width: fit-content;

        &.attack {
          background: linear-gradient(135deg, #c41e3a 0%, #8b0000 100%);
          color: white;
          box-shadow: 0 1px 2px rgba(196, 30, 58, 0.4);
        }
      }

      .bad-result {
        color: #ff6b6b;
        font-size: 0.75em;
        margin-top: 1px;
      }
    }
  }

  .chat-content {
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;

    .weapon-info-card,
    .spell-info-card {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 4px;
      padding: 6px;

      .weapon-header,
      .spell-header {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 4px;
        padding-bottom: 4px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);

        .weapon-name,
        .spell-name {
          font-size: 0.95em;
          color: #d4af37;
        }

        .badge {
          padding: 1px 4px;
          border-radius: 3px;
          font-size: 0.65em;
          font-weight: bold;
          text-transform: uppercase;

          &.implement {
            background: #4a5cf7;
            color: white;
          }

          &.upcast {
            background: #9b59b6;
            color: white;
          }
        }

        .attribute-used {
          font-size: 0.75em;
          color: #999;
          font-style: italic;
        }
      }

      .weapon-stats,
      .spell-stats {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;

        .stat-item {
          display: flex;
          align-items: center;
          gap: 3px;
          padding: 2px 6px;
          background: rgba(0, 0, 0, 0.2);
          border-radius: 3px;
          font-size: 0.75em;

          i {
            color: #888;
            font-size: 0.85em;
          }

          &.apc {
            background: rgba(255, 193, 7, 0.2);
            border: 1px solid rgba(255, 193, 7, 0.4);
            i { color: #ffc107; }
          }

          &.damage {
            background: rgba(244, 67, 54, 0.2);
            border: 1px solid rgba(244, 67, 54, 0.4);
            i { color: #f44336; }
          }

          &.range {
            background: rgba(76, 175, 80, 0.2);
            border: 1px solid rgba(76, 175, 80, 0.4);
            i { color: #4caf50; }
          }

          &.reload {
            background: rgba(255, 152, 0, 0.2);
            border: 1px solid rgba(255, 152, 0, 0.4);
            i { color: #ff9800; }
          }

          &.mana {
            background: rgba(33, 150, 243, 0.2);
            border: 1px solid rgba(33, 150, 243, 0.4);
            i { color: #2196f3; }
          }

          &.upkeep {
            background: rgba(156, 39, 176, 0.2);
            border: 1px solid rgba(156, 39, 176, 0.4);
            i { color: #9c27b0; }
          }

          &.characteristic {
            background: rgba(103, 58, 183, 0.2);
            border: 1px solid rgba(103, 58, 183, 0.4);
            i { color: #673ab7; }
          }
        }
      }
    }

    .special-badge {
      display: inline-block;
      padding: 2px 6px;
      background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%);
      color: white;
      border-radius: 3px;
      font-size: 0.75em;
      font-weight: bold;
      width: fit-content;
      box-shadow: 0 1px 2px rgba(255, 107, 107, 0.4);
    }

    .aiming-info {
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 3px 6px;
      background: rgba(76, 175, 80, 0.1);
      border-left: 2px solid #4caf50;
      border-radius: 3px;
      font-size: 0.8em;

      i {
        color: #4caf50;
      }
    }

    .formula-display {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 4px 8px;
      background: rgba(0, 0, 0, 0.3);
      border-radius: 3px;
      font-family: 'Courier New', monospace;
      font-size: 0.85em;
      border: 1px dashed rgba(255, 255, 255, 0.2);

      i {
        color: #888;
      }
    }

    .modifier-info {
      display: flex;
      gap: 8px;
      padding: 3px 6px;
      background: rgba(255, 255, 255, 0.05);
      border-radius: 3px;
      font-size: 0.75em;

      span {
        color: #aaa;
      }
    }

    .dice-breakdown {
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 2px 6px;
      background: rgba(255, 255, 255, 0.05);
      border-radius: 3px;
      font-size: 0.8em;

      i {
        color: #888;
      }
    }

    .roll-damage-button {
      padding: 4px 10px;
      background: linear-gradient(135deg, #c41e3a 0%, #8b0000 100%);
      color: white;
      border: none;
      border-radius: 4px;
      font-weight: bold;
      font-size: 0.85em;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 6px;
      justify-content: center;
      transition: all 0.2s;
      box-shadow: 0 1px 3px rgba(196, 30, 58, 0.4);
      margin-top: 4px;

      &:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(196, 30, 58, 0.6);
      }

      i {
        font-size: 1em;
      }
    }
  }

  .roll-result {
    padding: 8px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(212, 175, 55, 0.1) 100%);
    border-top: 1px solid rgba(212, 175, 55, 0.5);

    .result-total {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;

      .total-label {
        font-size: 0.85em;
        color: #aaa;
        text-transform: uppercase;
        letter-spacing: 0.5px;
      }

      .total-value {
        font-size: 1.8em;
        font-weight: bold;
        color: #d4af37;
        text-shadow: 0 1px 3px rgba(212, 175, 55, 0.5);
        line-height: 1;
      }
    }

    .d30-result {
      margin-top: 4px;
      padding: 3px 6px;
      background: rgba(0, 0, 0, 0.2);
      border-radius: 3px;
      font-size: 0.8em;
      text-align: center;

      i {
        color: #d4af37;
        margin-right: 4px;
      }
    }
  }

  .result-badge {
    padding: 6px;
    text-align: center;
    font-size: 0.9em;
    font-weight: bold;
    border-top: 1px solid;

    &.success {
      background: linear-gradient(135deg, rgba(76, 175, 80, 0.3) 0%, rgba(76, 175, 80, 0.1) 100%);
      border-color: #4caf50;
      color: #4caf50;
    }

    &.failure {
      background: linear-gradient(135deg, rgba(244, 67, 54, 0.3) 0%, rgba(244, 67, 54, 0.1) 100%);
      border-color: #f44336;
      color: #f44336;
    }

    i {
      margin-right: 6px;
      font-size: 1em;
    }
  }

  .damage-info {
    padding: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    font-size: 0.8em;
    color: #aaa;
  }
}

// Old fortune and ask-roll styles
&.fortune {
  img {
    border: 0px;
  }
  .intro-chat {
    border-radius: 20px;
    display: flex;
    flex-direction: row;
    .intro-img {
      padding: 5px;
      width: 80px;
      align-self: center;
    }
    .intro-right {
      display: flex;
      flex-direction: column;
      .introText {
        font-family: var(--font-secondary);
        font-size: calc(var(--font-size-standard) * 1.2);
        width: 210px;
        text-align: center;
      }
    }
  }
  .button.control,
  .fortune-accepted {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: calc(var(--font-size-standard) * 1.3);
  }
}

&.ask-roll {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-secondary);
  font-size: calc(var(--font-size-standard) * 1.2);
}

// Item Chat Card Styles
.prismrpg-item-chat-card {
  font-family: var(--font-primary);
  border-radius: 4px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.02) 100%);
  border: 1px solid rgba(0,0,0,0.2);
  margin: 2px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);

  .item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    border-bottom: 1px solid #444;

    h3 {
      margin: 0;
      font-size: 0.95em;
      font-weight: bold;
      color: #d4af37;
      text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
      font-family: var(--font-secondary);
    }

    .item-type {
      padding: 1px 6px;
      border-radius: 10px;
      font-size: 0.65em;
      font-weight: bold;
      text-transform: uppercase;
      background: rgba(255, 255, 255, 0.15);
      color: #fff;
      border: 1px solid rgba(255, 255, 255, 0.2);
      letter-spacing: 0.3px;
    }
  }

  .item-image {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);

    img {
      max-width: 50px;
      max-height: 50px;
      border-radius: 3px;
      border: 1px solid rgba(212, 175, 55, 0.3);
      box-shadow: 0 1px 3px rgba(0,0,0,0.3);
      transition: transform 0.2s ease;

      &:hover {
        transform: scale(1.05);
      }
    }
  }

  .item-description {
    padding: 6px 8px;
    color: #000;
    font-size: 0.8em;
    line-height: 1.3;
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-style: italic;
  }

  .item-details {
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;

    .item-detail {
      display: flex;
      align-items: center;
      padding: 2px 6px;
      background: rgba(255, 255, 255, 0.03);
      border-left: 2px solid rgba(212, 175, 55, 0.5);
      border-radius: 2px;
      font-size: 0.8em;

      strong {
        color: #d4af37;
        margin-right: 6px;
        min-width: 90px;
        font-weight: bold;
      }

      &:nth-child(even) {
        background: rgba(0, 0, 0, 0.05);
      }
    }
  }

  // Special styling for weapon items
  &.weapon-item {
    .item-header {
      background: linear-gradient(135deg, #c41e3a 0%, #8b0000 100%);
    }
  }

  // Special styling for armor items
  &.armor-item {
    .item-header {
      background: linear-gradient(135deg, #4a5cf7 0%, #2c3e9e 100%);
    }
  }

  // Special styling for spell items
  &.spell-item {
    .item-header {
      background: linear-gradient(135deg, #9b59b6 0%, #6c3483 100%);
    }
  }

  // Special styling for skill items
  &.skill-item {
    .item-header {
      background: linear-gradient(135deg, #16a085 0%, #0e6655 100%);
    }
  }

  // Special styling for equipment items
  &.equipment-item {
    .item-header {
      background: linear-gradient(135deg, #f39c12 0%, #b8730f 100%);
    }
  }
}
}


// New round message
.new-round-message {
  .chat-title .new-round-label {
    font-size: var(--font-size-11);
    font-style: italic;
    color: #8a7a5a;
    margin-top: 1px;
  }

  .new-round-actors {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 0 2px;

    .new-round-restore-btn {
      display: flex;
      align-items: center;
      gap: 6px;
      width: calc(50% - 3px);
      padding: 4px 8px 4px 6px;
      border: 1px solid #7a6a45;
      border-radius: 4px;
      background: linear-gradient(135deg, #f5e6c8 0%, #e8d5a0 100%);
      cursor: pointer;
      font-size: var(--font-size-13);
      color: #3a2e1a;
      overflow: hidden;

      span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
      }

      img {
        flex-shrink: 0;
        width: 24px;
        height: 24px;
        border: none;
        border-radius: 3px;
        object-fit: cover;
      }

      &:hover:not(:disabled) {
        background: linear-gradient(135deg, #fdf3dc 0%, #f0e0b0 100%);
        border-color: #a08040;
      }

      &:disabled,
      &.restored {
        opacity: 0.45;
        cursor: default;
      }
    }

    .new-round-all-btn {
      width: 100%;
      background: linear-gradient(135deg, #c8dff5 0%, #a0c0e8 100%);
      border-color: #4a6a8a;
      color: #1a2e3a;
      font-weight: bold;

      &:hover:not(:disabled) {
        background: linear-gradient(135deg, #dcedfc 0%, #b0d0f0 100%);
        border-color: #3a5a7a;
      }
    }
  }
}

// Token HUD — separator between Afflictions and Imbuements
.status-separator {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  height: 2px;
  border: none;
  border-top: 2px solid rgba(255, 255, 255, 0.35);
  margin: 5px 0;
}
