/* =========================================================
   Base & Reset
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background-color: #1f2632;
  color: #cee3e9;
  min-height: 100vh;
}

/* =========================================================
   CSS Variables (Design Tokens)
   ========================================================= */

:root {
  --color-bg: #1f2632;
  --color-card-bg: #323a49;
  --color-primary: #52ffa8;
  --color-text-main: #cee3e9;
  --color-text-muted: #9fb3c4;
  --color-pause-line: #4e5d73;

  --shadow-card: 0 20px 40px rgba(0, 0, 0, 0.35);
  --shadow-dice: 0 0 25px rgba(82, 255, 168, 0.75);

  --radius-card: 12px;
  --radius-button: 50%;

  --transition-fast: 150ms ease-out;
  --transition-med: 250ms ease-out;
}

/* =========================================================
   Layout principal
   ========================================================= */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;   /* IMPORTANTE: card em cima, botão embaixo */
  align-items: center;      /* centraliza horizontalmente */
  justify-content: center;  /* centraliza verticalmente */
  padding: 0 1.5rem;
}

/* =========================================================
   Advice Card
   ========================================================= */

.advice-card {
  position: relative;
  background-color: var(--color-card-bg);
  border-radius: var(--radius-card);
  padding: 2.5rem 1.75rem 3rem;
  text-align: center;
  max-width: 540px;
  width: 100%;
  box-shadow: var(--shadow-card);
}

/* Label "ADVICE #xxx" */

.advice-card__label {
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--color-primary);
  font-weight: 600;
  margin: 0 0 1.25rem;
}

.advice-card__id {
  margin-left: 0.25rem;
}

/* Texto principal */

.advice-card__text {
  margin: 0 0 1.75rem;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-text-main);
}

/* Divider */

.advice-card__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.advice-card__line {
  flex: 1;
  height: 1px;
  background-color: var(--color-pause-line);
}

.advice-card__pause {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.advice-card__pause-bar {
  width: 2px;
  height: 16px;
  border-radius: 999px;
  background-color: var(--color-pause-line);
}

/* Status (loading / error) */

.advice-card__status {
  margin: 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  min-height: 1em;
}

/* =========================================================
   Dice Button
   ========================================================= */

.advice-card__dice-button {
  position: relative;
  margin-top: -1.75rem; /* sobrepor o card */
  width: 64px;
  height: 64px;
  border-radius: var(--radius-button);
  border: none;
  background-color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-dice);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-med),
    background-color var(--transition-fast);
}

.advice-card__dice-icon {
  width: 24px;
  height: 24px;
  display: block;
}

/* Hover / Active */

.advice-card__dice-button:hover {
  box-shadow: 0 0 40px rgba(82, 255, 168, 0.9);
  transform: scale(1.05);
}

.advice-card__dice-button:active {
  transform: scale(0.98);
}

/* Focus (acessibilidade) */

.advice-card__dice-button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
}

/* Disabled / Loading */

.advice-card__dice-button[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
}

/* =========================================================
   Responsividade
   ========================================================= */

/* Mobile first já trata bem; vamos só refinar em telas maiores */

@media (min-width: 480px) {
  .advice-card {
    padding: 2.75rem 2.5rem 3.25rem;
  }

  .advice-card__text {
    font-size: 1.6rem;
  }
}

@media (min-width: 768px) {
  .app {
    padding: 0; /* mais espaço natural */
  }

  .advice-card {
    border-radius: 16px;
  }

  .advice-card__text {
    font-size: 1.7rem;
  }
}

/* Ultra wide: só garante que o card não estique demais */

@media (min-width: 1440px) {
  .advice-card {
    max-width: 600px;
  }
}