/* Base typography */

html {
  scrollbar-gutter: stable;
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}


/* Reset */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}


/* Body */

body {
  height: 100vh;
  overflow: hidden;

  font-family: var(--font-family-base);
  line-height: var(--line-height-base);
  color: var(--color-text-primary);
  background: var(--color-surface-base);
}


/* Buttons */

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: var(--font-weight-semibold);
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
}


/* App */

.app {
  display: flex;
  flex-direction: column;

  height: 100vh;

  font-weight: var(--font-weight-semibold);
}


/* Container */

.container {
  max-width: var(--app-max-width);
  margin: 0 auto;
  padding-inline: 24px;
}


/* Header */

header {
  flex-shrink: 0;
}

header .container {
  padding-top: 16px;
  padding-bottom: 28px;
}


.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.header-left {
  justify-self: start;
}

.header-center {
  justify-self: center;
}

.header-right {
  justify-self: end;
}


/* Logo */

.logo {
  cursor: pointer;
}

.logo img {
  height: 56px;
}


/* Language toggle */

.language-toggle {
  width: 116px;
  padding: 10px 0;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  text-align: center;
  color: var(--color-text-inverse);
  background: var(--color-accent-primary);
  transition: background 0.2s ease, transform 0.08s ease;
}

.language-toggle:hover {
  background: var(--color-accent-primary-hover);
}

.language-toggle:active {
  transform: scale(0.96);
}


/* Header icon */

.header-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  color: var(--icon-color-default);
  transition: color 0.15s ease;
}

.header-icon-btn svg {
  width: 24px;
  height: 24px;
}


/* Icon states */

.header-icon-btn.is-active {
  color: var(--icon-color-active);
}

.header-icon-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
  color: var(--color-text-disabled);
}


/* Hover only on real hover devices */

@media (hover: hover) and (pointer: fine) {

  .header-icon-btn:not(.is-active):not(.is-disabled):hover {
    color: var(--icon-color-hover);
  }

  .header-icon-btn.is-active:not(.is-disabled):hover {
    color: var(--icon-color-active-hover);
  }

}


/* Volume override */

.header-icon-btn.volume-btn.is-active {
  color: var(--color-warning);
}

@media (hover: hover) and (pointer: fine) {
  .header-icon-btn.volume-btn.is-active:hover {
    color: var(--color-warning-hover);
  }
}


/* Dice animation */

.header-icon-btn.is-spinning svg {
  animation: diceSpin 0.8s ease;
  pointer-events: none;
}


/* Main */

main {
  flex: 1;
  overflow-y: auto;
}

main::-webkit-scrollbar {
  width: 0;
  height: 0;
}

main {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;     /* Firefox */
}

main .container {
  padding-top: 0;
  padding-bottom: 0;
}


/* Cards */

.cards {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 84%;
  margin: 2px auto 0 auto;
}

.card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 2 / 1;
  border-radius: var(--radius-lg);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  background: var(--color-brand-surface);
  overflow: hidden;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.card span {
  position: relative;
  z-index: 2;
}


/* Desktop hover */

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    background: var(--color-brand-surface-hover);
    transform: translateY(-2px);
  }
}


/* Active */

.card:active {
  background: var(--color-brand-surface-hover);
  transform: translateY(0);
}


/* Card background icon */

.card-bg-icon {
  position: absolute;
  width: 84px;
  height: 84px;
  opacity: 0.08;
  stroke-width: 1.5;
  z-index: 1;
  pointer-events: none;
}


/* Disabled card */

.card.is-disabled {
  background: var(--color-surface-neutral);
  color: var(--color-text-disabled);
  cursor: not-allowed;
  pointer-events: none;
}

.card.is-disabled .card-bg-icon {
  opacity: 0.06;
}


/* Footer */

footer {
  flex-shrink: 0;
  font-size: var(--font-size-xs);
  text-align: center;
}

footer .container {
  padding-block: 24px;
}


/* Assistant FAB wrapper */

.assistant-fab-wrapper {
  position: fixed;

  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);

  width: 100%;
  max-width: var(--app-max-width);
  height: 68px;

  display: flex;
  justify-content: flex-end;
  align-items: center;

  pointer-events: none;
}


/* Assistant FAB */

.assistant-fab {
  margin-right: 24px;

  width: 68px;
  height: 68px;

  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--color-surface-base);
  box-shadow: var(--shadow-soft);

  color: var(--color-accent-primary);

  transition: transform 0.15s ease, box-shadow 0.2s ease;

  pointer-events: auto;
}

.assistant-fab svg {
  width: 32px;
  height: 32px;
}


@media (hover: hover) and (pointer: fine) {
  .assistant-fab:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-strong);
  }
}

.assistant-fab:active {
  transform: scale(0.95);
}


/* Animations */

@keyframes diceSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
