.message_content {
  border: 1px solid silver;
  border-radius: 5px;
  box-shadow: var(--box-shadow-down);
}

#messages {
  font-family: 'Acme';


  .message {
    border-top: 1px solid var(--border);
    padding: 10px;
    min-height: 25px;
    overflow: hidden;

    &:hover {
      background-color: #ddd;
    }

    a {
      text-decoration: underline;

      &:hover {
        color: dodgerblue;
      }
    }

    .username {
      font-family: 'Acme';
      font-size: 1.3em;
      position: relative;
      color: #333;
      padding: 4px 5px;
      float: left;
      margin-right: 10px;
    }

    .created_at {
      float: right;
      font-size: .9em;
      color: #555;
      margin: 0 0 5px 5px;
    }

    .content {
      line-height: 120%;
      position: relative;
      top: -2px;
      font-size: 1em;
      word-wrap: break-word;
    }
  }
}

#messages {
  .new_message {
    display: flex;
    flex-wrap: wrap;
  }

  #message_content {
    margin: 10px 5px;
    flex-grow: 1;
  }

  .message_bottom {
    margin: 10px 5px;

    .direct {
      padding: 0 10px
    }
  }
}

#info_panel #messages {
  font-family: Arial, Helvetica, sans-serif;

  .new_message {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #d8e0e8;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(25, 48, 68, 0.04);
  }

  #message_content {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 9px 11px;
    border: 1px solid #bdcad5;
    border-radius: 7px;
    box-shadow: inset 0 1px 2px rgba(25, 48, 68, 0.06);

    &:focus-visible {
      border-color: #1686bb;
      outline: 2px solid #b8e4fa;
      outline-offset: 1px;
    }
  }

  .message_bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;

    .btn_link {
      padding: 8px 11px;
      border-color: #1686bb;
      border-radius: 7px;
      background: var(--btn-primary);
      color: #08354d;
      font-size: 15px;
      white-space: nowrap;
    }

    .direct {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 0;
      color: #647181;
      font: 13px 'Acme';
    }
  }

  .message {
    min-height: 0;
    margin-bottom: 6px;
    padding: 9px 10px;
    border: 1px solid #d8e0e8;
    border-radius: 8px;
    background: #fff;

    &:last-child {
      margin-bottom: 0;
    }

    &:hover {
      border-color: #bdd1df;
      background: #fbfdff;
    }

    .username {
      margin: 0 8px 0 0;
      padding: 3px 7px;
      border: 1px solid transparent;
      border-left-width: 3px;
      border-radius: 6px;
      background-image: none;
      color: #263746;
      font-size: 15px;
      line-height: 18px;
    }

    .username.player_1 {
      border-color: #9ddcf8;
      border-left-color: var(--player-1);
      background: #e8f7fd;
    }

    .username.player_2 {
      border-color: #f0b4ae;
      border-left-color: var(--player-2);
      background: #fcecea;
    }

    .created_at {
      color: #7b8793;
      font-size: 12px;
    }

    .content {
      top: 0;
      color: #34475a;
      font-size: 14px;
      line-height: 1.45;
    }
  }

  .no_data {
    margin: 8px;
    padding: 16px;
  }
}

@media (max-width: 520px) {
  #info_panel #messages {
    .new_message {
      grid-template-columns: 1fr;
    }

    .message_bottom {
      justify-content: space-between;
    }
  }
}

.profile_messages, #nav_direct_messages {
  .friend {
    .created_at {
      float: right;
      color: #888;
      font-size: .8em;
    }

    .username {
      font-size: 1.2em;
    }

    .content {
      margin: 7px 0 0 65px;
      color: #444;
      font-size: .8em;
      word-wrap: break-word;
    }
  }

  .list_item_wrap {
    .new {
      background: lightcyan;
      box-shadow: 0 2px 6px rgba(0, 0 ,0 ,.8);
      border-radius: 0;
    }
  }
}

.full_conversation {
  .convo_new_message {
    margin: 20px;
    max-width: 640px;
    padding: 18px;
    box-sizing: border-box;
    background: #f7f9fc;
    border: 1px solid #d5dce5;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);

    .conversation_header {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 8px 16px;
      margin-bottom: 14px;

      .page_subtitle {
        margin: 0;
      }

      .include {
        display: inline-flex;
        align-items: center;
        padding: 7px 11px;
        border: 1px solid #b9cedf;
        border-radius: 6px;
        background: #eaf4fc;
        color: #235a80;
        font-family: 'Acme';
        font-size: 14px;
        text-decoration: none;

        &:hover, &:focus-visible {
          background: #d7eaf8;
          border-color: #8db5d2;
        }
      }
    }

    .message_label {
      display: block;
      margin-bottom: 6px;
      color: #444;
      font-family: 'Acme';
    }

    .message_content {
      display: block;
      width: 100%;
      height: 80px;
      margin: 0;
      padding: 12px 14px;
      box-sizing: border-box;
      background: white;
      border-color: #aeb9c5;
      border-radius: 7px;
      box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
      font: 16px/1.4 Arial, Helvetica, sans-serif;
      resize: vertical;

      &:focus {
        outline: 2px solid var(--btn-primary);
        outline-offset: 2px;
      }
    }

    .actions {
      display: flex;
      justify-content: flex-end;
      margin-top: 12px;
    }
  }
  .conversation {
    margin: 10px;
    border-top: 1px solid silver;
  }

  .convo_list_item {
    padding: 8px;
    border-bottom: 1px solid silver;
    border-top: 1px solid #fff;
    min-height: 50px;
    position: relative;

    .online {
      position: absolute;
      top: 0;
      left: 0;
    }

    .avatar {
      float: left;
      margin-right:10px;
      margin-bottom: 4px;
    }

    .username {
      color: #111;
      display: inline-block;
    }

    .game {
      padding-left: 10px;
      font-size: .8em;
      color: steelblue;
    }

    .time {
      float: right;
      color: #888;
      font-size: .8em;
    }

    .content {
      color: #444;
      font-size: .8em;
      line-height: 120%;
      word-wrap: break-word;

      p {
        margin: 5px 0 0 65px;
      }

      a {
        text-decoration: underline;

        &:hover {
          color: dodgerblue;
        }
      }
    }
  }
}
