@layer tokens, utilities, components, animations;

/* app/static/css/tokens.css */
@layer tokens {
  @layer tokens {
    :root {
      --coin-scene-size: 150px;
      --coin-size: 120px;
      --coin-depth: 8px;
      --coin-shadow: 0 10px 18px rgba(0,0,0,.25);
      --dice-scene-size: 200px;
      --dice-size: 80px;
      --dice-depth: 40px;
      --dice-dot-size: 12px;
      --surface-white: #ffffff;
      --surface-gray-1: #e8e8e8;
      --surface-gray-2: #c0c0c0;
      --edge-gray: #999;
    }
  }
}

/* app/static/css/utilities.css */
@layer utilities {
  @layer utilities {
    .visually-hidden {
      position: absolute !important;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    .fp-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
      padding: 0.25rem 0.5rem;
      font-size: 0.875rem;
      font-weight: 600;
      line-height: 1;
      background: #fef9e7;
      color: #b8860b;
      border: 1px solid #f4d89f;
      border-radius: 0.375rem;
      white-space: nowrap;
    }
  }
}

/* app/static/style.css */
@layer components {
  :root {
    --game-primary: #007bff;
    --game-success: #28a745;
    --game-dark: #343a40;
  }
  .bg-primary-custom {
    background-color: #007bff !important;
  }
  body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  main {
    flex: 1;
  }
  .game-canvas {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
  }
  .game-canvas:hover {
    background-color: #e9ecef !important;
  }
  @media (max-width: 576px) {
    .display-4 {
      font-size: 2rem;
    }
    .game-canvas {
      min-height: 200px;
      padding: 2rem !important;
    }
  }
  @keyframes pulse {
    0% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.1);
    }
    100% {
      transform: scale(1);
    }
  }
  .badge {
    animation: pulse 0.3s ease;
  }
  .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
  }
  .table tbody tr {
    transition: background-color 0.2s ease;
  }
  .table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
  }
}

/* app/static/css/components/coin.css */
@layer components {
  @layer components {
    .coin-scene {
      width: var(--coin-scene-size);
      height: var(--coin-scene-size);
      perspective: 900px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .coin {
      width: var(--coin-size);
      height: var(--coin-size);
      position: relative;
      transform-style: preserve-3d;
    }
    .coin-face {
      position: absolute;
      inset: 0;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      backface-visibility: hidden;
      overflow: hidden;
      box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .15), inset 0 -10px 18px rgba(0, 0, 0, .25);
    }
    .coin-face::before {
      content: "";
      position: absolute;
      inset: 0;
      background-position: center center;
      background-size: cover;
      background-repeat: no-repeat;
      z-index: 1;
    }
    .coin-heads {
      background:
        radial-gradient(
          circle at 30% 25%,
          #ffd45a,
          #c9971a 70%,
          #8a6510 100%);
      transform: translateZ(var(--coin-depth));
    }
    .coin-heads::before {
      background-image: var(--coin-head-img);
    }
    .coin-tails {
      background:
        radial-gradient(
          circle at 30% 25%,
          #ffd45a,
          #b88413 70%,
          #75520b 100%);
      transform: rotateX(180deg) translateZ(var(--coin-depth));
    }
    .coin-tails::before {
      background-image: var(--coin-tail-img);
    }
    .coin[data-coin-type=chf] {
      --coin-head-img: url(/static/img/coin_head_chf.png);
      --coin-tail-img: url(/static/img/coin_tail_chf.png);
    }
    .coin[data-coin-type=penny] {
      --coin-head-img: url(/static/img/coin_head_penny.png);
      --coin-tail-img: url(/static/img/coin_tail_penny.png);
    }
    .coin::after {
      content: "";
      position: absolute;
      inset: -2px;
      border-radius: 50%;
      box-shadow: var(--coin-shadow);
      pointer-events: none;
    }
    .coin-mark {
      display: none;
    }
    .coin.rest-heads {
      transform: rotateX(0deg);
    }
    .coin.rest-tails {
      transform: rotateX(180deg);
    }
    .coin.is-flipping {
      animation: coinFlip 1050ms cubic-bezier(.18, .75, .18, 1.02) both;
    }
    .coin.is-flipping::before {
      content: "";
      position: absolute;
      inset: -6px;
      border-radius: 50%;
      background:
        linear-gradient(
          120deg,
          transparent 0%,
          rgba(255, 255, 255, .55) 40%,
          transparent 70%);
      transform: translateZ(20px);
      animation: shine 1050ms ease-out both;
      pointer-events: none;
      mix-blend-mode: screen;
    }
    @media (prefers-reduced-motion: reduce) {
      .coin.is-flipping {
        animation: none;
      }
      .coin.is-flipping::before {
        animation: none;
      }
    }
  }
}

/* app/static/css/components/dice.css */
@layer components {
  @layer components {
    .dice-scene {
      width: var(--dice-scene-size);
      height: var(--dice-scene-size);
      perspective: 1200px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .dice {
      width: var(--dice-size);
      height: var(--dice-size);
      position: relative;
      transform-style: preserve-3d;
      transition: transform 0.1s;
    }
    .dice-face {
      position: absolute;
      width: var(--dice-size);
      height: var(--dice-size);
      background:
        radial-gradient(
          circle at 30% 30%,
          var(--surface-white),
          var(--surface-gray-1) 70%,
          var(--surface-gray-2) 100%);
      border: 2px solid var(--edge-gray);
      border-radius: 12px;
      display: flex;
      flex-wrap: wrap;
      align-content: space-around;
      justify-content: space-around;
      padding: 8px;
      box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
    }
    .dice-face[data-side=front] {
      transform: rotateY(0deg) translateZ(calc(var(--dice-size) / 2));
    }
    .dice-face[data-side=back] {
      transform: rotateY(180deg) translateZ(calc(var(--dice-size) / 2));
    }
    .dice-face[data-side=right] {
      transform: rotateY(90deg) translateZ(calc(var(--dice-size) / 2));
    }
    .dice-face[data-side=left] {
      transform: rotateY(-90deg) translateZ(calc(var(--dice-size) / 2));
    }
    .dice-face[data-side=top] {
      transform: rotateX(90deg) translateZ(calc(var(--dice-size) / 2));
    }
    .dice-face[data-side=bottom] {
      transform: rotateX(-90deg) translateZ(calc(var(--dice-size) / 2));
    }
    .dice .dice-face {
      box-sizing: border-box;
      overflow: hidden;
      background-clip: padding-box;
      backface-visibility: hidden;
      -webkit-backface-visibility: hidden;
      will-change: transform, filter;
      box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
      display: block;
    }
    .dice .dice-face[data-face="6"] {
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-template-rows: repeat(3, 1fr);
      place-items: center;
      gap: 8px 12px;
      padding: 8px 12px;
    }
    .dice .dice-face[data-face="6"] .dot:nth-child(1) {
      grid-column: 1;
      grid-row: 1;
    }
    .dice .dice-face[data-face="6"] .dot:nth-child(2) {
      grid-column: 1;
      grid-row: 2;
    }
    .dice .dice-face[data-face="6"] .dot:nth-child(3) {
      grid-column: 1;
      grid-row: 3;
    }
    .dice .dice-face[data-face="6"] .dot:nth-child(4) {
      grid-column: 2;
      grid-row: 1;
    }
    .dice .dice-face[data-face="6"] .dot:nth-child(5) {
      grid-column: 2;
      grid-row: 2;
    }
    .dice .dice-face[data-face="6"] .dot:nth-child(6) {
      grid-column: 2;
      grid-row: 3;
    }
    .dice .dot {
      box-shadow: none;
      background: #333;
      z-index: 2;
      transform: translateZ(1px);
    }
    .dice .dice-face {
      border-radius: 12px;
      border: 2px solid var(--edge-gray);
    }
    .dot {
      width: var(--dice-dot-size);
      height: var(--dice-dot-size);
      background: #333;
      border-radius: 50%;
      box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    }
    .dice-face[data-face="1"] {
      display: flex;
      justify-content: center;
      align-content: center;
      align-items: center;
    }
    .dice-face[data-face="2"] {
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-template-rows: 1fr 1fr;
      padding: 12px;
    }
    .dice-face[data-face="2"] .dot:nth-child(1) {
      grid-column: 1;
      grid-row: 1;
      align-self: start;
      justify-self: start;
    }
    .dice-face[data-face="2"] .dot:nth-child(2) {
      grid-column: 2;
      grid-row: 2;
      align-self: end;
      justify-self: end;
    }
    .dice-face[data-face="3"] {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      grid-template-rows: 1fr 1fr 1fr;
      padding: 12px;
    }
    .dice-face[data-face="3"] .dot:nth-child(1) {
      grid-column: 1;
      grid-row: 1;
      align-self: start;
      justify-self: start;
    }
    .dice-face[data-face="3"] .dot:nth-child(2) {
      grid-column: 2;
      grid-row: 2;
      align-self: center;
      justify-self: center;
    }
    .dice-face[data-face="3"] .dot:nth-child(3) {
      grid-column: 3;
      grid-row: 3;
      align-self: end;
      justify-self: end;
    }
    .dice-face[data-face="4"] {
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-template-rows: 1fr 1fr;
      padding: 12px;
      gap: 0;
    }
    .dice-face[data-face="4"] .dot:nth-child(1) {
      grid-column: 1;
      grid-row: 1;
      align-self: start;
      justify-self: start;
    }
    .dice-face[data-face="4"] .dot:nth-child(2) {
      grid-column: 2;
      grid-row: 1;
      align-self: start;
      justify-self: end;
    }
    .dice-face[data-face="4"] .dot:nth-child(3) {
      grid-column: 1;
      grid-row: 2;
      align-self: end;
      justify-self: start;
    }
    .dice-face[data-face="4"] .dot:nth-child(4) {
      grid-column: 2;
      grid-row: 2;
      align-self: end;
      justify-self: end;
    }
    .dice-face[data-face="5"] {
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-template-rows: 1fr 1fr;
      padding: 12px;
      gap: 0;
    }
    .dice-face[data-face="5"] .dot:nth-child(1) {
      grid-column: 1;
      grid-row: 1;
      align-self: start;
      justify-self: start;
    }
    .dice-face[data-face="5"] .dot:nth-child(2) {
      grid-column: 2;
      grid-row: 1;
      align-self: start;
      justify-self: end;
    }
    .dice-face[data-face="5"] .dot:nth-child(3) {
      grid-column: 1 / 3;
      grid-row: 1 / 3;
      align-self: center;
      justify-self: center;
      z-index: 1;
    }
    .dice-face[data-face="5"] .dot:nth-child(4) {
      grid-column: 1;
      grid-row: 2;
      align-self: end;
      justify-self: start;
    }
    .dice-face[data-face="5"] .dot:nth-child(5) {
      grid-column: 2;
      grid-row: 2;
      align-self: end;
      justify-self: end;
    }
    .dice-preview .dice-face[data-face="6"] {
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-template-rows: repeat(3, 1fr);
      place-items: center;
      gap: 8px 12px;
      padding: 8px 12px;
    }
    .dice-preview .dice-face[data-face="6"] .dot:nth-child(1) {
      grid-column: 1;
      grid-row: 1;
    }
    .dice-preview .dice-face[data-face="6"] .dot:nth-child(2) {
      grid-column: 1;
      grid-row: 2;
    }
    .dice-preview .dice-face[data-face="6"] .dot:nth-child(3) {
      grid-column: 1;
      grid-row: 3;
    }
    .dice-preview .dice-face[data-face="6"] .dot:nth-child(4) {
      grid-column: 2;
      grid-row: 1;
    }
    .dice-preview .dice-face[data-face="6"] .dot:nth-child(5) {
      grid-column: 2;
      grid-row: 2;
    }
    .dice-preview .dice-face[data-face="6"] .dot:nth-child(6) {
      grid-column: 2;
      grid-row: 3;
    }
    .dice.rest-1 {
      transform: rotateX(0deg) rotateY(0deg);
    }
    .dice.rest-2 {
      transform: rotateX(-90deg) rotateY(0deg);
    }
    .dice.rest-3 {
      transform: rotateX(0deg) rotateY(90deg);
    }
    .dice.rest-4 {
      transform: rotateX(0deg) rotateY(-90deg);
    }
    .dice.rest-5 {
      transform: rotateX(90deg) rotateY(0deg);
    }
    .dice.rest-6 {
      transform: rotateX(0deg) rotateY(180deg);
    }
    .dice.is-rolling {
      animation: diceRoll 4000ms cubic-bezier(.18, .75, .18, 1.02) both;
    }
    .dice[data-animation-style=optionA].is-rolling {
      animation: diceRollOptionA 8000ms ease-out both;
    }
    .dice[data-animation-style=optionB].is-rolling {
      animation: diceRollOptionB 8000ms ease-out both;
    }
    .dice[data-animation-style=optionAD].is-rolling {
      animation: diceRollOptionAD 1500ms ease-out both;
    }
    @media (prefers-reduced-motion: reduce) {
      .dice.is-rolling {
        animation: none;
      }
    }
    .dice-result {
      text-align: center;
      margin-top: 2rem;
      font-size: 1.3rem;
      font-weight: 600;
      opacity: 0;
      transition: opacity 0.3s ease-in-out;
    }
    .dice-result.show {
      opacity: 1;
    }
  }
}

/* app/static/css/components/tools.css */
@layer components {
  @layer components {
    .tool-card {
      border: none;
      border-radius: 12px;
      overflow: hidden;
      transition: transform 0.2s, box-shadow 0.2s;
    }
    .tool-card:hover {
      transform: translateY(-4px);
      box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    }
    .tool-card-header {
      background:
        linear-gradient(
          135deg,
          #667eea 0%,
          #764ba2 100%);
      color: white;
      padding: 1.5rem;
      font-weight: 600;
      font-size: 1.1rem;
    }
    .tool-card-body {
      padding: 2rem;
    }
    .coin-container {
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 250px;
      perspective: 1000px;
    }
    .coin-result {
      text-align: center;
      margin-top: 2rem;
      font-size: 1.3rem;
      font-weight: 600;
      opacity: 0;
      transition: opacity 0.3s ease-in-out;
    }
    .coin-result.show {
      opacity: 1;
    }
    .btn-flip {
      width: 100%;
      padding: 0.75rem;
      font-size: 1rem;
      font-weight: 600;
    }
    .stats-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1rem;
      margin-top: 1rem;
    }
    .stat-box {
      background: #f8f9fa;
      padding: 1rem;
      border-radius: 8px;
      text-align: center;
    }
    .stat-label {
      font-size: 0.85rem;
      color: #6c757d;
      margin-bottom: 0.5rem;
    }
    .stat-value {
      font-size: 1.5rem;
      font-weight: bold;
      color: #495057;
    }
    .dice-container {
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 250px;
      perspective: 1200px;
    }
    .dice-result {
      text-align: center;
      margin-top: 2rem;
      font-size: 1.3rem;
      font-weight: 600;
      opacity: 0;
      transition: opacity 0.3s ease-in-out;
    }
    .dice-result.show {
      opacity: 1;
    }
  }
}

/* app/static/css/components/admin.css */
@layer components {
  .admin-navbar {
    background-color: #722f37 !important;
  }
  .admin-navbar .navbar-brand {
    color: rgba(255, 255, 255, 1) !important;
  }
  .admin-navbar .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
  }
  .admin-navbar .navbar-nav .nav-link:hover {
    color: white !important;
  }
  .admin-navbar .navbar-nav .dropdown-menu {
    background-color: #5a2630;
  }
  .admin-navbar .navbar-nav .dropdown-item {
    color: rgba(255, 255, 255, 0.8);
  }
  .admin-navbar .navbar-nav .dropdown-item:hover {
    background-color: #722f37;
    color: white;
  }
  .admin-navbar .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.8);
  }
  .admin-navbar .btn-outline-light:hover {
    border-color: white;
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
  }
  .admin-navbar .text-white-50 {
    color: rgba(255, 255, 255, 0.7) !important;
  }
}

/* app/static/css/components/invite.css */
@layer components {
  .invite-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    animation: fadeIn 0.2s ease-in-out;
  }
  .invite-modal-overlay.visible {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
  .invite-modal {
    display: none;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    animation: slideIn 0.3s ease-out;
    position: relative;
    z-index: 1051;
  }
  @media (max-width: 576px) {
    .invite-modal {
      max-height: 95vh;
      padding: 1.5rem 1rem;
    }
  }
  .invite-modal.visible {
    display: block;
  }
  @keyframes slideIn {
    from {
      transform: translateY(-20px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
  .invite-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 1rem;
  }
  .invite-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0;
  }
  .invite-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease-in-out;
  }
  .invite-modal-close:hover {
    background-color: #f0f0f0;
    color: #333;
  }
  .invite-modal-content {
    margin-bottom: 1.5rem;
  }
  .invite-modal-text {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 1rem;
  }
  .invite-modal-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
    color: #666;
  }
  .invite-modal-steps li {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    position: relative;
  }
  .invite-modal-steps li::before {
    content: attr(data-step);
    position: absolute;
    left: 0;
    width: 1.2rem;
    height: 1.2rem;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
  }
  .invite-code-container {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
    font-size: 0.85rem;
    color: #666;
  }
  .invite-code-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
  }
  .invite-code-label {
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
  }
  .invite-code {
    font-family:
      Monaco,
      "Courier New",
      monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: #007bff;
    letter-spacing: 2px;
    word-break: break-all;
    flex: 1;
    min-width: 0;
    user-select: all;
  }
  #copyCodeBtn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    flex-shrink: 0;
  }
  #copyCodeBtn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
  }
  #copyCodeBtn:active {
    transform: translateY(0);
  }
  #copyCodeBtn.copied {
    background-color: #28a745;
  }
  .invite-copy-btn.secondary {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #dee2e6;
  }
  .invite-copy-btn.secondary:hover {
    background-color: #e9ecef;
    color: #222;
  }
  .invite-link-container {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
    font-size: 0.85rem;
    color: #666;
  }
  .invite-link-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
  }
  .invite-link-label {
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
  }
  .invite-link {
    color: #007bff;
    text-decoration: none;
    word-break: break-all;
    flex: 1;
    min-width: 0;
  }
  .invite-link:hover {
    text-decoration: underline;
  }
  #copyLinkBtn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    flex-shrink: 0;
  }
  #copyLinkBtn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
  }
  #copyLinkBtn:active {
    transform: translateY(0);
  }
  #copyLinkBtn.copied {
    background-color: #28a745;
  }
  .invite-qr-container {
    background-color: #f8f9fa;
    border: 3px dashed #007bff;
    border-radius: 10px;
    padding: 1rem;
    margin: 1.25rem 0;
    text-align: center;
  }
  .invite-qr-label {
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
  }
  .invite-qr-canvas {
    width: 280px;
    height: 280px;
    max-width: 75vw;
    max-height: 75vw;
    margin: 0 auto;
    display: block;
  }
  .invite-qr-helper {
    margin-top: 0.75rem;
    color: #666;
    font-size: 0.9rem;
  }
  @media (max-width: 576px) {
    .invite-qr-canvas {
      width: 240px;
      height: 240px;
    }
  }
  .invite-share-container {
    display: flex;
    gap: 0.75rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
    justify-content: center;
  }
  .invite-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .invite-share-btn.primary {
    background-color: #007bff;
    color: white;
  }
  .invite-share-btn.primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
  }
  .invite-share-btn.primary:active {
    transform: translateY(0);
  }
  .invite-share-btn.secondary {
    background-color: #25d366;
    color: white;
    border: none;
  }
  .invite-share-btn.secondary:hover {
    background-color: #20ba5a;
    transform: translateY(-2px);
  }
  .invite-share-btn.secondary:active {
    transform: translateY(0);
  }
  .invite-share-btn .bi {
    font-size: 1rem;
  }
  @media (max-width: 576px) {
    .invite-share-container {
      flex-direction: column;
    }
    .invite-share-btn {
      width: 100%;
      justify-content: center;
    }
  }
  .invite-modal-footer {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    border-top: 2px solid #f0f0f0;
    padding-top: 1rem;
  }
  .invite-modal-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
  }
  .invite-modal-btn.primary {
    background-color: #007bff;
    color: white;
  }
  .invite-modal-btn.primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
  }
  .invite-modal-btn.primary:active {
    transform: translateY(0);
  }
  .invite-modal-btn.secondary {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #dee2e6;
  }
  .invite-modal-btn.secondary:hover {
    background-color: #e9ecef;
  }
  .friends-list {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
  }
  .friend-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease-in-out;
  }
  .friend-card:hover {
    border-color: #007bff;
    background-color: #fff;
  }
  .friend-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
  }
  .friend-info {
    flex: 1;
    min-width: 0;
  }
  .friend-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    overflow-wrap: break-word;
  }
  .friend-username {
    font-size: 0.85rem;
    color: #999;
    overflow-wrap: break-word;
  }
  .friend-meta {
    font-size: 0.8rem;
    color: #999;
  }
  .invite-loading {
    text-align: center;
    padding: 2rem;
  }
  .invite-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
  @keyframes spin {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
  .invite-status-message {
    display: none;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-weight: 500;
  }
  .invite-status-message.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
  }
  .invite-status-message.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
  }
  .invite-status-message.warning {
    display: block;
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
  }
  .invite-success-page {
    text-align: center;
    padding: 2rem 1rem;
  }
  .invite-success-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
  }
  .invite-success-heading {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.75rem;
  }
  .invite-success-text {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.5;
  }
  .invite-success-details {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }
  .invite-inviter-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
  }
  .invite-inviter-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background:
      linear-gradient(
        135deg,
        #667eea 0%,
        #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    flex-shrink: 0;
  }
  .invite-inviter-details {
    flex: 1;
  }
  .invite-inviter-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
  }
  .invite-inviter-label {
    font-size: 0.8rem;
    color: #999;
  }
  .invite-error-page {
    text-align: center;
    padding: 2rem 1rem;
  }
  .invite-error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
  }
  .invite-error-heading {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.75rem;
  }
  .invite-error-text {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.5;
  }
  .invite-error-code {
    font-family:
      Monaco,
      "Courier New",
      monospace;
    font-size: 0.9rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem;
    margin: 1rem 0;
    word-break: break-all;
    color: #666;
  }
  @media (max-width: 576px) {
    .invite-modal {
      width: 95%;
      padding: 1.5rem;
    }
    .invite-modal-title {
      font-size: 1.25rem;
    }
    .invite-code {
      font-size: 1.25rem;
    }
    .invite-share-options {
      flex-direction: column;
    }
    .invite-share-btn {
      min-width: auto;
    }
    .invite-modal-footer {
      flex-direction: column;
    }
    .invite-success-page,
    .invite-error-page {
      padding: 1.5rem 1rem;
    }
    .invite-success-heading,
    .invite-error-heading {
      font-size: 1.5rem;
    }
  }
}

/* app/static/css/components/auth-modal.css */
@layer components {
  :root {
    --auth-modal-max-width: 450px;
    --auth-modal-padding: 32px;
    --auth-modal-padding-mobile: 20px;
    --auth-modal-border-radius: 12px;
    --auth-modal-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --auth-modal-backdrop: rgba(0, 0, 0, 0.5);
  }
  .auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--auth-modal-backdrop);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  .auth-modal-overlay-visible {
    opacity: 1;
    visibility: visible;
  }
  .auth-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 100%;
    max-width: var(--auth-modal-max-width);
    max-height: 90vh;
    background: white;
    border-radius: var(--auth-modal-border-radius);
    box-shadow: var(--auth-modal-shadow);
    z-index: 1050;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin: 0;
  }
  .auth-modal-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
  }
  .auth-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
  }
  .auth-modal-close:hover {
    background: #f5f5f5;
    color: #333;
  }
  .auth-modal-close:active {
    background: #e8e8e8;
  }
  .auth-modal-content {
    padding: var(--auth-modal-padding);
  }
  @media (max-width: 576px) {
    .auth-modal-content {
      padding: var(--auth-modal-padding-mobile);
    }
  }
  .auth-modal-header {
    text-align: center;
    margin-bottom: 28px;
  }
  #authModalTitle {
    font-size: 26px;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px;
    line-height: 1.2;
  }
  .auth-modal-subtitle {
    font-size: 14px;
    color: #666;
    margin: 8px 0 0;
    line-height: 1.5;
  }
  @media (max-width: 576px) {
    #authModalTitle {
      font-size: 22px;
    }
    .auth-modal-subtitle {
      font-size: 13px;
    }
  }
  .auth-modal-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .auth-modal-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    height: 44px;
    border-radius: var(--auth-modal-border-radius);
    border: 1px solid #e0e0e0;
    background: white;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
  }
  .auth-modal-button:hover {
    background: #f8f9fa;
    border-color: #ccc;
    text-decoration: none;
    color: #333;
  }
  .auth-modal-button:active {
    transform: scale(0.98);
  }
  .auth-modal-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
  }
  .auth-modal-button-google {
    border-color: #dadce0;
    margin-bottom: 4px;
  }
  .auth-modal-button-google:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  }
  .auth-modal-button-primary {
    background: #007bff;
    border-color: #007bff;
    color: white;
    margin-top: 8px;
  }
  .auth-modal-button-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
    color: white;
  }
  .auth-modal-button-primary:disabled {
    background: #ccc;
    border-color: #ccc;
  }
  .auth-modal-button-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
  .auth-modal-divider {
    position: relative;
    margin: 16px 0 12px;
    text-align: center;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .auth-modal-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
  }
  .auth-modal-divider span {
    background: white;
    padding: 0 8px;
    position: relative;
    z-index: 1;
  }
  .auth-modal-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .auth-modal-form .form-group {
    margin: 0;
  }
  .auth-modal-form .form-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    display: block;
  }
  .auth-modal-input {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    font-family: inherit;
  }
  .auth-modal-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
  }
  .auth-modal-input::placeholder {
    color: #999;
  }
  .form-text-muted {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    display: block;
  }
  .spinner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .spinner i {
    animation: spin 0.8s linear infinite;
  }
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
  .alert {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 13px;
    margin: 0;
  }
  .alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
  }
  .alert small {
    display: block;
    line-height: 1.4;
  }
  .auth-modal-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
  }
  .auth-modal-footer small {
    color: #999;
    font-size: 12px;
  }
  .auth-modal-footer a {
    color: #007bff;
    text-decoration: none;
  }
  .auth-modal-footer a:hover {
    color: #0056b3;
    text-decoration: underline;
  }
  @media (max-width: 576px) {
    :root {
      --auth-modal-max-width: calc(100% - 32px);
    }
    .auth-modal {
      max-height: calc(100vh - 40px);
    }
    .auth-modal-button {
      height: 40px;
      padding: 10px 14px;
      font-size: 13px;
    }
    .auth-modal-input {
      padding: 9px 11px;
      font-size: 16px;
    }
    #authModalTitle {
      font-size: 20px;
    }
    .auth-modal-header {
      margin-bottom: 20px;
    }
    .auth-modal-options {
      gap: 10px;
    }
    .auth-modal-divider {
      margin: 12px 0 8px;
    }
    .auth-modal-close {
      width: 32px;
      height: 32px;
      font-size: 20px;
    }
  }
}

/* app/static/css/components/daily-reward.css */
@layer components {
  :root {
    --daily-reward-max-width: 400px;
    --daily-reward-padding: 32px;
    --daily-reward-border-radius: 16px;
    --daily-reward-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    --daily-reward-backdrop: rgba(0, 0, 0, 0.6);
  }
  .daily-reward-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--daily-reward-backdrop);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  .daily-reward-overlay-visible {
    opacity: 1;
    visibility: visible;
  }
  .daily-reward-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: var(--daily-reward-max-width);
    background:
      linear-gradient(
        135deg,
        #ffffff 0%,
        #f8f9fa 100%);
    border-radius: var(--daily-reward-border-radius);
    box-shadow: var(--daily-reward-shadow);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.3s ease,
      transform 0.3s ease,
      visibility 0.3s ease;
  }
  .daily-reward-modal-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
  }
  .daily-reward-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #6c757d;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
  }
  .daily-reward-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
  }
  .daily-reward-header {
    padding: var(--daily-reward-padding);
    padding-bottom: 16px;
    border-bottom: 2px solid #e9ecef;
  }
  .daily-reward-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    text-align: center;
  }
  .daily-reward-content {
    padding: var(--daily-reward-padding);
    text-align: center;
  }
  .streak-display {
    margin-bottom: 24px;
  }
  .streak-icon {
    font-size: 48px;
    margin-bottom: 8px;
  }
  .streak-count {
    font-size: 36px;
    font-weight: 700;
    color: #ff6b35;
    margin-bottom: 4px;
  }
  .streak-label {
    font-size: 14px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
  }
  .reward-preview {
    margin-bottom: 24px;
    padding: 20px;
    background:
      linear-gradient(
        135deg,
        #ffd700 0%,
        #ffed4e 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
  }
  .reward-label {
    margin: 0 0 8px;
    font-size: 14px;
    color: #333;
    font-weight: 600;
  }
  .reward-amount {
    font-size: 42px;
    font-weight: 800;
    color: #ff6b35;
    margin: 8px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  }
  .reward-detail {
    font-size: 14px;
    color: #666;
  }
  .btn-claim {
    width: 100%;
    padding: 16px;
    background:
      linear-gradient(
        135deg,
        #ff6b35 0%,
        #ff8c61 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
    margin-bottom: 16px;
  }
  .btn-claim:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.5);
  }
  .btn-claim:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
  .already-claimed {
    padding: 24px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 16px;
  }
  .checkmark {
    font-size: 64px;
    color: #28a745;
    margin-bottom: 16px;
  }
  .claimed-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
  }
  .claimed-detail {
    font-size: 18px;
    color: #ff6b35;
    font-weight: 600;
    margin-bottom: 8px;
  }
  .next-claim {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
  }
  .longest-streak {
    font-size: 14px;
    color: #6c757d;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
  }
  .celebration {
    text-align: center;
    padding: 24px 0;
  }
  .confetti-container {
    position: relative;
    height: 80px;
    margin-bottom: 24px;
  }
  .confetti {
    position: absolute;
    font-size: 32px;
    animation: confetti-fall 2s ease-out forwards;
  }
  .confetti:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
  }
  .confetti:nth-child(2) {
    left: 30%;
    animation-delay: 0.2s;
  }
  .confetti:nth-child(3) {
    left: 60%;
    animation-delay: 0.4s;
  }
  .confetti:nth-child(4) {
    left: 85%;
    animation-delay: 0.6s;
  }
  @keyframes confetti-fall {
    0% {
      top: -20px;
      opacity: 1;
      transform: rotate(0deg);
    }
    100% {
      top: 80px;
      opacity: 0;
      transform: rotate(360deg);
    }
  }
  .celebration-title {
    font-size: 48px;
    font-weight: 800;
    color: #ff6b35;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: celebration-bounce 0.6s ease-out;
  }
  .celebration-streak {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
  }
  .celebration-record {
    font-size: 18px;
    font-weight: 700;
    color: #ffd700;
    margin: 8px 0;
    animation: celebration-pulse 1s ease-in-out infinite;
  }
  @keyframes celebration-bounce {
    0%, 100% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.1);
    }
  }
  @keyframes celebration-pulse {
    0%, 100% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.05);
    }
  }
  .btn-secondary {
    padding: 12px 32px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
  }
  .btn-secondary:hover {
    background: #5a6268;
  }
  .balance-increase {
    animation: balance-increase 0.6s ease-out;
  }
  @keyframes balance-increase {
    0%, 100% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.2);
      color: #28a745;
    }
  }
  .error-message {
    padding: 12px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 8px;
    font-size: 14px;
  }
  #dailyRewardIndicator {
    background: #ff6b35;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    margin-left: 4px;
    animation: badge-pulse 2s ease-in-out infinite;
  }
  @keyframes badge-pulse {
    0%, 100% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.1);
    }
  }
  @media (max-width: 480px) {
    .daily-reward-modal {
      width: 95%;
    }
    .daily-reward-header,
    .daily-reward-content {
      padding: 24px 20px;
    }
    .reward-amount {
      font-size: 36px;
    }
    .celebration-title {
      font-size: 40px;
    }
  }
}

/* app/static/css/components/achievements.css */
@layer components {
  .achievement-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .achievement-toast-content .achievement-icon {
    font-size: 2rem;
    line-height: 1;
  }
  .toast-item.achievement-toast {
  }
  .achievement-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  .achievement-modal-overlay.show {
    opacity: 1;
    visibility: visible;
  }
  .achievement-modal {
    background: white;
    padding: 2rem 2.5rem;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  }
  .achievement-modal-overlay.show .achievement-modal {
    transform: scale(1);
  }
  .achievement-modal-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
    animation: achievement-icon-bounce 0.6s ease 0.3s both;
  }
  @keyframes achievement-icon-bounce {
    0% {
      transform: scale(0.5);
      opacity: 0;
    }
    50% {
      transform: scale(1.2);
    }
    100% {
      transform: scale(1);
      opacity: 1;
    }
  }
  .achievement-modal h2 {
    font-size: 1.25rem;
    color: var(--bs-secondary, #6c757d);
    margin-bottom: 0.5rem;
    font-weight: 500;
  }
  .achievement-modal h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--bs-dark, #212529);
  }
  .achievement-modal p {
    font-size: 1rem;
    color: var(--bs-secondary, #6c757d);
    margin-bottom: 1rem;
  }
  .achievement-modal-points {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--bs-success, #198754);
    margin: 1rem 0;
    text-shadow: 0 0 8px rgba(var(--bs-success-rgb, 25, 135, 84), 0.3);
  }
  .achievement-modal .btn {
    min-width: 140px;
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    animation: achievement-btn-pulse 2s ease-in-out infinite;
  }
  @keyframes achievement-btn-pulse {
    0%, 100% {
      box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb, 13, 110, 253), 0.4);
    }
    50% {
      box-shadow: 0 0 0 8px rgba(var(--bs-primary-rgb, 13, 110, 253), 0);
    }
  }
  @media (prefers-color-scheme: dark) {
    .achievement-modal {
      background: var(--bs-dark, #212529);
      color: var(--bs-light, #f8f9fa);
    }
    .achievement-modal h3 {
      color: var(--bs-light, #f8f9fa);
    }
    .achievement-modal h2,
    .achievement-modal p {
      color: var(--bs-gray-400, #ced4da);
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .achievement-modal-overlay,
    .achievement-modal {
      transition: none;
    }
    .achievement-modal-icon {
      animation: none;
    }
    .achievement-modal .btn {
      animation: none;
    }
  }
}

/* app/static/css/components/toast.css */
@layer components {
  .toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
  }
  .toast-item {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.95rem;
    line-height: 1.4;
    overflow-wrap: break-word;
    white-space: normal;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  .toast-item span {
    flex: 1;
    min-width: 0;
    margin-right: 8px;
    overflow-wrap: break-word;
  }
  .toast-item .btn-close {
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s ease;
  }
  .toast-item .btn-close:hover {
    opacity: 1;
  }
  .toast-item.toast-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border-left: 4px solid #198754;
  }
  .toast-item.toast-danger {
    background-color: #f8d7da;
    color: #842029;
    border-left: 4px solid #dc3545;
  }
  .toast-item.toast-warning {
    background-color: #fff3cd;
    color: #664d03;
    border-left: 4px solid #ffc107;
  }
  .toast-item.toast-info {
    background-color: #cfe2ff;
    color: #084298;
    border-left: 4px solid #0d6efd;
  }
  .toast-item.fade-in {
    animation: toastSlideIn 0.3s ease forwards;
  }
  .toast-item.fade-out {
    animation: toastSlideOut 0.3s ease forwards;
  }
  @keyframes toastSlideIn {
    from {
      opacity: 0;
      transform: translateX(100%);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
  @keyframes toastSlideOut {
    from {
      opacity: 1;
      transform: translateX(0) scale(1);
    }
    to {
      opacity: 0;
      transform: translateX(100%) scale(0.9);
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .toast-item.fade-in,
    .toast-item.fade-out {
      animation: none;
      transition: opacity 0.2s ease;
    }
    .toast-item.fade-in {
      opacity: 1;
      transform: none;
    }
    .toast-item.fade-out {
      opacity: 0;
      transform: none;
    }
    .toast-fp-icon,
    .toast-fp-amount {
      animation: none !important;
    }
  }
  .toast-item:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(13, 110, 253, 0.25);
  }
  .toast-item:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 3px;
  }
  .toast-container-positioned {
    position: fixed;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
    z-index: 9999;
  }
  .toast-container-positioned .toast-item {
    pointer-events: auto;
  }
  .toast-item .btn-close:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
    opacity: 1;
  }
  @media (max-width: 576px) {
    .toast-container {
      left: 10px;
      right: 10px;
      max-width: calc(100vw - 20px);
    }
    .toast-item {
      font-size: 0.9rem;
      padding: 10px 14px;
      max-width: 100%;
    }
    .toast-container-positioned {
      max-width: calc(100vw - 20px);
    }
  }
  .toast-item.toast-fp {
    background:
      linear-gradient(
        135deg,
        #ffc107 0%,
        #ff9800 50%,
        #f57c00 100%);
    color: #1a1a1a;
    border: none;
    border-left: 4px solid #e65100;
    font-weight: 600;
    gap: 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
  }
  .toast-fp-icon {
    font-size: 1.4em;
    margin-right: 4px;
    flex-shrink: 0;
    animation: coinBounce 0.5s ease-out;
  }
  .toast-fp-amount {
    font-size: 1.1em;
    font-weight: 700;
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    animation: fpAmountPop 0.4s ease-out 0.1s both;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .toast-fp-label {
    font-size: 0.85em;
    font-weight: 500;
    color: #333;
    opacity: 0.9;
    margin-left: 4px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .toast-item.toast-fp .btn-close {
    filter: none;
  }
  @keyframes coinBounce {
    0%, 100% {
      transform: translateY(0);
    }
    25% {
      transform: translateY(-5px);
    }
    50% {
      transform: translateY(2px);
    }
    75% {
      transform: translateY(-2px);
    }
  }
  @keyframes fpAmountPop {
    0% {
      transform: scale(0.5);
      opacity: 0;
    }
    50% {
      transform: scale(1.2);
    }
    100% {
      transform: scale(1);
      opacity: 1;
    }
  }
}

/* app/static/css/animations.css */
@layer animations {
  @layer animations {
    @keyframes coinFlip {
      0% {
        transform: translateY(0) rotateX(0deg) rotateZ(0deg);
      }
      16% {
        transform: translateY(-95px) rotateX(360deg) rotateZ(8deg);
      }
      70% {
        transform: translateY(-95px) rotateX(calc(var(--flip-rot) - 240deg)) rotateZ(-10deg);
      }
      88% {
        transform: translateY(6px) rotateX(calc(var(--flip-rot) + 16deg)) rotateZ(3deg);
      }
      100% {
        transform: translateY(0) rotateX(var(--flip-rot)) rotateZ(0deg);
      }
    }
    @keyframes shine {
      0% {
        opacity: 0;
        transform: translateZ(20px) translateX(-30px);
      }
      30% {
        opacity: .9;
      }
      100% {
        opacity: 0;
        transform: translateZ(20px) translateX(40px);
      }
    }
    @keyframes diceRoll {
      0% {
        transform: translateY(0) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
      }
      15% {
        transform: translateY(-120px) rotateX(180deg) rotateY(180deg) rotateZ(45deg);
      }
      65% {
        transform: translateY(-120px) rotateX(var(--roll-x)) rotateY(var(--roll-y)) rotateZ(var(--roll-z));
      }
      85% {
        transform: translateY(2px) rotateX(var(--final-x)) rotateY(var(--final-y)) rotateZ(calc(var(--final-z, 0deg) + 2deg));
      }
      100% {
        transform: translateY(0) rotateX(var(--final-x)) rotateY(var(--final-y)) rotateZ(var(--final-z, 0deg));
      }
    }
    @keyframes diceRollOptionA {
      0% {
        transform: translateY(0) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
      }
      15% {
        transform: translateY(-120px) rotateX(180deg) rotateY(180deg) rotateZ(45deg);
      }
      50% {
        transform: translateY(-90px) rotateX(var(--roll-x)) rotateY(var(--roll-y)) rotateZ(var(--roll-z));
      }
      75% {
        transform: translateY(-30px) rotateX(var(--final-x)) rotateY(var(--final-y)) rotateZ(calc(var(--final-z, 0deg) + 3deg));
      }
      100% {
        transform: translateY(0) rotateX(var(--final-x)) rotateY(var(--final-y)) rotateZ(var(--final-z, 0deg));
      }
    }
    @keyframes diceRollOptionB {
      0% {
        transform: translateY(0) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
      }
      15% {
        transform: translateY(-120px) rotateX(180deg) rotateY(180deg) rotateZ(45deg);
      }
      65% {
        transform: translateY(-120px) rotateX(var(--roll-x)) rotateY(var(--roll-y)) rotateZ(var(--roll-z));
      }
      85% {
        transform: translateY(2px) rotateX(var(--final-x)) rotateY(var(--final-y)) rotateZ(calc(var(--final-z, 0deg) + 2deg));
      }
      100% {
        transform: translateY(0) rotateX(var(--final-x)) rotateY(var(--final-y)) rotateZ(var(--final-z, 0deg));
      }
    }
    @keyframes diceRollOptionAD {
      0% {
        transform: translateY(0) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
      }
      50% {
        transform: translateY(0) rotateX(var(--roll-x)) rotateY(var(--roll-y)) rotateZ(var(--roll-z));
      }
      75% {
        transform: translateY(0) rotateX(calc(var(--roll-x) * 0.5 + var(--final-x) * 0.5)) rotateY(calc(var(--roll-y) * 0.5 + var(--final-y) * 0.5)) rotateZ(calc(var(--roll-z) * 0.5 + var(--final-z, 0deg) * 0.5));
      }
      100% {
        transform: translateY(0) rotateX(var(--final-x)) rotateY(var(--final-y)) rotateZ(var(--final-z, 0deg));
      }
    }
  }
}

/* app/static/css/bundle-base.css */
