@layer components {
  .gw-header {
    background-color: var(--gw-color-background);
    border-block-end: 1px solid var(--gw-color-border);
    position: sticky;
    inset-block-start: 0;
    z-index: 100;
    box-shadow: var(--gw-shadow-sm);
  }

  .gw-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-block: var(--gw-space-md);
  }

  .gw-logo {
    font-size: var(--gw-font-size-lg);
    font-weight: 700;
    color: var(--gw-color-primary);
  }

  .gw-nav__toggle {
    display: none;
    flex-direction: column;
    gap: 0.375rem;
    padding: var(--gw-space-sm);
  }

  .gw-nav__toggle-line {
    inline-size: 1.5rem;
    block-size: 0.125rem;
    background-color: var(--gw-color-text);
    transition: transform var(--gw-transition-fast);
  }

  .gw-nav__list {
    display: flex;
    gap: var(--gw-space-lg);
    align-items: center;
  }

  .gw-nav__link {
    font-weight: 700;
    transition: color var(--gw-transition-fast);
  }

  .gw-nav__link:hover {
    color: var(--gw-color-primary);
  }

  .gw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-inline: var(--gw-space-lg);
    padding-block: var(--gw-space-md);
    border-radius: var(--gw-radius-full);
    font-weight: 700;
    transition: all var(--gw-transition-base);
    text-align: center;
  }

  .gw-btn--primary {
    background-color: var(--gw-color-primary);
    color: white;
  }

  .gw-btn--primary:hover {
    background-color: var(--gw-color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--gw-shadow-md);
  }

  .gw-btn--secondary {
    background-color: var(--gw-color-surface);
    color: var(--gw-color-text);
    border: 2px solid var(--gw-color-border);
  }

  .gw-btn--secondary:hover {
    border-color: var(--gw-color-primary);
    color: var(--gw-color-primary);
  }

  .gw-btn--outline {
    background-color: transparent;
    color: var(--gw-color-primary);
    border: 2px solid var(--gw-color-primary);
  }

  .gw-btn--outline:hover {
    background-color: var(--gw-color-primary);
    color: white;
  }

  .gw-hero {
    background-color: var(--gw-color-background);
    background-image: url('../../img/bcg.png');
    background-size: cover;
    background-position: center;
    padding-block: var(--gw-space-3xl) var(--gw-space-2xl);
  }

  .gw-hero__content {
    display: flex;
    flex-direction: column;
    gap: var(--gw-space-xl);
    align-items: center;
  }

  @media (min-width: 900px) {
    .gw-hero__content {
      flex-direction: row;
      justify-content: space-between;
      gap: var(--gw-space-2xl);
    }
  }

  .gw-hero__text-content {
    flex: 1;
    max-width: 600px;
  }

  .gw-hero__title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--gw-color-primary);
    margin-block-end: var(--gw-space-lg);
  }

  .gw-hero__description {
    font-size: var(--gw-font-size-lg);
    color: var(--gw-color-primary);
    margin-block-end: var(--gw-space-xl);
    font-weight: 600;
    line-height: 1.5;
  }

  .gw-hero__actions {
    display: flex;
    gap: var(--gw-space-md);
    flex-wrap: wrap;
  }

  .gw-hero__image-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .gw-hero__image {
    max-width: 100%;
    height: auto;
  }

  .gw-card {
    background-color: var(--gw-color-surface);
    border-radius: var(--gw-radius-md);
    padding: var(--gw-space-lg);
    box-shadow: var(--gw-shadow-sm);
    transition: transform var(--gw-transition-base), box-shadow var(--gw-transition-base);
  }

  .gw-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--gw-shadow-lg);
  }

  .gw-card__image {
    inline-size: 100%;
    border-radius: var(--gw-radius-sm);
    margin-block-end: var(--gw-space-md);
  }

  .gw-card__title {
    font-size: var(--gw-font-size-lg);
    font-weight: 700;
    margin-block-end: var(--gw-space-sm);
  }

  .gw-card__description {
    color: var(--gw-color-text-muted);
  }

  .gw-game-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gw-space-lg);
    padding: var(--gw-space-lg);
    background-color: var(--gw-color-surface);
    border-radius: var(--gw-radius-md);
    box-shadow: var(--gw-shadow-sm);
    margin-block-end: var(--gw-space-md);
  }

  .gw-game-item__rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 3rem;
    block-size: 3rem;
    background-color: var(--gw-color-primary);
    color: white;
    border-radius: var(--gw-radius-sm);
    font-size: var(--gw-font-size-xl);
    font-weight: 700;
  }

  .gw-game-item__image {
    inline-size: 100%;
    border-radius: var(--gw-radius-sm);
  }

  .gw-game-item__title {
    font-size: var(--gw-font-size-xl);
    font-weight: 700;
    margin-block-end: var(--gw-space-sm);
  }

  .gw-game-item__info {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gw-space-md);
    margin-block: var(--gw-space-md);
  }

  .gw-game-item__badge {
    padding-inline: var(--gw-space-md);
    padding-block: var(--gw-space-xs);
    background-color: var(--gw-color-surface);
    color: var(--gw-color-primary);
    border-radius: var(--gw-radius-full);
    font-size: var(--gw-font-size-sm);
    font-weight: 700;
  }

  .gw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--gw-space-lg);
  }

  .gw-icon-box {
    text-align: center;
    padding: var(--gw-space-lg);
  }

  .gw-icon-box__icon {
    inline-size: 4rem;
    block-size: 4rem;
    margin-inline: auto;
    margin-block-end: var(--gw-space-md);
    background-color: var(--gw-color-surface);
    border-radius: var(--gw-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .gw-icon-box__title {
    font-size: var(--gw-font-size-lg);
    font-weight: 700;
    margin-block-end: var(--gw-space-sm);
  }

  .gw-accordion__item {
    border: 1px solid var(--gw-color-border);
    border-radius: var(--gw-radius-sm);
    margin-block-end: var(--gw-space-sm);
    overflow: hidden;
  }

  .gw-accordion__trigger {
    inline-size: 100%;
    text-align: start;
    padding: var(--gw-space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    background-color: white;
    transition: background-color var(--gw-transition-fast);
  }

  .gw-accordion__trigger:hover {
    background-color: var(--gw-color-surface);
  }

  .gw-accordion__trigger[aria-expanded="true"] .gw-accordion__icon {
    transform: rotate(180deg);
  }

  .gw-accordion__icon {
    transition: transform var(--gw-transition-base);
  }

  .gw-accordion__panel {
    padding: 0 var(--gw-space-lg) var(--gw-space-lg);
  }

  .gw-accordion__panel[hidden] {
    display: none;
  }

  .gw-form {
    display: flex;
    flex-direction: column;
    gap: var(--gw-space-md);
  }

  .gw-form__group {
    display: flex;
    flex-direction: column;
    gap: var(--gw-space-sm);
  }

  .gw-form__label {
    font-weight: 700;
  }

  .gw-form__input,
  .gw-form__textarea {
    padding: var(--gw-space-md);
    border: 2px solid var(--gw-color-border);
    border-radius: var(--gw-radius-sm);
    transition: border-color var(--gw-transition-fast);
  }

  .gw-form__input:focus,
  .gw-form__textarea:focus {
    outline: none;
    border-color: var(--gw-color-primary);
  }

  .gw-form__input--error,
  .gw-form__textarea--error {
    border-color: var(--gw-color-error);
  }

  .gw-form__error {
    color: var(--gw-color-error);
    font-size: var(--gw-font-size-sm);
  }

  .gw-form__checkbox-wrapper {
    display: flex;
    gap: var(--gw-space-sm);
    align-items: flex-start;
  }

  .gw-footer {
    background-color: white;
    color: var(--gw-color-primary);
    padding-block: var(--gw-space-xl);
    margin-block-start: var(--gw-space-2xl);
  }

  .gw-footer__grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gw-space-xl);
    margin-block-end: var(--gw-space-xl);
    justify-content: space-between;
  }

  .gw-footer__title {
    font-size: var(--gw-font-size-xl);
    font-weight: 700;
    margin-block-end: var(--gw-space-md);
    color: var(--gw-color-primary);
  }

  .gw-footer__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gw-space-md) var(--gw-space-xl);
  }

  .gw-footer__link {
    color: var(--gw-color-primary);
    font-weight: 700;
    transition: opacity var(--gw-transition-fast);
  }

  .gw-footer__link:hover {
    opacity: 0.7;
  }

  .gw-footer__bottom {
    padding-block-start: var(--gw-space-lg);
    border-block-start: 1px solid var(--gw-color-primary);
    text-align: center;
    font-weight: 700;
  }

  .gw-cookie-banner {
    position: fixed;
    inset-block-end: 0;
    inset-inline: 0;
    background-color: white;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    padding: var(--gw-space-lg);
    z-index: 200;
    transform: translateY(100%);
    transition: transform var(--gw-transition-base);
  }

  .gw-cookie-banner.is-visible {
    transform: translateY(0);
  }

  .gw-cookie-banner__content {
    display: flex;
    flex-direction: column;
    gap: var(--gw-space-md);
  }

  .gw-cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gw-space-sm);
  }

  .gw-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--gw-space-md);
  }

  .gw-modal.is-open {
    display: flex;
  }

  .gw-modal__backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
  }

  .gw-modal__content {
    position: relative;
    background-color: white;
    border-radius: var(--gw-radius-lg);
    padding: var(--gw-space-xl);
    max-inline-size: 600px;
    inline-size: 100%;
    max-block-size: 90vh;
    overflow-y: auto;
  }

  .gw-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-block-end: var(--gw-space-lg);
  }

  .gw-modal__title {
    font-size: var(--gw-font-size-xl);
    font-weight: 700;
  }

  .gw-modal__close {
    inline-size: 2rem;
    block-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--gw-radius-sm);
    transition: background-color var(--gw-transition-fast);
  }

  .gw-modal__close:hover {
    background-color: var(--gw-color-surface);
  }

  .gw-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: var(--gw-space-md);
  }

  .gw-toggle__switch {
    position: relative;
    inline-size: 3rem;
    block-size: 1.5rem;
    background-color: var(--gw-color-border);
    border-radius: var(--gw-radius-full);
    transition: background-color var(--gw-transition-fast);
    cursor: pointer;
  }

  .gw-toggle__switch::after {
    content: "";
    position: absolute;
    inset-block-start: 0.125rem;
    inset-inline-start: 0.125rem;
    inline-size: 1.25rem;
    block-size: 1.25rem;
    background-color: white;
    border-radius: 50%;
    transition: transform var(--gw-transition-fast);
  }

  .gw-toggle__input:checked + .gw-toggle__switch {
    background-color: var(--gw-color-primary);
  }

  .gw-toggle__input:checked + .gw-toggle__switch::after {
    transform: translateX(1.5rem);
  }

  .gw-toggle__input:disabled + .gw-toggle__switch {
    opacity: 0.5;
    cursor: not-allowed;
  }

  /* Auth Modals */
  .gw-auth-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--gw-space-md);
  }

  .gw-auth-modal {
    background-color: var(--gw-color-background);
    border-radius: var(--gw-radius-lg);
    padding: var(--gw-space-lg);
    width: 100%;
    max-width: 480px;
    position: relative;
    box-shadow: var(--gw-shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
  }

  .gw-auth-modal__close {
    position: absolute;
    top: var(--gw-space-sm);
    right: var(--gw-space-sm);
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gw-color-text-muted);
  }

  .gw-auth-modal__title {
    font-size: var(--gw-font-size-lg);
    margin-bottom: var(--gw-space-md);
    text-align: center;
  }

  .gw-auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--gw-space-md);
  }

  .gw-auth-form__group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .gw-auth-input {
    padding: 0.75rem;
    border: 1px solid var(--gw-color-border);
    border-radius: var(--gw-radius-sm);
    font-size: 1rem;
    width: 100%;
  }

  .gw-auth-modal__footer {
    text-align: center;
    margin-top: var(--gw-space-sm);
    font-size: var(--gw-font-size-sm);
  }

  .gw-profile-header {
    display: flex;
    justify-content: center;
    margin-bottom: var(--gw-space-md);
  }

  .gw-profile-avatar {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--gw-color-surface);
    border: 2px solid var(--gw-color-primary);
  }

  .gw-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .gw-profile-avatar input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
  }

  .gw-profile-actions {
    display: flex;
    gap: var(--gw-space-sm);
    justify-content: space-between;
  }

  @media (min-width: 768px) {
    .gw-hero__content {
      grid-template-columns: 1fr 1fr;
    }

    .gw-game-item {
      grid-template-columns: auto 200px 1fr auto;
      align-items: center;
    }

    .gw-cookie-banner__content {
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
    }
  }

  @media (max-width: 767px) {
    .gw-nav__toggle {
      display: flex;
    }

    .gw-nav__list {
      position: absolute;
      top: 100%;
      left: 0;
      width: 100%;
      flex-direction: column;
      background-color: white;
      padding: var(--gw-space-lg);
      box-shadow: var(--gw-shadow-lg);
      z-index: 1000;
      
      display: none;
    }

    .gw-nav.is-open .gw-nav__list {
      display: flex;
    }

    .gw-nav.is-open .gw-nav__toggle-line:nth-child(1) {
      transform: rotate(45deg) translateY(0.5rem);
    }

    .gw-nav.is-open .gw-nav__toggle-line:nth-child(2) {
      opacity: 0;
    }

    .gw-nav.is-open .gw-nav__toggle-line:nth-child(3) {
      transform: rotate(-45deg) translateY(-0.5rem);
    }
  }
}
