:root {
  color-scheme: dark;
  --ink: #f3e7c4;
  --muted: #c1b394;
  --surface: #1a1a21;
  --panel: #111118;
  --border: #29262f;
  --accent: #f2b96b;
  --pop: #58cc02;
  --shadow: rgba(8, 8, 12, 0.6);
  --radius: 14px;
  --bg: linear-gradient(180deg, #151418 0%, #101014 60%, #0c0b10 100%);
  --card: #1a1a21;
  --input-bg: #1a1a21;
  --button-bg: #1a1a21;
  --button-hover: #24242c;
  --tab-active: #24242c;
  --question-bg: #1a1a21;
  --field-bg: #1a1a21;
  --chip-bg: #24242c;
  --chip-border: #3b3941;
  --chip-hover: #2b2a33;
  --font: "Lexend", "Segoe UI", sans-serif;
  --word-font: 15px;
  --word-pad-x: 12px;
  --word-pad-y: 8px;
  --word-gap: 10px;
  --word-min-height: 32px;
  --success-bg: #1f2c27;
  --success-border: #7bc4a8;
  --error-bg: #2a2025;
  --error-border: #d5907a;
  --success-text: #7bc4a8;
  --error-text: #d5907a;
  --scrollbar-track: color-mix(in srgb, var(--panel) 82%, #0b0f16);
  --scrollbar-thumb: color-mix(in srgb, var(--accent) 52%, var(--chip-border));
  --scrollbar-thumb-hover: color-mix(in srgb, var(--accent) 68%, #fff);
  --scrollbar-thumb-active: color-mix(in srgb, var(--accent) 80%, #fff);
}

.word-size-small {
  --word-font: 15px;
  --word-pad-x: 12px;
  --word-pad-y: 8px;
  --word-gap: 10px;
  --word-min-height: 32px;
}

.word-size-medium {
  --word-font: 17px;
  --word-pad-x: 14px;
  --word-pad-y: 10px;
  --word-gap: 10px;
  --word-min-height: 36px;
}

.word-size-large {
  --word-font: 19px;
  --word-pad-x: 16px;
  --word-pad-y: 12px;
  --word-gap: 12px;
  --word-min-height: 40px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
}

*::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid var(--scrollbar-track);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--scrollbar-thumb) 90%, #fff),
    color-mix(in srgb, var(--scrollbar-thumb) 95%, #0b0f16)
  );
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--scrollbar-thumb-hover) 92%, #fff),
    color-mix(in srgb, var(--scrollbar-thumb-hover) 95%, #0b0f16)
  );
}

*::-webkit-scrollbar-thumb:active {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--scrollbar-thumb-active) 92%, #fff),
    color-mix(in srgb, var(--scrollbar-thumb-active) 95%, #0b0f16)
  );
}

*::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

html {
  background: var(--bg);
  background-color: var(--bg-solid, #151418);
  height: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  scrollbar-width: none;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 0;
  background: var(--bg);
  background-color: var(--bg-solid, #151418);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
  touch-action: pan-y;
  overscroll-behavior-x: none;
  overscroll-behavior-y: auto;
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
  position: relative;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none;
}

input,
textarea,
select,
option,
[contenteditable],
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

html.app-authed,
body.app-authed {
  background: var(--card);
  background-color: var(--card);
}

html.app-authed.home-visible,
body.app-authed.home-visible {
  background: var(--bg);
  background-color: var(--bg-solid, #151418);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: -1;
  pointer-events: none;
}

body.app-authed::before {
  background: var(--card);
}

body.app-authed.home-visible::before {
  background: var(--bg);
}

.safe-area-fill {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: env(safe-area-inset-top, 24px);
  background: var(--bg-solid, var(--bg));
  z-index: 0;
  pointer-events: none;
}

.safe-area-fill-bottom {
  top: auto;
  bottom: 0;
  height: env(safe-area-inset-bottom, 0px);
}

body.app-authed .safe-area-fill {
  background: var(--card);
  background-color: var(--card);
}

body.app-authed.home-visible .safe-area-fill {
  background: var(--bg-solid, var(--bg));
  background-color: var(--bg-solid, #151418);
}

body.games-special-blur-open .safe-area-fill,
body.games-special-blur-open .safe-area-fill-bottom {
  background: var(--bg);
  background-color: transparent;
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
}

.games-special-blur {
  position: fixed;
  inset: 0;
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  background: rgba(10, 12, 18, 0.38);
  z-index: 20;
  opacity: 0;
  transition: none;
  pointer-events: none;
  will-change: opacity;
}

body.games-special-blur-open .games-special-blur {
  opacity: 1;
  pointer-events: auto;
  animation: games-blur-fade-in 0.45s ease both;
}

body.games-special-blur-open .tab-row,
body.games-special-blur-open #games-special-image-wrap {
  position: relative;
  z-index: 30;
}

body.games-special-blur-open #games-special-bubble {
  z-index: 31;
}

.panel {
  position: relative;
  z-index: 1;
}

@media (min-width: 700px) {
  .safe-area-fill {
    height: 0;
  }
}

/* Prevent iOS auto-zoom on focus by ensuring 16px+ font size on form fields */
input,
textarea,
select {
  font-size: 16px;
}

.panel {
  width: 100%;
  max-width: 420px;
  min-height: 100svh;
  padding-bottom: env(safe-area-inset-bottom);
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
}

#start-screen {
  min-height: 100svh;
  height: auto;
  background: var(--card);
  padding: 0;
  box-shadow: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

#start-screen > #games-panel,
#start-screen > #profile-panel,
#start-screen > #translator-panel {
  padding: 6px 12px 24px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}

#games-teach-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "DM Sans", "Sora", "Outfit", "Manrope", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink);
  text-transform: uppercase;
}

#games-teach-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(255, 180, 92, 0.5);
}

.tab-row {
  display: flex;
  margin: 0 0 6px;
  background: color-mix(in srgb, var(--card) 70%, transparent);
  padding: 6px;
  gap: 6px;
  border-radius: 999px;
  --tab-indicator-bg: color-mix(in srgb, var(--surface) 85%, #0b0f16);
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 8px 18px rgba(8, 4, 14, 0.45);
  position: sticky;
  top: env(safe-area-inset-top);
  z-index: 20;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tab-row::before {
  content: "";
  position: absolute;
  top: 6px;
  left: var(--tab-indicator-x, 6px);
  width: var(--tab-indicator-w, 0px);
  height: calc(100% - 12px);
  border-radius: 999px;
  background: var(--tab-indicator-bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 6px 12px rgba(8, 4, 14, 0.35);
  transition: left 0.25s ease, width 0.25s ease;
  z-index: 0;
}

.tab {
  flex: 1;
  background: transparent;
  border: 0;
  border-left: 0;
  border-radius: 999px;
  padding: 16px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: lowercase;
  text-align: center;
  position: relative;
  z-index: 1;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.tab:hover {
  background: transparent;
  box-shadow: none;
}

button,
.tab {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:focus:not(:focus-visible),
.tab:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

#open-games {
  color: transparent;
  position: relative;
}

#open-games::before {
  content: "";
  width: 38px;
  height: 38px;
  display: inline-block;
  background: url("/assets/sushis/sushilingo1.png") center / contain no-repeat;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
}

#open-games::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38px;
  height: 38px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    315deg,
    rgba(255, 205, 140, 0.42) 0px,
    rgba(255, 205, 140, 0.42) 6px,
    rgba(255, 190, 120, 0) 10px,
    rgba(255, 190, 120, 0) 32px
  );
  background-size: 120px 120px;
  background-position: 0px -120px;
  -webkit-mask: url("/assets/sushis/sushilingo1.png") center / contain no-repeat;
  mask: url("/assets/sushis/sushilingo1.png") center / contain no-repeat;
  mix-blend-mode: screen;
  opacity: 0.85;
  animation: mascot-lines 5.2s linear infinite;
}

.games-sparkles {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38px;
  height: 38px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: block;
  z-index: 2;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%2300d9ff'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%23ff8af0'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%2300ffd1'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%23ffb347'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%238aff7a'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%23ff6b6b'/></svg>");
  background-repeat: no-repeat;
  background-position:
    12% 18%,
    74% 14%,
    34% 48%,
    82% 56%,
    18% 76%,
    62% 80%;
  background-size:
    0 0,
    0 0,
    0 0,
    0 0,
    0 0,
    0 0;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 6px rgba(255, 230, 190, 0.35));
  opacity: 1;
  animation: mascot-sparkles 3.2s ease-in-out infinite;
}

@keyframes mascot-lines {
  0% {
    background-position: 0px -120px;
  }
  100% {
    background-position: 0px 120px;
  }
}

@keyframes header-sparkles {
  0% {
    background-size: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, var(--mascot-w) var(--mascot-h);
  }
  18% {
    background-size: 10px 10px, 0 0, 0 0, 0 0, 0 0, 0 0, var(--mascot-w) var(--mascot-h);
  }
  32% {
    background-size: 6px 6px, 12px 12px, 0 0, 0 0, 0 0, 0 0, var(--mascot-w) var(--mascot-h);
  }
  46% {
    background-size: 0 0, 6px 6px, 12px 12px, 0 0, 0 0, 0 0, var(--mascot-w) var(--mascot-h);
  }
  60% {
    background-size: 0 0, 0 0, 8px 8px, 12px 12px, 0 0, 0 0, var(--mascot-w) var(--mascot-h);
  }
  74% {
    background-size: 0 0, 0 0, 0 0, 8px 8px, 12px 12px, 0 0, var(--mascot-w) var(--mascot-h);
  }
  88% {
    background-size: 0 0, 0 0, 0 0, 0 0, 8px 8px, 12px 12px, var(--mascot-w) var(--mascot-h);
  }
  100% {
    background-size: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, var(--mascot-w) var(--mascot-h);
  }
}

@keyframes mascot-sparkles {
  0% {
    background-size: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
    opacity: 0;
    filter: drop-shadow(0 0 8px rgba(255, 230, 190, 0.35));
  }
  18% {
    background-size: 10px 10px, 0 0, 0 0, 0 0, 0 0, 0 0;
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(255, 230, 190, 0.2));
  }
  32% {
    background-size: 6px 6px, 12px 12px, 0 0, 0 0, 0 0, 0 0;
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(255, 230, 190, 0.2));
  }
  46% {
    background-size: 0 0, 6px 6px, 12px 12px, 0 0, 0 0, 0 0;
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(255, 230, 190, 0.2));
  }
  60% {
    background-size: 0 0, 0 0, 8px 8px, 12px 12px, 0 0, 0 0;
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(255, 230, 190, 0.2));
  }
  74% {
    background-size: 0 0, 0 0, 0 0, 8px 8px, 12px 12px, 0 0;
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(255, 230, 190, 0.2));
  }
  88% {
    background-size: 0 0, 0 0, 0 0, 0 0, 8px 8px, 12px 12px;
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(255, 230, 190, 0.2));
  }
  100% {
    background-size: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
    opacity: 0;
    filter: drop-shadow(0 0 6px rgba(255, 230, 190, 0.3));
  }
}

.tab:first-child {
  border-left: 0;
}

.tab-active {
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

@keyframes sushilingo-hop {
  0% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  20% {
    transform: translate(-50%, -50%) scale(0.96, 1.04) rotate(-3deg);
  }
  45% {
    transform: translate(-50%, -50%) translateY(-8px) scale(1.03, 0.97) rotate(4deg);
  }
  70% {
    transform: translate(-50%, -50%) translateY(0) scale(1) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
}

@keyframes mascot-hop {
  0% {
    transform: translateY(-50%) scale(1) rotate(0deg) translateZ(0);
  }
  20% {
    transform: translateY(-50%) scale(0.96, 1.04) rotate(-3deg) translateZ(0);
  }
  45% {
    transform: translateY(-50%) translateY(-8px) scale(1.03, 0.97) rotate(4deg) translateZ(0);
  }
  70% {
    transform: translateY(-50%) translateY(0) scale(1) rotate(0deg) translateZ(0);
  }
  100% {
    transform: translateY(-50%) scale(1) rotate(0deg) translateZ(0);
  }
}

@keyframes flashcards-mascot-hop {
  0% {
    transform: translateY(-50%) scaleX(-1) scale(1) rotate(0deg) translateZ(0);
  }
  20% {
    transform: translateY(-50%) scaleX(-1) scale(0.96, 1.04) rotate(-3deg) translateZ(0);
  }
  45% {
    transform: translateY(-50%) translateY(-8px) scaleX(-1) scale(1.03, 0.97) rotate(4deg) translateZ(0);
  }
  70% {
    transform: translateY(-50%) translateY(0) scaleX(-1) scale(1) rotate(0deg) translateZ(0);
  }
  100% {
    transform: translateY(-50%) scaleX(-1) scale(1) rotate(0deg) translateZ(0);
  }
}

@keyframes daily-lesson-hop {
  0% {
    transform: translateY(0) scale(1) rotate(0deg) translateZ(0);
  }
  20% {
    transform: translateY(0) scale(0.96, 1.04) rotate(-3deg) translateZ(0);
  }
  45% {
    transform: translateY(-10px) scale(1.03, 0.97) rotate(4deg) translateZ(0);
  }
  70% {
    transform: translateY(0) scale(1) rotate(0deg) translateZ(0);
  }
  100% {
    transform: translateY(0) scale(1) rotate(0deg) translateZ(0);
  }
}

#open-games.games-emote::before {
  animation: sushilingo-hop 0.7s ease-out;
}

#open-games.games-emote::after {
  animation: mascot-lines 5.2s linear infinite, sushilingo-hop 0.7s ease-out;
}

#open-games.games-emote .games-sparkles {
  animation: mascot-sparkles 3.2s ease-in-out infinite, sushilingo-hop 0.7s ease-out;
}

.form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px 8px;
  align-items: center;
  margin-bottom: 4px;
  background: var(--card);
  padding: 8px 10px;
  border-radius: var(--radius);
  box-shadow: 0 8px 18px rgba(8, 4, 14, 0.7);
}

.form-row {
  display: contents;
}

label {
  color: var(--ink);
}

.form label {
  font-size: 12px;
  line-height: 1.2;
}

select,
input[type="text"] {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
}

.form-row.inline {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
}


.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 54px;
  height: 32px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--accent) 70%, #1b2330);
  background: color-mix(in srgb, var(--panel) 80%, #0b0f16);
  position: relative;
  display: inline-block;
  vertical-align: middle;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.checkbox input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, #fff 85%, var(--accent));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, background 0.2s ease;
}

.checkbox input[type="checkbox"]:checked {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}

.checkbox input[type="checkbox"]:checked::before {
  transform: translateX(24px);
  background: color-mix(in srgb, var(--accent) 65%, #fff);
}

.checkbox input[type="checkbox"]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: 2px;
}

.button-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.button-stack button {
  position: relative;
  padding-left: 56px;
  font-size: 13px;
  line-height: 1.1;
  min-height: 44px;
  padding-top: 10px;
  padding-bottom: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.button-stack button::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background-color: color-mix(in srgb, var(--button-bg) 75%, var(--accent));
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow: 0 6px 14px rgba(8, 4, 14, 0.35);
  background: var(--game-icon) center / contain no-repeat;
}

.button-stack button::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 11px;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 10% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(120% 80% at 90% 0%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 65%);
  opacity: 0.6;
}

.button-stack button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 22px rgba(7, 10, 16, 0.55),
    0 0 14px color-mix(in srgb, var(--accent) 22%, transparent);
}

.button-stack button:active {
  transform: translateY(0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 6px 14px rgba(7, 10, 16, 0.45);
}

#open-flashcards {
  --game-icon: url("/assets/icons/flashcards.svg");
}

#open-custom {
  --game-icon: url("/assets/icons/custom.svg");
}

#open-romaji {
  --game-icon: url("/assets/icons/romaji.svg");
}

#open-core2000 {
  --game-icon: url("/assets/icons/core2000.svg");
}

#open-picture {
  --game-icon: url("/assets/icons/picture.svg");
}

#open-matching {
  --game-icon: url("/assets/icons/matching.svg");
}

#open-reading {
  --game-icon: url("/assets/icons/reading.svg");
}

#open-counters {
  --game-icon: url("/assets/icons/counters.svg");
}

#open-verb-teacher {
  --game-icon: url("/assets/icons/verb.svg");
}

#open-listening {
  --game-icon: url("/assets/icons/listening.svg");
}

.listening-practice-card {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 0 2px;
}

.listening-practice-frame-wrap {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in srgb, var(--card) 88%, #06070b);
  border: 1px solid color-mix(in srgb, var(--border) 74%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 22px rgba(6, 8, 12, 0.48);
}

.listening-practice-frame-wrap::before {
  content: "";
  display: block;
  width: 100%;
  padding-top: 56.25%;
}

.listening-practice-frame-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 95% at 16% 0%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 62%),
    radial-gradient(110% 88% at 84% 100%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 60%),
    linear-gradient(135deg, color-mix(in srgb, var(--panel) 82%, #050608), color-mix(in srgb, var(--card) 90%, #070911));
  background-size: 220% 220%, 220% 220%, 100% 100%;
  background-position: 0% 0%, 100% 100%, 0 0;
  opacity: 0.96;
  transition: opacity 0.24s ease;
  animation: listening-frame-glow 2.4s ease-in-out infinite;
}

.listening-practice-frame-wrap.is-ready::after {
  opacity: 0;
}

.listening-practice-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  opacity: 0;
  transition: opacity 0.24s ease;
}

.listening-practice-frame-wrap.is-ready .listening-practice-iframe {
  opacity: 1;
}

@keyframes listening-frame-glow {
  0% {
    background-position: 0% 0%, 100% 100%, 0 0;
  }
  50% {
    background-position: 100% 100%, 0% 0%, 0 0;
  }
  100% {
    background-position: 0% 0%, 100% 100%, 0 0;
  }
}

.button-stack .wide-button {
  grid-column: 1 / -1;
}

.lang-ja .button-stack #open-listening {
  grid-column: 1 / -1;
  text-align: center;
  padding-right: 56px;
}

body.daily-lesson-mode .flashcards-tabs {
  display: none !important;
}

body.daily-lesson-mode [data-flash-pane="settings"],
body.daily-lesson-mode [data-picture-pane="settings"],
body.daily-lesson-mode [data-matching-pane="settings"] {
  display: none !important;
}

.daily-lesson-progress {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
  background: color-mix(in srgb, var(--panel) 85%, #0a0d14);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  color: color-mix(in srgb, var(--muted) 80%, #fff);
  box-shadow: 0 10px 20px rgba(6, 8, 12, 0.45);
}

.daily-lesson-complete {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(30px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
  background-color: var(--card);
  background-image: none;
  overflow: hidden;
}

.daily-lesson-complete-inner {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.daily-lesson-mascot {
  position: relative;
  width: clamp(92px, 32vw, 140px);
  aspect-ratio: 100 / 81;
  display: grid;
  place-items: center;
  margin-top: 6px;
  pointer-events: none;
}

.daily-lesson-mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  will-change: transform;
  transform: translateZ(0);
}

.daily-lesson-mascot-stars {
  position: absolute;
  inset: -16%;
  pointer-events: none;
  z-index: 2;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%2300d9ff'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%23ff8af0'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%2300ffd1'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%23ffb347'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%238aff7a'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%23ff6b6b'/></svg>");
  background-repeat: no-repeat;
  background-position:
    12% 18%,
    74% 14%,
    34% 48%,
    82% 56%,
    18% 76%,
    62% 80%;
  background-size:
    0 0,
    0 0,
    0 0,
    0 0,
    0 0,
    0 0;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 6px rgba(255, 230, 190, 0.35));
  opacity: 1;
  animation: mascot-sparkles 3.2s ease-in-out infinite;
  will-change: transform;
}

.daily-lesson-mascot.is-jumping .daily-lesson-mascot-img {
  animation: daily-lesson-hop 0.7s ease-out;
}

.daily-lesson-mascot.is-jumping .daily-lesson-mascot-stars {
  animation: mascot-sparkles 3.2s ease-in-out infinite, daily-lesson-hop 0.7s ease-out;
}

.daily-lesson-title-arc {
  width: min(360px, 92vw);
  height: auto;
}

.daily-lesson-title-text {
  font-family: var(--font);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  dominant-baseline: middle;
  stroke-linejoin: round;
  stroke-linecap: round;
  paint-order: stroke fill;
  text-rendering: geometricPrecision;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 10px 18px rgba(6, 8, 12, 0.45));
}

.daily-lesson-title-stroke {
  fill: none;
  stroke: rgba(15, 11, 20, 0.7);
  stroke-width: 6px;
}

.daily-lesson-title-fill {
  fill: url(#daily-lesson-title-grad);
  stroke: none;
}

.daily-lesson-complete-text {
  font-size: 14px;
  color: color-mix(in srgb, var(--muted) 78%, #fff);
  line-height: 1.5;
  max-width: 320px;
}

.daily-lesson-home-btn {
  margin-top: 4px;
  padding: 12px 26px;
  min-width: 0;
  width: fit-content;
  align-self: center;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 75%, #fff),
    color-mix(in srgb, var(--accent) 92%, #1a1208)
  );
  border: 1px solid color-mix(in srgb, var(--accent) 80%, transparent);
  color: #1a1208;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 10px 20px rgba(6, 8, 12, 0.45),
    0 0 18px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  transform: none;
}

.daily-lesson-home-btn:hover,
.daily-lesson-home-btn:active,
.daily-lesson-home-btn:focus,
.daily-lesson-home-btn:focus-visible {
  transform: none;
  border-color: color-mix(in srgb, var(--accent) 80%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 10px 20px rgba(6, 8, 12, 0.45),
    0 0 18px color-mix(in srgb, var(--accent) 35%, transparent);
  outline: none;
}

@media (max-width: 420px) {
  .daily-lesson-title-text {
    font-size: 24px;
    filter: drop-shadow(0 6px 10px rgba(6, 8, 12, 0.35));
  }

  .daily-lesson-title-stroke {
    stroke-width: 3px;
    stroke: rgba(12, 10, 18, 0.55);
  }
}

.daily-lesson-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
}

html.daily-lesson-complete-open,
body.daily-lesson-complete-open {
  background: var(--card);
  background-color: var(--card);
}

body.daily-lesson-complete-open::before {
  background-color: var(--card);
  background-image: none;
}

body.daily-lesson-complete-open .safe-area-fill,
body.daily-lesson-complete-open .safe-area-fill-bottom {
  background-color: var(--card);
  background-image: none;
}

.games-special {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 14px;
}

.games-special-image {
  margin-top: 12px;
  position: relative;
}

.games-image-button {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  width: 66px;
  height: 62px;
  outline: none;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  isolation: isolate;
  overflow: visible;
  --games-btn-tint: transparent;
  --games-btn-tint-opacity: 0.9;
  --games-btn-tint-sat: 1;
  --games-btn-tint-bright: 1;
  --games-btn-tint-contrast: 1;
  --games-btn-tint-blend: color;
  --games-btn-mask-up: url("/assets/sushis/btn1.png");
  --games-btn-mask-down: url("/assets/sushis/btn2.png");
  --games-btn-aura-opacity: 0.65;
}


.games-special-bubble {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(0) scale(1);
  width: min(240px, 70vw);
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 92%, #12151d);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow: 0 12px 26px rgba(4, 6, 10, 0.45);
  text-align: center;
  z-index: 2;
  opacity: 1;
  transition: opacity 0.25s ease, transform 0.25s ease;
  will-change: transform, opacity;
}

.games-special-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 10px;
  background: color-mix(in srgb, var(--card) 92%, #12151d);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.games-special-bubble.hidden {
  display: block;
  opacity: 0;
  transform: translateX(-50%) translateY(12px) scale(0.96);
  pointer-events: none;
  visibility: hidden;
}

body.games-special-blur-open .games-special-bubble:not(.hidden) {
  animation: games-bubble-pop 0.45s cubic-bezier(0.16, 0.84, 0.32, 1.2);
}

@keyframes games-bubble-pop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(18px) scale(0.92);
  }
  60% {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes games-blur-fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}


.games-special-bubble-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.games-special-bubble-text {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.games-special-bubble-btn {
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 75%, #fff),
    color-mix(in srgb, var(--accent) 92%, #1a1208)
  );
  border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent);
  color: #1a1208;
  font-weight: 600;
  text-align: center;
  transition: box-shadow 0.2s ease;
  box-shadow: 0 6px 12px rgba(6, 8, 12, 0.35);
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.games-special-bubble-btn:hover,
.games-special-bubble-btn:active,
.games-special-bubble-btn:focus,
.games-special-bubble-btn:focus-visible {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 75%, #fff),
    color-mix(in srgb, var(--accent) 92%, #1a1208)
  );
  color: #1a1208;
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  outline: none;
  box-shadow: 0 6px 12px rgba(6, 8, 12, 0.35);
  transform: none;
}

.games-image-button:hover,
.games-image-button:focus,
.games-image-button:focus-visible,
.games-image-button:active {
  background: transparent !important;
  border: none !important;
  outline: none;
  box-shadow: none !important;
}

.games-image-button::before,
.games-image-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--games-btn-tint);
  mix-blend-mode: var(--games-btn-tint-blend);
  filter: saturate(var(--games-btn-tint-sat)) brightness(var(--games-btn-tint-bright))
    contrast(var(--games-btn-tint-contrast));
  pointer-events: none;
  opacity: var(--games-btn-tint-opacity);
  z-index: 1;
}

.games-image-button::before {
  -webkit-mask: var(--games-btn-mask-up) center bottom / contain no-repeat;
  mask: var(--games-btn-mask-up) center bottom / contain no-repeat;
  opacity: var(--games-btn-tint-opacity);
}

.games-image-button::after {
  -webkit-mask: var(--games-btn-mask-down) center bottom / contain no-repeat;
  mask: var(--games-btn-mask-down) center bottom / contain no-repeat;
  opacity: 0;
}

.games-image-button.is-pressed::before {
  opacity: 0;
}

.games-image-button.is-pressed::after {
  opacity: var(--games-btn-tint-opacity);
}

.games-image-button img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  z-index: 0;
  transform-origin: 50% 85%;
}

.games-image-button .games-image-down {
  opacity: 0;
}

.games-image-button.is-pressed .games-image-up {
  opacity: 0;
}

.games-image-button.is-pressed .games-image-down {
  opacity: 1;
}

.games-image-button.is-pressed img {
  animation: none;
}

.games-image-button.is-complete {
  --games-btn-tint-opacity: 0 !important;
  --games-btn-tint: transparent !important;
}

@media (prefers-reduced-motion: reduce) {
  .games-image-button img {
    animation: none;
  }
}

.games-comic-pop {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(var(--comic-rot, -8deg));
  font-size: clamp(14px, 4.2vw, 28px);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: "Luckiest Guy", "Bangers", "Impact", "Arial Black", sans-serif;
  color: var(--comic-pop-color, #ffd86a);
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(8, 10, 14, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45);
  text-shadow:
    2px 2px 0 #0a0b10,
    -2px 2px 0 #0a0b10,
    2px -2px 0 #0a0b10,
    -2px -2px 0 #0a0b10;
  pointer-events: none;
  z-index: 200;
  animation: comic-pop 1.2s ease-out forwards;
}

@keyframes comic-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.6) rotate(var(--comic-rot, -8deg));
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -60%) scale(1.08) rotate(var(--comic-rot, -8deg));
  }
  60% {
    opacity: 0.9;
    transform: translate(-50%, -85%) scale(1) rotate(var(--comic-rot, -8deg));
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -120%) scale(0.95) rotate(var(--comic-rot, -8deg));
  }
}

.games-special-button {
  padding: 12px 20px;
  min-width: 180px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}


.games-special-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 22px rgba(7, 10, 16, 0.55),
    0 0 14px color-mix(in srgb, var(--accent) 22%, transparent);
}

.games-special-button:active {
  transform: translateY(0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 6px 14px rgba(7, 10, 16, 0.45);
}


button {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--button-bg);
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  color: var(--ink);
}

.button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  vertical-align: middle;
}

.button-icon svg {
  width: 100%;
  height: 100%;
}

.admin-only.hidden {
  display: none;
}

button:hover {
  background: var(--button-hover);
}

button:disabled {
  opacity: 0.45;
  cursor: default;
  filter: grayscale(0.2);
}

.daily-lesson-home-btn:hover,
.daily-lesson-home-btn:active {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 75%, #fff),
    color-mix(in srgb, var(--accent) 92%, #1a1208)
  );
  color: #1a1208;
}

button:disabled.choice-btn.correct[data-correct-locked="true"] {
  opacity: 1;
  filter: none;
  cursor: default;
}

.hidden {
  display: none !important;
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  background-color: #0b0b10;
  padding: 24px;
}

.app-loading-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: color-mix(in srgb, var(--panel) 70%, #0b0b10);
  color: var(--ink);
  padding: 0;
  padding: 0;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.app-loading-close svg {
  width: 18px;
  height: 18px;
  display: block;
}

.app-loading-close:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.app-loading-mascot {
  position: relative;
  width: min(140px, 40vw);
  display: grid;
  place-items: center;
}

.app-loading-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-top-color: var(--accent);
  animation: app-loading-spin 0.9s linear infinite;
}

.app-loading-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.app-loading-subtitle {
  font-size: 0.8rem;
  color: var(--muted);
}

@keyframes app-loading-spin {
  to {
    transform: rotate(360deg);
  }
}






.home {
  position: relative;
  display: grid;
  gap: 16px;
  padding: calc(18px + env(safe-area-inset-top)) 14px 24px;
  margin-top: calc(-1 * env(safe-area-inset-top));
  min-height: 100svh;
  overflow: visible;
}

.home::before {
  content: "";
  position: absolute;
  inset: -25% -10% auto;
  height: 55%;
  background:
    radial-gradient(45% 45% at 12% 20%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 70%),
    radial-gradient(35% 35% at 85% 10%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}

.home::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(transparent 94%, rgba(255, 255, 255, 0.05) 96%),
    linear-gradient(90deg, transparent 94%, rgba(255, 255, 255, 0.04) 96%);
  background-size: 120px 120px;
  opacity: 0.1;
  pointer-events: none;
}

.home-mascot-top {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  margin: 4px 0 2px;
  width: min(150px, 36vw);
}

.home-register-active .home-mascot-top {
  display: none;
}

.home-mascot {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 22px rgba(6, 8, 12, 0.55));
  position: relative;
  z-index: 1;
}


.home-mascot-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: block;
  z-index: 3;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%2300d9ff'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%23ff8af0'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%2300ffd1'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%23ffb347'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%238aff7a'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%23ff6b6b'/></svg>");
  background-repeat: no-repeat;
  background-position:
    12% 18%,
    74% 14%,
    34% 48%,
    82% 56%,
    18% 76%,
    62% 80%;
  background-size:
    0 0,
    0 0,
    0 0,
    0 0,
    0 0,
    0 0;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 6px rgba(255, 230, 190, 0.35));
  opacity: 1;
  animation: mascot-sparkles 3.2s ease-in-out infinite;
}

.home-hero {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  align-items: start;
}

@media (min-width: 900px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

.home-hero-left {
  display: grid;
  gap: 12px;
  animation: home-rise 0.6s ease;
}

.home-mascot-stack {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.home-lang-wrap {
  display: grid;
  gap: 6px;
  align-items: center;
  justify-items: center;
}


.home-hero-right {
  display: grid;
  gap: 14px;
  align-content: start;
  justify-items: center;
  animation: home-rise 0.7s ease;
}

.home-kicker {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  width: 100%;
}

.home-cta-label {
  width: 100%;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.57rem;
  text-align: center;
}

.home-lang-toggle {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 0;
  width: min(170px, 44vw);
  height: 44px;
  padding: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 80%, #06060a);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 18px rgba(6, 8, 12, 0.55);
  transform: translateZ(0);
}

.home-lang-toggle button {
  position: relative;
  z-index: 2;
  border: 0;
  background: transparent;
  padding: 0;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.home-lang-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 16px rgba(6, 8, 12, 0.55);
  transform: translate3d(0, 0, 0);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
  backface-visibility: hidden;
}

.home-lang-toggle[data-active="japanese"] .home-lang-thumb {
  transform: translate3d(100%, 0, 0);
}

.home-lang-toggle button[aria-pressed="true"] .flag-icon {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent), 0 0 10px color-mix(in srgb, var(--accent) 25%, transparent);
}

.home-lang-grid .flag-icon {
  margin-right: 0;
  width: 22px;
  height: 14px;
}

.flag-icon,
.flag-emoji {
  display: inline-block;
  margin-right: 0;
  width: 20px;
  height: 14px;
  border-radius: 2px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--border) 75%, transparent);
  transform: translateY(1px);
}

.flag-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flag-us {
  background-image: url("/assets/icons/flag-us.svg");
}

.flag-jp {
  background-image: url("/assets/icons/flag-jp.svg");
}

.home-google {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  color: var(--ink);
  font-weight: 700;
  gap: 10px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 12px 22px rgba(6, 8, 12, 0.6);
}

.home-auth-card {
  width: min(360px, 100%);
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--panel) 86%, #08080c), var(--panel));
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 14px 26px rgba(6, 8, 12, 0.6);
  display: grid;
  gap: 10px;
}

.home-auth-title {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.home-auth-subtitle {
  font-size: 0.8rem;
  color: color-mix(in srgb, var(--ink) 85%, var(--muted));
  text-align: center;
  line-height: 1.35;
  margin: -4px 0 2px;
}

.home-auth-points {
  display: grid;
  gap: 6px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.home-auth-point {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.home-auth-point::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 70%, #fff);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}

.home-auth {
  margin: 0;
  display: grid;
  gap: 10px;
}

.home-auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.home-auth-tab {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 90%, #0b0f16), var(--surface));
  color: var(--muted);
  padding: 9px 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.85rem;
}

.home-auth-tab.active {
  color: var(--ink);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: var(--tab-active);
}

.home-auth-pane {
  display: none;
  gap: 7px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, #0a0a10), var(--panel));
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 12px;
  padding: 12px;
}

.home-auth-pane.active {
  display: grid;
}

.home-auth-pane label {
  display: grid;
  gap: 5px;
}

.home-auth-pane input {
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--ink);
  font-size: 16px;
}

.home-auth-pane label.auth-terms {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.2;
}

.home-auth-pane label.auth-terms input {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  accent-color: var(--accent);
}

.home-auth-pane label.auth-terms a {
  color: var(--ink);
  text-decoration: underline;
}

.home-auth-pane button {
  width: 100%;
}

.home-auth-status {
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}

.home-forgot {
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
  text-align: center;
  margin: -12px 0 0;
  line-height: 1.1;
  letter-spacing: 0.04em;
}

.reset-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: grid;
  place-items: center;
  padding:
    max(16px, env(safe-area-inset-top, 0px))
    max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
  background: rgba(6, 7, 10, 0.72);
  backdrop-filter: blur(6px);
}

.terms-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 7, 10, 0.72);
  backdrop-filter: blur(6px);
}

.terms-card {
  position: relative;
  width: min(380px, 94vw);
  max-height: min(35vh, 260px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--panel) 86%, #08080c), var(--panel));
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 30px rgba(6, 8, 12, 0.6);
}

.terms-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, #0b0f16);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
}

.terms-title {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  padding-top: 2px;
}

.terms-body {
  overflow: auto;
  padding: 6px 4px 8px;
  display: grid;
  gap: 8px;
  color: var(--ink);
}

.terms-content h3 {
  margin: 8px 0 4px;
  font-size: 0.78rem;
}

.terms-content p,
.terms-content li {
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--ink);
}

.terms-content ul {
  margin: 0 0 6px 16px;
  padding: 0;
  display: grid;
  gap: 4px;
}

.terms-content.lang-ja {
  display: none;
}

body.lang-ja .terms-content.lang-ja {
  display: block;
}

body.lang-ja .terms-content.lang-en {
  display: none;
}

.reset-card {
  position: relative;
  width: min(360px, 100%);
  display: grid;
  gap: 12px;
  padding: 18px 18px 16px;
  border-radius: 16px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--panel) 86%, #06070b), var(--panel));
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55);
  text-align: left;
  margin: 0 auto;
}

.reset-status {
  font-size: 0.78rem;
  color: var(--muted);
  min-height: 16px;
}

.reset-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding:
    max(16px, env(safe-area-inset-top, 0px))
    max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
}

.reset-page-card {
  width: min(340px, 100%);
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--panel) 86%, #06070b), var(--panel));
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow: 0 18px 32px rgba(6, 8, 12, 0.6);
  margin: 0 auto;
  justify-self: center;
}

.reset-page-title {
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
}

.reset-page-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 4px;
}

.reset-page-label {
  display: grid;
  gap: 5px;
}

.reset-page-label input {
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--ink);
  font-size: 16px !important;
}

.reset-page-status {
  font-size: 0.82rem;
  color: var(--muted);
  min-height: 16px;
}

.reset-page-btn {
  width: 100%;
}

.reset-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--ink);
}

.reset-text {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.reset-label {
  display: grid;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

.reset-label input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--ink);
  font-size: 16px !important;
}

.reset-send {
  width: 100%;
  text-align: center;
  font-weight: 600;
}

.reset-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: color-mix(in srgb, var(--panel) 70%, #0b0b10);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.reset-close svg {
  width: 16px;
  height: 16px;
  display: block;
}

.home-forgot:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.home-legal {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  font-size: 11px;
  color: var(--muted);
  z-index: 1;
}

.home-legal a {
  text-decoration: none;
  color: var(--muted);
  padding: 0;
  border-bottom: 0;
  display: inline-block;
  line-height: 1.1;
  text-decoration: none;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.home-legal a:hover {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
}

.admin-fab-wrap {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 20;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.admin-fab {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 82%, #0a0a10), var(--panel));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 22px rgba(6, 8, 12, 0.55);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.admin-fab-icon {
  width: 13px;
  height: 7px;
  border: 2px solid color-mix(in srgb, var(--accent) 80%, var(--ink));
  border-top: none;
  border-right: none;
  transform: rotate(-45deg);
  margin-top: -2px;
}

.admin-panel {
  width: 220px;
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 86%, #08080c), var(--panel));
  border: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 14px 28px rgba(6, 8, 12, 0.6);
  display: grid;
  gap: 10px;
}

.admin-panel-title {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.admin-panel-btn {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  color: var(--ink);
  font-weight: 600;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 18px rgba(6, 8, 12, 0.5);
}

.admin-panel-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

@keyframes home-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero-left,
  .home-hero-right {
    animation: none;
  }
}

@media (max-height: 740px) {
  .home {
    gap: 12px;
    padding: 12px 12px 18px;
  }

  .home-hero {
    gap: 12px;
  }

  .home-hero-left,
  .home-hero-right {
    gap: 12px;
  }

  .home-mascot {
    width: min(130px, 32vw);
  }

  .home-cta-panel {
    padding: 12px;
    gap: 10px;
  }

  .home-lang-grid button {
    padding: 8px 8px;
    font-size: 0.82rem;
  }

  .home-auth-card {
    padding: 12px;
    gap: 10px;
  }

  .home-auth-tab {
    padding: 8px 8px;
    font-size: 0.82rem;
  }

  .home-auth-pane {
    padding: 8px;
    gap: 6px;
  }

  .home-auth-pane input {
    padding: 7px 8px;
    font-size: 16px;
  }

  .home-google {
    padding: 9px 12px;
    font-size: 0.85rem;
  }

  .home-legal {
    font-size: 10px;
    gap: 6px 10px;
  }
}

.home-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 30px var(--shadow);
}

.home-card-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.home-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.home-grid {
  display: grid;
  gap: 12px;
}

.home-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.home-panel-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.home-panel-text {
  color: var(--muted);
  font-size: 0.95rem;
}

.legal-page {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin: 16px 0 32px;
  box-shadow: 0 12px 30px var(--shadow);
  display: grid;
  gap: 12px;
}

.legal-page h1 {
  margin: 0;
  font-size: 1.6rem;
}

.legal-page h2 {
  margin: 16px 0 0;
  font-size: 1.1rem;
}

.legal-page p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.legal-page ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 16px rgba(6, 8, 12, 0.45);
}

.legal-back::before {
  content: "\2190";
  line-height: 1;
}

.legal-back:hover,
.legal-back:active,
.legal-back:focus,
.legal-back:focus-visible {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 16px rgba(6, 8, 12, 0.45);
  outline: none;
}

.legal-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (min-width: 820px) {
  .home {
    padding: 24px;
  }

  .home-hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .home-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.flashcards {
  margin-top: 0;
  padding: calc(20px + env(safe-area-inset-top)) 12px calc(84px + env(safe-area-inset-bottom));
  border: none;
  border-radius: 0;
  background: var(--card);
  border: none;
  box-shadow: none;
  position: relative;
  min-height: 100svh;
  height: auto;
  overflow-y: visible;
  overflow-x: hidden;
  overscroll-behavior-y: auto;
}

.flashcards-back {
  position: absolute;
  top: calc(20px + env(safe-area-inset-top) + 16px);
  left: 12px;
  border: none;
  background: transparent;
  padding: 0;
  width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  cursor: pointer;
  color: var(--ink);
  outline: none;
  box-shadow: none;
  transform: translateY(-50%);
  z-index: 2;
}

.flashcards-back {
  color: transparent;
}

.flashcards-back::before {
  content: "";
  position: relative;
  display: inline-block;
  width: 27px;
  height: 27px;
  background: url("/assets/icons/back.svg") center / contain no-repeat;
}

.flashcards-back:hover,
.flashcards-back:focus,
.flashcards-back:active {
  outline: none;
  box-shadow: none;
  background: transparent;
}

.flashcards-tabs {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 420px);
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  border-top: 1px solid var(--border);
  padding: 8px 12px 14px;
  background: var(--panel);
  box-shadow: 0 -12px 24px rgba(8, 4, 14, 0.8);
  z-index: 10;
  overflow: hidden;
  isolation: isolate;
}

@media (max-width: 700px) {
  .flashcards-tabs {
    left: 0;
    right: 0;
    transform: none;
    width: auto;
    max-width: none;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
}

.flashcards-tabs.two-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.flashcards-tabs.two-tabs .flashcards-tab {
  flex: 0 1 auto;
  min-width: 120px;
}

.flashcards-tabs::before {
  content: "";
  position: absolute;
  top: 8px;
  left: var(--game-tab-x, 12px);
  width: var(--game-tab-w, 0px);
  height: calc(100% - 22px);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 85%, #0b0f16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 6px 12px rgba(8, 4, 14, 0.35);
  transition: left 0.25s ease, width 0.25s ease;
  z-index: 0;
}

.flashcards-flag {
  position: fixed;
  left: calc(50% - min(210px, 50vw));
  bottom: 58px;
  z-index: 200;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  appearance: none;
  -webkit-appearance: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.flashcards-flag svg {
  pointer-events: none;
}

.flashcards-flag:focus,
.flashcards-flag:focus-visible,
.flashcards-flag:active {
  outline: none;
  box-shadow: none;
  background: transparent;
}

.flashcards-flag:hover {
  background: transparent;
  box-shadow: none;
  border: none;
}

.no-hover .flashcards-flag:hover,
.no-hover .flashcards-flag:active,
.no-hover .flashcards-flag:focus,
.no-hover .flashcards-flag:focus-visible {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  outline: none !important;
  filter: none !important;
}

.report-blur {
  position: fixed;
  inset: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(10, 12, 18, 0.24);
  z-index: 180;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

body.report-blur-open .report-blur {
  opacity: 1;
  pointer-events: auto;
}

.report-sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 68px;
  width: min(100%, 420px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px 16px 12px 12px;
  box-shadow: 0 -16px 30px rgba(8, 4, 14, 0.75);
  padding: 12px;
  z-index: 190;
  display: grid;
  gap: 10px;
}

.report-sheet.hidden {
  display: none;
}

.report-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.report-sheet-title {
  font-weight: 700;
  font-size: 14px;
}

.report-sheet-close {
  background: transparent;
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
}

.report-sheet-body {
  display: grid;
  gap: 10px;
}

.report-option {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
}

.report-other {
  display: grid;
  gap: 10px;
}

.report-other.hidden {
  display: none;
}

.report-other textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--ink);
  min-height: 120px;
  resize: vertical;
}

.report-other button {
  width: 100%;
  border-radius: 12px;
}

.flashcards-flag svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.flashcards-flag.hidden {
  display: none;
}

.flashcards-tab {
  border: 0;
  background: transparent;
  padding: 10px 12px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 999px;
  text-align: center;
  color: var(--ink);
  position: relative;
  z-index: 1;
}

.flashcards-tab:hover {
  background: transparent;
}

.flashcards-tab.active {
  font-weight: 700;
  background: transparent;
}

.flashcards-pane {
  display: none;
}

.flashcards-pane.active {
  display: block;
}

.flashcards-perfect-note {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.flashcards-header {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  padding-left: 54px;
  min-height: 26px;
  flex-wrap: wrap;
  padding-right: 44px;
  position: relative;
  --mascot-w: 38px;
  --mascot-h: 38px;
  background: none;
}

.flashcards-header .flashcards-mascot {
  position: absolute;
  right: 12px;
  top: 50%;
  width: var(--mascot-w);
  height: var(--mascot-h);
  transform: translateY(-50%) translateZ(0);
  transform-origin: center;
  pointer-events: none;
  z-index: 2;
  background: url("/assets/sushis/sushilingo4.png") center / contain no-repeat;
  backface-visibility: hidden;
  will-change: transform;
}

.flashcards-header .flashcards-mascot::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: block;
  z-index: 2;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%2300d9ff'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%23ff8af0'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%2300ffd1'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%23ffb347'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%238aff7a'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%23ff6b6b'/></svg>");
  background-repeat: no-repeat;
  background-position:
    12% 18%,
    74% 14%,
    34% 48%,
    82% 56%,
    18% 76%,
    62% 80%;
  background-size:
    0 0,
    0 0,
    0 0,
    0 0,
    0 0,
    0 0;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 6px rgba(255, 230, 190, 0.35));
  opacity: 1;
  animation: mascot-sparkles 3.2s ease-in-out infinite;
}

.flashcards-header .flashcards-mascot::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    315deg,
    rgba(255, 205, 140, 0.42) 0px,
    rgba(255, 205, 140, 0.42) 6px,
    rgba(255, 190, 120, 0) 10px,
    rgba(255, 190, 120, 0) 32px
  );
  background-size: 120px 120px;
  background-position: 0px -120px;
  -webkit-mask: url("/assets/sushis/sushilingo4.png") center / contain no-repeat;
  mask: url("/assets/sushis/sushilingo4.png") center / contain no-repeat;
  mix-blend-mode: screen;
  opacity: 0.85;
  animation: mascot-lines 5.2s linear infinite;
}

#flashcards-panel .flashcards-header .flashcards-mascot {
  position: absolute;
  right: 12px;
  top: 50%;
  width: var(--mascot-w);
  height: var(--mascot-h);
  transform: translateY(-50%) scaleX(-1) translateZ(0);
  transform-origin: center;
  backface-visibility: hidden;
  will-change: transform;
  pointer-events: none;
  z-index: 2;
  background: url("/assets/sushis/sushilingo3.png") center / contain no-repeat;
}

#flashcards-panel .flashcards-header .flashcards-mascot::before,
#flashcards-panel .flashcards-header .flashcards-mascot::after {
  backface-visibility: hidden;
  transform: translateZ(0);
}

#flashcards-panel .flashcards-header .flashcards-mascot::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: block;
  z-index: 2;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%2300d9ff'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%23ff8af0'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%2300ffd1'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%23ffb347'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%238aff7a'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%23ff6b6b'/></svg>");
  background-repeat: no-repeat;
  background-position:
    12% 18%,
    74% 14%,
    34% 48%,
    82% 56%,
    18% 76%,
    62% 80%;
  background-size:
    0 0,
    0 0,
    0 0,
    0 0,
    0 0,
    0 0;
  mix-blend-mode: normal;
  filter: none;
  opacity: 0.7;
  animation: mascot-sparkles 3.2s ease-in-out infinite;
}

#flashcards-panel .flashcards-header .flashcards-mascot::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    315deg,
    rgba(255, 205, 140, 0.42) 0px,
    rgba(255, 205, 140, 0.42) 6px,
    rgba(255, 190, 120, 0) 10px,
    rgba(255, 190, 120, 0) 32px
  );
  background-size: 120px 120px;
  background-position: 0px -120px;
  -webkit-mask: url("/assets/sushis/sushilingo3.png") center / contain no-repeat;
  mask: url("/assets/sushis/sushilingo3.png") center / contain no-repeat;
  mix-blend-mode: normal;
  opacity: 0.35;
  animation: mascot-lines 5.2s linear infinite;
}

#flashcards-panel .flashcards-header.flashcards-emote .flashcards-mascot {
  animation: flashcards-mascot-hop 0.7s ease-out;
}

#flashcards-panel .flashcards-header.flashcards-emote .flashcards-mascot::before {
  animation: mascot-sparkles 3.2s ease-in-out infinite;
}

#flashcards-panel .flashcards-header.flashcards-emote .flashcards-mascot::after {
  animation: mascot-lines 5.2s linear infinite;
}

.flashcards-header.flashcards-emote .flashcards-mascot {
  animation: mascot-hop 0.7s ease-out;
}

.flashcards-header.flashcards-emote .flashcards-mascot::before {
  animation: mascot-sparkles 3.2s ease-in-out infinite;
}

.flashcards-header.flashcards-emote .flashcards-mascot::after {
  animation: mascot-lines 5.2s linear infinite;
}

.flashcards-header .flashcards-mascot::before,
.flashcards-header .flashcards-mascot::after {
  backface-visibility: hidden;
  transform: translateZ(0);
}

.flashcards-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - (var(--mascot-w) + 12px));
}

.translator-header {
  border-bottom: 0;
  padding-bottom: 0;
  background: none;
}

.translator-header::after {
  display: none;
  content: none;
}

.translator-header::before {
  display: none;
  content: none;
}
.flashcards-settings {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ink);
}


.flashcards-settings label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.flashcards-settings label:not(.checkbox) select {
  min-width: 150px;
  padding: 6px 10px;
  border-radius: 10px;
}

.flashcards-settings label:not(.checkbox) input[type="range"] {
  flex: 1 0 100%;
  margin-top: 6px;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 28px;
  background: transparent;
}

.volume-slider::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background:
    linear-gradient(to right,
      rgba(255,255,255,0.12) 0%,
      rgba(255,255,255,0.12) 29%,
      rgba(255,255,255,0.4) 29%,
      rgba(255,255,255,0.4) 31%,
      rgba(255,255,255,0.12) 31%,
      rgba(255,255,255,0.12) 59%,
      rgba(255,255,255,0.4) 59%,
      rgba(255,255,255,0.4) 61%,
      rgba(255,255,255,0.12) 61%,
      rgba(255,255,255,0.12) 99%
    );
  border: 1px solid var(--border);
}

.volume-slider::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background:
    linear-gradient(to right,
      rgba(255,255,255,0.12) 0%,
      rgba(255,255,255,0.12) 29%,
      rgba(255,255,255,0.4) 29%,
      rgba(255,255,255,0.4) 31%,
      rgba(255,255,255,0.12) 31%,
      rgba(255,255,255,0.12) 59%,
      rgba(255,255,255,0.4) 59%,
      rgba(255,255,255,0.4) 61%,
      rgba(255,255,255,0.12) 61%,
      rgba(255,255,255,0.12) 99%
    );
  border: 1px solid var(--border);
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  border: 2px solid rgba(0, 0, 0, 0.15);
  margin-top: -7px;
  box-shadow: 0 0 10px rgba(115, 226, 255, 0.35);
}

.volume-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  border: 2px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 0 10px rgba(115, 226, 255, 0.35);
}

.flashcards-title {
  font-weight: 700;
  font-size: 18px;
}

.flashcards-subtitle {
  color: var(--muted);
  font-size: 12px;
  margin-top: -2px;
  line-height: 1.2;
}

.flashcards-subtitle-break {
  flex-basis: 100%;
  margin-top: -6px;
}

.flashcards-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.free-timer {
  white-space: nowrap;
}

.free-timer-value {
  min-width: 44px;
}

.timer-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 12, 0.72);
  z-index: 300;
  padding: 20px;
}

.timer-modal-card {
  width: min(340px, 92vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  position: relative;
}

.timer-modal-image {
  display: block;
  width: min(140px, 48vw);
  height: auto;
  margin: 6px auto 10px;
}

.timer-modal-mascot {
  position: relative;
  display: grid;
  place-items: center;
}

.timer-modal-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: block;
  z-index: 3;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%2300d9ff'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%23ff8af0'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%2300ffd1'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%23ffb347'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%238aff7a'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,0 62,38 100,50 62,62 50,100 38,62 0,50 38,38' fill='%23ff6b6b'/></svg>");
  background-repeat: no-repeat;
  background-position:
    12% 18%,
    74% 14%,
    34% 48%,
    82% 56%,
    18% 76%,
    62% 80%;
  background-size:
    0 0,
    0 0,
    0 0,
    0 0,
    0 0,
    0 0;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 6px rgba(255, 230, 190, 0.35));
  opacity: 1;
  animation: mascot-sparkles 3.2s ease-in-out infinite;
}

.timer-modal-title {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 6px;
}

.timer-modal-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-line;
}

.timer-modal-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}


.timer-modal-actions button {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 75%, #0b0f16), var(--button-bg));
  color: var(--ink);
  font-weight: 600;
}

.timer-modal-actions button.secondary {
  background: transparent;
  border-color: color-mix(in srgb, var(--border) 60%, transparent);
  color: var(--muted);
}

.flashcards-question {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--question-bg) 85%, #0b0f16), var(--question-bg));
  border: 1px solid var(--border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5),
    0 0 0 1px color-mix(in srgb, var(--accent) 78%, transparent),
    0 0 8px color-mix(in srgb, var(--accent) 17%, transparent),
    0 0 12px color-mix(in srgb, var(--accent) 8%, transparent);
  animation: question-glow 5.2s ease-in-out infinite;
}

.flashcards-question {
  position: relative;
  padding-right: 66px;
}

.flashcards-question.listen-only {
  padding-right: 12px;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flashcards-question.listen-only .audio-overlap {
  top: 50%;
  right: auto;
  left: 50%;
  transform: translate(-50%, -50%);
}

.picture-question {
  display: grid;
  gap: 10px;
  align-items: center;
  justify-items: stretch;
  padding-right: 12px;
}

#picture-image {
  width: 70%;
  max-width: 70%;
  display: block;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  object-fit: contain;
  max-height: 154px;
  transition: opacity 0.2s ease;
}

#picture-image.image-loading {
  opacity: 0;
}

.admin-panel {
  position: fixed;
  right: 12px;
  top: 88px;
  width: 220px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 85%, #0b0f16);
  box-shadow: 0 8px 18px rgba(8, 4, 14, 0.6);
  z-index: 30;
  font-size: 12px;
}

.admin-title {
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.admin-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.admin-actions {
  display: grid;
  gap: 6px;
  margin-bottom: 6px;
}

.admin-input {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-input input {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--ink);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.admin-status {
  color: var(--muted);
  min-height: 30px;
  white-space: pre-wrap;
}

.flashcards-question.glow-off {
  animation: none;
  box-shadow: none;
}

.custom-question.glow-off {
  animation: none;
  box-shadow: none;
}

@keyframes question-glow {
  0% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      0 10px 20px rgba(6, 8, 12, 0.5),
      0 0 0 1px color-mix(in srgb, var(--accent) 72%, transparent),
      0 0 7px color-mix(in srgb, var(--accent) 14%, transparent),
      0 0 10px color-mix(in srgb, var(--accent) 7%, transparent);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      0 10px 20px rgba(6, 8, 12, 0.5),
      0 0 0 1px color-mix(in srgb, var(--accent) 90%, transparent),
      0 0 10px color-mix(in srgb, var(--accent) 20%, transparent),
      0 0 14px color-mix(in srgb, var(--accent) 10%, transparent);
  }
  100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      0 10px 20px rgba(6, 8, 12, 0.5),
      0 0 0 1px color-mix(in srgb, var(--accent) 72%, transparent),
      0 0 7px color-mix(in srgb, var(--accent) 14%, transparent),
      0 0 10px color-mix(in srgb, var(--accent) 7%, transparent);
  }
}

.flashcards-question-text {
  font-size: var(--word-font);
  font-weight: 600;
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

#reading-question-text {
  font-size: 22px;
  line-height: 1.25;
}

@media (max-width: 640px) {
  #reading-question-text {
    font-size: 28px;
  }
}

.flashcards-question-extra {
  display: grid;
  gap: 4px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.flashcards-question-extra.hidden {
  display: none;
}

.flashcards-question-lang:empty {
  display: none;
}

.flashcards-word {
  display: inline-flex;
  align-items: center;
  padding: calc(var(--word-pad-y) - 2px) calc(var(--word-pad-x) - 4px);
  border-radius: 6px;
  background: color-mix(in srgb, var(--chip-bg) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--chip-border) 18%, transparent);
  cursor: pointer;
  font-size: var(--word-font);
  color: var(--ink);
}

.no-zoom-input,
#custom-search,
#core2000-cards-search,
#verb-dict-search,
#verb-hint {
  font-size: 16px;
}

.flashcards-word:hover {
  background: var(--chip-hover);
}

.flashcards-word-info {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.custom-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.custom-question {
  position: relative;
  padding-right: 66px;
}

.custom-question.listen-only {
  padding-right: 12px;
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-question.listen-only .audio-overlap {
  top: 50%;
  right: auto;
  left: 50%;
  transform: translate(-50%, -50%);
}

.audio-overlap {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  box-shadow: 0 6px 16px rgba(8, 4, 14, 0.45);
}

.custom-choices {
  margin-top: 12px;
}

.custom-reveal-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.custom-followup {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}

.custom-next-row {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.matching-stats {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.matching-highscore,
.matching-streak,
.matching-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
  font-weight: 600;
  font-size: 13px;
  width: auto;
  flex: 1 1 120px;
}

.game-stats {
  margin-top: 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.game-stat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
  font-weight: 600;
  font-size: 13px;
  width: auto;
  flex: 1 1 120px;
}

.game-stat-value {
  min-width: 22px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 30%, transparent);
}

.game-stat .free-timer-value {
  min-width: 44px;
}

.game-stat-icon {
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 60%, #ffb347));
}

.game-streak.pop {
  animation: streak-pop 0.25s ease;
}

.matching-highscore-value {
  min-width: 22px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 30%, transparent);
}

.matching-streak-icon {
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 60%, #ffb347));
}

.matching-streak-value {
  min-width: 22px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 40%, transparent);
}

.matching-timer .free-timer-value {
  min-width: 44px;
}

.matching-streak.pop {
  animation: streak-pop 0.25s ease;
}

@keyframes streak-pop {
  0% {
    transform: scale(1);
  }
  60% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

.matching-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  transition: opacity 0.25s ease;
}

.matching-board.fade-out {
  opacity: 0;
}

.matching-column {
  display: grid;
  gap: 10px;
}

.matching-item {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  color: var(--ink);
  border-radius: 12px;
  padding: 16px 12px;
  font-size: 14px;
  text-align: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
}

.matching-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent);
}

.matching-item.matched {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.2);
}

.custom-next-row button {
  width: auto;
  min-width: 120px;
  text-align: center;
}

#core2000-panel .custom-next-row button {
  min-width: 0;
  flex: 1;
  padding: 8px 10px;
  font-size: 0.9rem;
}

#core2000-panel .custom-next-row {
  gap: 10px;
  justify-content: space-between;
}

.custom-followup input,
.custom-section textarea,
.custom-output textarea,
.custom-edit-fields textarea,
.custom-edit-list input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--ink);
  padding: 8px 10px;
  font-family: var(--font);
}

.custom-section {
  display: grid;
  gap: 10px;
}

.custom-output {
  display: grid;
  gap: 10px;
}

.custom-output label {
  display: grid;
  gap: 6px;
}

#custom-panel .flashcards-question {
  background: linear-gradient(180deg, color-mix(in srgb, var(--question-bg) 85%, #0b0f16), var(--question-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5),
    0 0 0 1px color-mix(in srgb, var(--accent) 78%, transparent),
    0 0 8px color-mix(in srgb, var(--accent) 17%, transparent),
    0 0 12px color-mix(in srgb, var(--accent) 8%, transparent);
}

#custom-panel .custom-controls button,
#custom-panel .custom-actions button,
#custom-panel .custom-switch-btn,
#custom-panel .custom-next-row button,
#custom-panel .custom-list button,
#custom-panel .choice-btn {
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
}

#custom-panel .custom-followup input,
#custom-panel .custom-section textarea,
#custom-panel .custom-output textarea,
#custom-panel .custom-edit-fields textarea,
#custom-panel .custom-edit-list input,
#custom-panel #custom-search,
#custom-panel #custom-input {
  background: linear-gradient(180deg, color-mix(in srgb, var(--input-bg) 85%, #0b0f16), var(--input-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 16px rgba(6, 8, 12, 0.4);
}

#core2000-panel .flashcards-question {
  background: linear-gradient(180deg, color-mix(in srgb, var(--question-bg) 85%, #0b0f16), var(--question-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5),
    0 0 0 1px color-mix(in srgb, var(--accent) 78%, transparent),
    0 0 8px color-mix(in srgb, var(--accent) 17%, transparent),
    0 0 12px color-mix(in srgb, var(--accent) 8%, transparent);
}

#core2000-panel .custom-next-row button,
#core2000-panel .choice-btn {
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
}

#core2000-panel #core2000-cards-search {
  background: linear-gradient(180deg, color-mix(in srgb, var(--input-bg) 85%, #0b0f16), var(--input-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 16px rgba(6, 8, 12, 0.4);
}

#core2000-panel [data-core2000-pane="cards"] .custom-section {
  padding-top: 14px;
}

#picture-panel .flashcards-question {
  background: linear-gradient(180deg, color-mix(in srgb, var(--question-bg) 85%, #0b0f16), var(--question-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5),
    0 0 0 1px color-mix(in srgb, var(--accent) 78%, transparent),
    0 0 8px color-mix(in srgb, var(--accent) 17%, transparent),
    0 0 12px color-mix(in srgb, var(--accent) 8%, transparent);
}

#picture-panel #picture-image {
  background: linear-gradient(180deg, color-mix(in srgb, var(--card) 85%, #0b0f16), var(--card));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
}

#picture-panel .custom-next-row button,
#picture-panel .choice-btn {
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
}

#counters-panel .flashcards-question,
#reading-panel .flashcards-question {
  background: linear-gradient(180deg, color-mix(in srgb, var(--question-bg) 85%, #0b0f16), var(--question-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5),
    0 0 0 1px color-mix(in srgb, var(--accent) 78%, transparent),
    0 0 8px color-mix(in srgb, var(--accent) 17%, transparent),
    0 0 12px color-mix(in srgb, var(--accent) 8%, transparent);
}

#counters-panel .custom-next-row button,
#reading-panel .flashcards-controls button,
#reading-panel .choice-btn {
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
}

#counters-panel .counters-toggle,
#counters-panel .counters-toggle.enabled,
#counters-panel .counters-toggle.disabled {
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
}

#counters-panel #counters-question-mode {
  background: linear-gradient(180deg, color-mix(in srgb, var(--input-bg) 85%, #0b0f16), var(--input-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 16px rgba(6, 8, 12, 0.4);
}

#counters-panel .counters-question-setting.is-disabled {
  color: color-mix(in srgb, var(--muted) 78%, #fff);
}

#counters-panel .counters-question-setting.is-disabled .counters-question-setting-label {
  opacity: 0.72;
}

#counters-panel #counters-question-mode:disabled {
  opacity: 0.52;
  filter: saturate(0.72);
  pointer-events: none;
  cursor: not-allowed;
}

#verb-teacher-panel .verb-question {
  background: linear-gradient(180deg, color-mix(in srgb, var(--question-bg) 85%, #0b0f16), var(--question-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5),
    0 0 0 1px color-mix(in srgb, var(--accent) 78%, transparent),
    0 0 8px color-mix(in srgb, var(--accent) 17%, transparent),
    0 0 12px color-mix(in srgb, var(--accent) 8%, transparent);
}

#verb-teacher-panel .verb-grid button,
#verb-teacher-panel .custom-next-row button,
#verb-teacher-panel .custom-actions button {
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
  text-align: center;
}

#verb-teacher-panel #verb-hint,
#verb-teacher-panel #verb-dict-search {
  background: linear-gradient(180deg, color-mix(in srgb, var(--input-bg) 85%, #0b0f16), var(--input-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 16px rgba(6, 8, 12, 0.4);
}

.custom-output-tabs {
  margin-top: 8px;
}

.custom-edit-output {
  margin-top: 4px;
}

.custom-edit-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.custom-output-pane {
  display: none;
  padding: 12px;
}

.custom-output-pane.active {
  display: block;
}

.custom-output-pane textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
}

.custom-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.custom-edit-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.custom-edit-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.custom-edit-actions .custom-icon-btn svg {
  width: 18px;
  height: 18px;
}

.custom-edit-actions .custom-icon-btn {
  position: relative;
  overflow: visible;
}

.custom-edit-actions .custom-icon-btn.audio-pulse::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 65%, transparent);
  opacity: 0;
  animation: audio-ring 0.6s ease-out;
  pointer-events: none;
}

.custom-edit-actions .custom-icon-btn.audio-pulse svg {
  animation: audio-pop 0.5s ease-out, audio-wiggle 0.5s ease-out;
}

.custom-switch {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

#custom-panel [data-custom-pane="generate"] > .custom-switch {
  padding-top: 3px;
}

.custom-switch-btn {
  flex: 1;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--button-bg);
  color: var(--ink);
  padding: 10px 12px;
  font-weight: 600;
}

.custom-switch-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: var(--tab-active);
}

.custom-edit {
  display: grid;
  gap: 12px;
}

.custom-edit-list {
  display: grid;
  gap: 10px;
}

.custom-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 6px;
  display: grid;
  gap: 6px;
}

.custom-list button {
  text-align: left;
  border-radius: 8px;
}

.core2000-cards-progress {
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  opacity: 0.95;
}

#verb-teacher-panel #verb-dict-search {
  font-size: 16px;
  padding: 6px 8px;
}

#verb-teacher-panel .custom-list {
  max-height: 144px;
  padding: 4px;
  gap: 4px;
}

#verb-teacher-panel .custom-list button {
  font-size: 0.8rem;
  padding: 6px 8px;
}

.custom-edit-fields {
  display: grid;
  gap: 10px;
}

.counters-rows {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.counters-row {
  display: grid;
  gap: 6px;
}

.counters-toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.counters-toggle {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
}

.counters-toggle.enabled {
  background: #1f3b2f;
  border-color: #2f6b4a;
  color: #b9f6d1;
}

.counters-toggle.disabled {
  background: #3a1f2a;
  border-color: #6b2f3f;
  color: #ffc2c2;
}

.verb-game {
  display: grid;
  gap: 12px;
}

.verb-question {
  position: relative;
  padding: 12px;
  padding-right: 66px;
  padding-left: 66px;
  border-radius: 12px;
  background: var(--question-bg);
  border: 1px solid var(--border);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent) 80%, transparent),
    0 0 18px color-mix(in srgb, var(--accent) 28%, transparent);
}

.verb-question .verb-audio {
  position: absolute;
  top: 10px;
  right: 10px;
}

.verb-hero {
  display: grid;
  gap: 2px;
  justify-items: center;
  text-align: center;
}

.verb-value {
  font-size: 22px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.verb-type {
  color: var(--muted);
  font-size: 12px;
}

.verb-example {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.verb-example-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.verb-example-row .icon-button {
  flex: 0 0 auto;
}

.verb-next-row {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: space-between;
}

#verb-teacher-panel .verb-next-row button {
  flex: 0 0 auto;
  min-width: 120px;
  width: auto;
}

.verb-section {
  display: grid;
  gap: 6px;
}

.verb-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.verb-grid .choice-btn {
  text-align: center;
}

.verb-generate {
  display: grid;
  gap: 10px;
}

.verb-generate input,
.verb-generate select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--ink);
  padding: 8px 10px;
  font-family: var(--font);
}

.verb-preview {
  display: grid;
  gap: 12px;
}

.verb-preview-rows {
  display: grid;
  gap: 3px;
}

.verb-preview-rows .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.verb-preview-rows .row.clickable,
.verb-dict-body .row.clickable {
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.verb-preview-rows .row.clickable:hover,
.verb-dict-body .row.clickable:hover {
  background: color-mix(in srgb, var(--card) 70%, transparent);
}

.verb-dict-body .row.active {
  background: color-mix(in srgb, var(--card) 85%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.verb-dict-body .row.clickable::after {
  content: "›";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
  transition: transform 0.15s ease, color 0.2s ease;
}

.verb-dict-body .row.active::after {
  transform: translateY(-50%) rotate(90deg);
  color: var(--accent);
}

.verb-dict-inline {
  grid-column: 1 / -1;
  padding: 6px 8px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: color-mix(in srgb, var(--card) 70%, transparent);
}

.verb-dict-inline-line {
  margin-top: 2px;
}

.verb-dict-detail.inline-mode #verb-dict-subtitle,
.verb-dict-detail.inline-mode #verb-dict-romaji,
.verb-dict-detail.inline-mode #verb-dict-english {
  display: none;
}

.verb-dictionary {
  display: grid;
  gap: 10px;
}

.verb-dict-search-row {
  margin-top: 6px;
}

.verb-dictionary input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--ink);
  padding: 8px 10px;
  font-family: var(--font);
}

.verb-dict-body {
  display: grid;
  gap: 6px;
}

.verb-dict-body .row.clickable {
  padding: 6px 22px 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--card) 78%, transparent);
  position: relative;
}

.verb-dict-detail {
  padding-bottom: 84px;
}

.verb-dict-body .row {
  align-items: center;
  column-gap: 12px;
}

.verb-dict-body .row > div:first-child {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.verb-dict-body .row > div:last-child {
  font-weight: 600;
}

.verb-dict-detail .flashcards-label {
  margin-top: 10px;
}

.verb-dict-detail .flashcards-word-info {
  line-height: 1.4;
}

.verb-dict-detail .flashcards-word-info + .flashcards-word-info {
  margin-top: 4px;
}

.translator-panel {
  display: grid;
  gap: 12px;
}

.translator-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.translator-panel textarea,
.translator-panel select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--input-bg) 85%, #0b0f16), var(--input-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 16px rgba(6, 8, 12, 0.4);
  color: var(--ink);
  padding: 8px 10px;
  font-family: var(--font);
}

.translator-direction {
  width: 100%;
  cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 85%, #0b0f16), var(--surface));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.45);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 10px;
  margin-bottom: 8px;
  border-radius: 999px;
  font-weight: 600;
}

.translator-tone-top {
  display: grid;
  gap: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.translator-tone-top select {
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

.translator-direction:hover {
  border-color: var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent),
    0 0 12px color-mix(in srgb, var(--accent) 15%, transparent);
}

.translator-arrow {
  color: var(--accent);
}

.translator-textarea-wrap {
  position: relative;
}

.translator-textarea-wrap textarea {
  padding-right: 64px;
  padding-left: 36px;
  padding-bottom: 28px;
}

.translator-counter {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
}

.icon-button {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 85%, #0b0f16), var(--surface));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 6px 12px rgba(6, 8, 12, 0.4);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.icon-button svg {
  width: 16px;
  height: 16px;
}

.icon-button.icon-clear {
  top: 8px;
  right: 8px;
}

.icon-button.icon-copy {
  left: 8px;
  bottom: 8px;
}

.audio-icon {
  width: 44px;
  height: 38px;
  border-radius: 11px;
  padding: 6px;
}

.audio-icon svg {
  width: 100%;
  height: 100%;
}

.audio-icon.audio-pulse::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 65%, transparent);
  opacity: 0;
  animation: audio-ring 0.6s ease-out;
  pointer-events: none;
}

.audio-icon.audio-pulse svg {
  animation: audio-pop 0.5s ease-out, audio-wiggle 0.5s ease-out;
}

@keyframes audio-pop {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes audio-ring {
  0% {
    opacity: 0.55;
    transform: scale(0.92);
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

@keyframes audio-wiggle {
  0% {
    transform: rotate(0deg);
  }
  35% {
    transform: rotate(-8deg);
  }
  70% {
    transform: rotate(6deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

.icon-button:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}

.translator-output-list {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.translator-output {
  margin-top: 6px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 85%, #0b0f16), var(--surface));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 22px rgba(6, 8, 12, 0.5);
  overflow: hidden;
}

.translator-output-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.translator-output-tab {
  position: relative;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 12px 6px;
  font-weight: 600;
  font-size: 13px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0;
}

.translator-output-tab:last-child {
  border-right: none;
}

.translator-output-tab.active {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
  border-radius: 0;
}

.translator-output-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 0;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(115, 226, 255, 0.35);
}

.translator-output-tab.hidden {
  display: none;
}

.translator-output-pane {
  display: none;
  padding: 12px 44px 12px 12px;
  align-items: center;
  gap: 10px;
  position: relative;
}

.translator-output-pane.active {
  display: flex;
}

.translator-output-pane .icon-button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: auto;
}

.translator-run-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}

.translator-run-row button {
  width: 100%;
}

.translator-output-row {
  position: relative;
  padding: 10px 44px 10px 10px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 85%, #0b0f16), var(--surface));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 18px rgba(6, 8, 12, 0.45);
}

.translator-output-value .flashcards-word {
  margin-right: 4px;
  margin-bottom: 4px;
}

.translator-word-info {
  margin-top: 8px;
}

.translator-output-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}

.translator-output-value {
  min-height: 20px;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.translator-output-row .icon-button {
  right: 10px;
  bottom: 10px;
  left: auto;
}

.translator-options {
  display: grid;
  gap: 10px;
}

.translator-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.translator-mic,
.translator-run,
.translator-action-btn {
  position: relative;
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.translator-mic::after,
.translator-run::after,
.translator-action-btn::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 11px;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 10% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
    radial-gradient(120% 80% at 90% 0%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 65%);
  opacity: 0.6;
}

.translator-mic:hover,
.translator-run:hover,
.translator-action-btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 22px rgba(7, 10, 16, 0.55),
    0 0 14px color-mix(in srgb, var(--accent) 18%, transparent);
}

.translator-mic:active,
.translator-run:active,
.translator-action-btn:active {
  transform: translateY(0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 6px 14px rgba(7, 10, 16, 0.45);
}

.translator-action-btn:disabled {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 6px 12px rgba(7, 10, 16, 0.35);
}

.translator-mic {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
}

.translator-mic-label {
  font-weight: 600;
}

.translator-mic-visualizer {
  display: none;
  align-items: flex-end;
  gap: 4px;
  height: 18px;
}

.translator-mic-visualizer span {
  display: block;
  width: 5px;
  height: 8px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(115, 226, 255, 0.4);
  animation: mic-bounce 0.7s ease-in-out infinite;
}

.translator-mic-visualizer span:nth-child(2) {
  animation-delay: 0.1s;
}
.translator-mic-visualizer span:nth-child(3) {
  animation-delay: 0.2s;
}
.translator-mic-visualizer span:nth-child(4) {
  animation-delay: 0.3s;
}

.translator-mic.listening {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 14px rgba(115, 226, 255, 0.35);
}

.translator-mic.listening .translator-mic-visualizer {
  display: inline-flex;
}

.translator-mic.listening .translator-mic-label {
  color: var(--accent);
  animation: mic-pulse 1.45s ease-in-out infinite;
}

@keyframes mic-bounce {
  0%, 100% { height: 6px; }
  50% { height: 16px; }
}

.translator-mic.listening::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 12px;
  border: 1px solid rgba(115, 226, 255, 0.5);
  opacity: 0.8;
  animation: mic-ring 1.56s ease-out infinite;
  pointer-events: none;
}

@keyframes mic-ring {
  0% { transform: scale(0.9); opacity: 0.9; }
  70% { transform: scale(1.05); opacity: 0.2; }
  100% { transform: scale(1.08); opacity: 0; }
}

@keyframes mic-pulse {
  0%, 100% { letter-spacing: 0.02em; opacity: 0.7; }
  50% { letter-spacing: 0.2em; opacity: 1; }
}

.translator-voice {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
}

.translator-voice-visualizer {
  display: none;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
}

.translator-voice-visualizer span {
  display: block;
  width: 4px;
  height: 6px;
  border-radius: 4px;
  background: rgba(115, 226, 255, 0.7);
  box-shadow: 0 0 8px rgba(115, 226, 255, 0.35);
  animation: voice-bounce 0.9s ease-in-out infinite;
}

.translator-voice-visualizer span:nth-child(2) {
  animation-delay: 0.12s;
}
.translator-voice-visualizer span:nth-child(3) {
  animation-delay: 0.24s;
}

.translator-voice.playing {
  border-color: rgba(115, 226, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(115, 226, 255, 0.7), 0 0 10px rgba(115, 226, 255, 0.25);
}

.translator-voice.playing .translator-voice-visualizer {
  display: inline-flex;
}

.translator-voice.playing .translator-voice-label {
  color: rgba(115, 226, 255, 0.9);
}

@keyframes voice-bounce {
  0%, 100% { height: 5px; }
  50% { height: 12px; }
}

.translator-run {
  position: relative;
  overflow: hidden;
}

.translator-run.loading {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 12px rgba(115, 226, 255, 0.25);
}

.translator-run.loading::after {
  content: "";
  position: absolute;
  inset: -50% 0;
  background: linear-gradient(120deg, transparent, rgba(115, 226, 255, 0.3), transparent);
  animation: translator-sweep 1.2s linear infinite;
}

.translator-run.loading .translator-run-label {
  color: var(--accent);
  letter-spacing: 0.12em;
  animation: translator-pulse 1.2s ease-in-out infinite;
}

@keyframes translator-sweep {
  0% { transform: translateX(-60%); }
  100% { transform: translateX(60%); }
}

@keyframes translator-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.translator-action-btn.added {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 12px rgba(115, 226, 255, 0.25);
}

.translator-action-btn.added .translator-action-label {
  color: var(--accent);
  letter-spacing: 0.14em;
  animation: translator-pulse 0.9s ease-in-out infinite;
}

.translator-output-grid {
  display: grid;
  gap: 10px;
}

.flashcards-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.flashcards-answer {
  margin-top: 12px;
}

.answer-bank {
  min-height: calc(var(--word-min-height) + 16px);
  padding: 8px 8px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--word-gap);
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 85%, #0b0f16), var(--surface));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
}

.answer-bank.empty::before {
  content: "Tap words below to build the sentence";
  color: var(--muted);
  font-size: 12px;
  line-height: var(--word-min-height);
}

html[lang="ja"] .answer-bank.empty::before {
  content: "下の単語をタップして文を作成";
}

.flashcards-feedback {
  margin-top: 6px;
  font-weight: 600;
}

.flashcards-feedback.good {
  color: var(--success-text);
}

.flashcards-feedback.bad {
  color: var(--error-text);
}

.flashcards-reveal {
  margin-top: 6px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px dashed var(--accent);
  border-radius: 4px;
  color: var(--ink);
}

.flashcards-choices {
  margin-top: 12px;
}

.choices-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 6px;
}

.choice-btn {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
}

.choice-btn.selected {
  outline: 2px solid var(--accent);
}

.choice-btn.correct {
  background: var(--success-bg);
  border-color: var(--success-border);
}

.choice-btn.incorrect {
  background: var(--error-bg);
  border-color: var(--error-border);
}

.choice-btn.disabled {
  opacity: 0.45;
  filter: grayscale(0.35);
  cursor: default;
}

.flashcards-controls button.next-ready {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
  animation: next-glow 1.9s ease-in-out infinite;
}

.custom-next-row button.next-ready {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
  animation: next-glow 1.9s ease-in-out infinite;
}

@keyframes next-glow {
  0% {
    box-shadow:
      0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent),
      0 0 10px color-mix(in srgb, var(--accent) 18%, transparent);
  }
  50% {
    box-shadow:
      0 0 0 3px color-mix(in srgb, var(--accent) 85%, transparent),
      0 0 18px color-mix(in srgb, var(--accent) 32%, transparent);
  }
  100% {
    box-shadow:
      0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent),
      0 0 10px color-mix(in srgb, var(--accent) 18%, transparent);
  }
}

.flashcards-words {
  margin-top: 12px;
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: var(--word-gap);
  margin-top: 6px;
}

.word-chip {
  padding: var(--word-pad-y) var(--word-pad-x);
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--chip-bg) 85%, #0b0f16), var(--chip-bg));
  cursor: pointer;
  border: 1px solid var(--chip-border);
  font-size: var(--word-font);
  color: var(--ink);
  user-select: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.45);
}

.word-chip.dragging {
  opacity: 0.4;
}

.word-slot {
  display: inline-flex;
  padding: var(--word-pad-y) var(--word-pad-x);
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: var(--word-font);
  color: transparent;
  visibility: hidden;
  min-width: 18px;
  min-height: var(--word-min-height);
}

.word-slot.highlight {
  border: 1px dashed var(--accent);
  visibility: visible;
}

.answer-placeholder {
  padding: var(--word-pad-y) var(--word-pad-x);
  border-radius: 999px;
  border: 1px dashed var(--accent);
  min-width: 18px;
  min-height: var(--word-min-height);
}

.themes {
  margin-top: 0;
  padding: 48px 12px 24px;
  border: none;
  border-radius: 0;
  background: var(--card);
  box-shadow: none;
  position: relative;
  min-height: 100vh;
}

.profile {
  margin-top: 0;
  padding: 0 0 10px;
  display: grid;
  gap: 8px;
  align-content: start;
  grid-auto-rows: max-content;
}

.profile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}

.profile-actions button {
  text-align: center;
  padding: 10px 12px;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 14px;
  line-height: 1.1;
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.profile-actions button::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 11px;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 10% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
    radial-gradient(120% 80% at 90% 0%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 65%);
  opacity: 0.6;
}

.profile-actions button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 22px rgba(7, 10, 16, 0.55),
    0 0 14px color-mix(in srgb, var(--accent) 18%, transparent);
}

.profile-actions button:active {
  transform: translateY(0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 6px 14px rgba(7, 10, 16, 0.45);
}

.profile-actions #open-subscription,
.profile-actions #open-themes,
.profile-actions #open-earn,
.profile-actions #profile-logout {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  background:
    radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 60%),
    radial-gradient(140% 120% at 100% 0%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 65%),
    linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 70%, #0b0f16), var(--button-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 12px 24px rgba(6, 8, 12, 0.55),
    0 0 18px color-mix(in srgb, var(--accent) 12%, transparent);
}

.profile-actions #open-subscription::before,
.profile-actions #open-themes::before,
.profile-actions #open-earn::before,
.profile-actions #profile-logout::before {
  content: "";
  position: absolute;
  inset: -120% -60% auto;
  height: 240%;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.28) 45%, transparent 70%);
  transform: translateX(-60%);
  opacity: 0.45;
  pointer-events: none;
}

.profile-actions #open-subscription::after,
.profile-actions #open-themes::after,
.profile-actions #open-earn::after,
.profile-actions #profile-logout::after {
  background:
    radial-gradient(120% 80% at 20% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    radial-gradient(120% 80% at 80% 0%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 65%);
  opacity: 0.7;
}

.profile-actions #open-subscription:hover,
.profile-actions #open-themes:hover,
.profile-actions #open-earn:hover,
.profile-actions #profile-logout:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 14px 26px rgba(7, 10, 16, 0.6),
    0 0 22px color-mix(in srgb, var(--accent) 14%, transparent);
}

.profile-actions.affiliate-hidden #profile-logout {
  grid-column: 1 / -1;
  width: calc((100% - 8px) / 2);
  justify-self: center;
}

.profile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
  box-shadow: 0 10px 22px var(--shadow);
}

.profile-audio-card {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-audio-card .flashcards-label {
  margin: 0;
}

.profile-audio-card label {
  margin: 0;
  flex: 1;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  align-items: center;
}

.profile-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
}

.profile-value {
  color: var(--ink);
  font-weight: 600;
  font-size: 12px;
}

#profile-panel .form {
  padding: 6px 8px;
  margin-bottom: 0;
  gap: 4px 6px;
}

#profile-panel .form label {
  font-size: 11px;
}

#profile-panel select {
  padding: 4px 8px;
  font-size: 12px;
}

#profile-subscription-detail {
  white-space: pre-line;
}

.themes-back {
  position: absolute;
  top: 10px;
  left: 12px;
  border: none;
  background: transparent;
  padding: 0;
  width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  cursor: pointer;
  color: transparent;
  box-shadow: none;
}

.themes-back::before {
  content: "";
  position: relative;
  display: inline-block;
  width: 27px;
  height: 27px;
  background: url("/assets/icons/back.svg") center / contain no-repeat;
}

.themes-back:hover,
.themes-back:focus,
.themes-back:active {
  outline: none;
  box-shadow: none;
  background: transparent;
}

.themes-header {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.themes-title {
  font-size: 18px;
  font-weight: 700;
}

.themes-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.themes-list {
  display: grid;
  gap: 10px;
}

#themes-panel {
  padding: 12px 10px 16px;
}

#themes-panel .themes-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

#themes-panel .themes-back {
  position: static;
  top: auto;
  left: auto;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

#themes-panel .themes-back::before {
  width: 24px;
  height: 24px;
}

#themes-panel .themes-title {
  font-size: 16px;
  line-height: 1.1;
}

#themes-panel .themes-block {
  margin-top: 8px;
}

#themes-panel .themes-block-title {
  font-size: 11px;
  margin-bottom: 4px;
}

#themes-panel .themes-list {
  gap: 7px;
}

.subscription-panel {
  position: relative;
  overflow: visible;
  padding-top: 12px;
}

.subscription-panel .themes-back {
  z-index: 2;
}

.subscription-panel::before {
  display: none;
}

.subscription-panel::after {
  display: none;
}

.subscription-hero {
  position: relative;
  margin: 0 4px 16px;
  padding: 18px 16px 16px;
  border-radius: 18px;
  background: var(--card);
  border: none;
  box-shadow: none;
  display: grid;
  gap: 6px;
  z-index: 1;
  animation: subscription-rise 0.6s ease;
}

#subscription-panel .subscription-topbar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

#subscription-panel .themes-back {
  position: static;
  top: auto;
  left: auto;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  margin-top: 2px;
}

#subscription-panel .themes-back::before {
  width: 24px;
  height: 24px;
}

#subscription-panel .subscription-header-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.subscription-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 80%, var(--ink));
}

#subscription-panel .themes-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(110deg, #fff 10%, color-mix(in srgb, var(--accent) 80%, #fff) 60%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#subscription-panel .themes-subtitle {
  font-size: 13px;
  color: color-mix(in srgb, var(--muted) 90%, #fff);
}

.subscription-body {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 0 4px 16px;
  z-index: 1;
}

.subscription-card {
  border-radius: 18px;
  padding: 16px;
  background: var(--card);
  border: none;
  box-shadow: none;
  position: relative;
  overflow: hidden;
  animation: subscription-rise 0.7s ease;
}

.subscription-card::after {
  display: none;
}

.affiliate-panel {
  position: relative;
  overflow: visible;
  padding-top: 12px;
}

.affiliate-hero {
  margin-bottom: 12px;
}

#affiliate-panel .affiliate-topbar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

#affiliate-panel .themes-back {
  position: static;
  top: auto;
  left: auto;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  margin-top: 2px;
}

#affiliate-panel .themes-back::before {
  width: 24px;
  height: 24px;
}

#affiliate-panel .affiliate-header-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.affiliate-body {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 0 4px 16px;
  z-index: 1;
}

.affiliate-card {
  border-radius: 18px;
  padding: 16px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.02), transparent 50%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 88%, #08080c), var(--panel));
  border: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 14px 28px rgba(6, 8, 12, 0.6);
  display: grid;
  gap: 10px;
}

.affiliate-card-title {
  font-weight: 700;
  font-size: 14px;
}

.affiliate-card-text {
  font-size: 12px;
  color: var(--muted);
}

.affiliate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.affiliate-field {
  display: grid;
  gap: 6px;
}

.affiliate-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.affiliate-select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--ink);
  font-size: 12px;
}

.affiliate-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.affiliate-link {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  font-size: 12px;
  word-break: break-all;
}

.affiliate-link-disabled .affiliate-link {
  opacity: 0.7;
}

.affiliate-link-disabled button {
  opacity: 0.6;
  cursor: not-allowed;
}

.affiliate-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.affiliate-stat {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 85%, #0b0b10), var(--surface));
  display: grid;
  gap: 4px;
}

.affiliate-stat-value {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.affiliate-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}


.subscription-plan-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.subscription-plan-wrap {
  position: relative;
}

.subscription-plan-badge {
  position: absolute;
  top: -8px;
  right: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--accent) 20%, var(--panel));
  color: color-mix(in srgb, var(--accent) 90%, #fff);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 4px 10px rgba(6, 8, 12, 0.35);
  z-index: 2;
}

.subscription-plan {
  width: 100%;
  text-align: left;
  padding: 16px 46px 16px 18px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 82%, #0a0a10), color-mix(in srgb, var(--panel) 96%, #06060a));
  border: 1px solid color-mix(in srgb, var(--border) 85%, #000);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 20px rgba(6, 8, 12, 0.65);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.subscription-plan::after {
  content: ">";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: color-mix(in srgb, var(--accent) 70%, var(--ink));
}

.subscription-plan-wrap.is-featured .subscription-plan {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background:
    radial-gradient(140% 140% at 0% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 78%, #0a0a10), color-mix(in srgb, var(--panel) 92%, #050509));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 14px 26px rgba(6, 8, 12, 0.7),
    0 0 18px color-mix(in srgb, var(--accent) 10%, transparent);
}

.subscription-plan:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--border) 85%, #000);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 20px rgba(6, 8, 12, 0.65);
}

.subscription-plan-wrap.is-featured .subscription-plan:hover {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 14px 26px rgba(6, 8, 12, 0.7),
    0 0 18px color-mix(in srgb, var(--accent) 10%, transparent);
}

.subscription-plan:focus,
.subscription-plan:focus-visible,
.subscription-plan:active {
  outline: none;
  transform: none;
  border-color: color-mix(in srgb, var(--border) 85%, #000);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 20px rgba(6, 8, 12, 0.65);
}

.subscription-plan-wrap.is-featured .subscription-plan:focus,
.subscription-plan-wrap.is-featured .subscription-plan:focus-visible,
.subscription-plan-wrap.is-featured .subscription-plan:active {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 14px 26px rgba(6, 8, 12, 0.7),
    0 0 18px color-mix(in srgb, var(--accent) 10%, transparent);
}

.subscription-fineprint {
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.subscription-code-btn {
  margin-top: 12px;
  width: 100%;
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 86%, #0a0a10), color-mix(in srgb, var(--panel) 96%, #06060a));
  border: 1px dashed color-mix(in srgb, var(--border) 85%, transparent);
  color: color-mix(in srgb, var(--muted) 95%, #fff);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.subscription-code-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: color-mix(in srgb, var(--accent) 85%, #fff);
}

.subscription-member-message {
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 86%, #0b0f16), var(--panel));
  padding: 14px;
  display: grid;
  gap: 6px;
  text-align: center;
}

.subscription-member-title {
  font-weight: 700;
  font-size: 16px;
}

.subscription-member-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.subscription-member-actions {
  margin-top: 12px;
}

.subscription-cancel-btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 85%, #0b0f16), var(--panel));
  color: var(--ink);
  font-weight: 600;
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.55);
}

.subscription-cancel-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.subscription-cancel-btn.subscription-action-pending,
.subscription-resume-btn.subscription-action-pending {
  position: relative;
  opacity: 1;
  filter: none;
  cursor: wait;
}

.subscription-cancel-btn.subscription-action-pending::after,
.subscription-resume-btn.subscription-action-pending::after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  vertical-align: -2px;
  animation: subscription-action-spin 0.75s linear infinite;
}

@keyframes subscription-action-spin {
  to {
    transform: rotate(360deg);
  }
}

.subscription-resume {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 86%, #0b0f16), var(--panel));
}

.subscription-resume-text {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.subscription-resume-btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: linear-gradient(135deg, #ffc56f, #ff9e55);
  color: #1a1208;
  font-weight: 700;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 22px rgba(6, 8, 12, 0.55);
}

.subscription-resume-btn:hover,
.subscription-resume-btn:active,
.subscription-resume-btn:focus,
.subscription-resume-btn:focus-visible {
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
  background: linear-gradient(135deg, #ffc56f, #ff9e55);
  color: #1a1208;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 22px rgba(6, 8, 12, 0.55);
  outline: none;
  transform: none;
  filter: none;
}

.subscription-confirm {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.75);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 140;
}

.subscription-confirm-card {
  width: min(320px, 92vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  display: grid;
  gap: 10px;
}

.subscription-confirm-mascot {
  position: relative;
  display: grid;
  place-items: center;
}

.subscription-confirm-image {
  width: min(120px, 42vw);
  height: auto;
  display: block;
}

.subscription-confirm-title {
  font-weight: 700;
  font-size: 16px;
}

.subscription-confirm-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.subscription-confirm-actions {
  display: grid;
  gap: 8px;
}

.subscription-confirm-btn {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 75%, #0b0f16), var(--button-bg));
  color: var(--ink);
  font-weight: 600;
  text-align: center;
}

.subscription-confirm-btn.secondary {
  background: transparent;
  color: var(--muted);
}

.subscription-confirm-btn.is-resume {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  background: linear-gradient(135deg, #ffc56f, #ff9e55);
  color: #1a1208;
  font-weight: 700;
}

.subscription-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 150;
}

.subscription-perks-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 10px;
}

.subscription-perks {
  display: grid;
  gap: 10px;
}

.subscription-perk {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.4;
}

.subscription-perk::before {
  content: "*";
  font-size: 12px;
  color: color-mix(in srgb, var(--accent) 85%, #fff);
  margin-top: 2px;
}

.subscription-panel .themes-block-title,
#subscription-panel .themes-block-title {
  font-size: 13px;
}

@keyframes subscription-rise {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .subscription-hero,
  .subscription-card {
    animation: none;
  }
}
.themes-block {
  margin-top: 12px;
}

.themes-block-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.theme-option {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  text-align: left;
}

.theme-option.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

#themes-panel .theme-option {
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.2;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
}

#themes-panel .theme-option.active {
  border-color: var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5),
    0 0 0 2px var(--accent);
}

.themes-preview {
  margin-top: 16px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.themes-preview-title {
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 6px;
}
.flashcards-controls {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.flashcards-controls.right {
  justify-content: flex-end;
}

#flashcards-check {
  margin-left: auto;
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
}

.flashcards-fields {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.flashcards-field {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: var(--field-bg);
}

.flashcards-field-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
}

.flashcards-field-value {
  margin-top: 4px;
  font-weight: 600;
  font-size: 13px;
  word-break: break-word;
}

.romaji-section {
  margin-top: 0;
  padding: 12px;
  border-radius: 0 0 12px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  gap: 10px;
}

.romaji-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  width: 100%;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  background: var(--panel);
  margin-top: 12px;
  margin-bottom: 0;
}

.romaji-tab {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  cursor: pointer;
  text-align: center;
}

.romaji-tab.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.romaji-tab + .romaji-tab {
  border-left: 1px solid var(--border);
}

.romaji-convo-pane {
  display: none;
}

.romaji-convo-pane.active {
  display: block;
}

.romaji-game-pane {
  display: none;
}

.romaji-game-pane.active {
  display: block;
}

.romaji-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.romaji-log {
  min-height: 160px;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 13px;
}

.romaji-message {
  margin-bottom: 8px;
  line-height: 1.4;
}

.romaji-message.romaji-loading {
  opacity: 0.85;
}

.romaji-message.you strong {
  color: var(--accent);
}

.romaji-message.tutor strong {
  color: #ff9bd3;
}

.romaji-message.helper strong {
  color: #7fc8ff;
}

.romaji-settings .romaji-label {
  font-size: 14px;
}

.romaji-settings .form-row label,
.romaji-settings .checkbox span {
  font-size: 14px;
}

.romaji-settings select {
  font-size: 15px;
  padding: 10px 12px;
  border-radius: 12px;
}

.romaji-settings .checkbox input[type="checkbox"] {
  width: 54px;
  height: 32px;
}

.romaji-input textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
}

.romaji-input {
  display: grid;
  gap: 10px;
}

.romaji-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0;
}

.romaji-buttons button {
  text-align: center;
  padding: 10px 12px;
  font-size: 14px;
}

.romaji-meaning-row {
  display: flex;
  justify-content: flex-end;
}

.romaji-meaning-btn {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.romaji-meaning-btn:hover {
  color: var(--ink);
  background: var(--surface);
}

.romaji-buttons + .romaji-buttons {
  margin-top: 10px;
}

.romaji-helper-back {
  grid-template-columns: 1fr;
}

.romaji-words {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.romaji-words-label {
  font-size: 12px;
  color: var(--muted);
  margin-right: 8px;
  align-self: center;
}

.romaji-status {
  color: var(--muted);
  font-size: 12px;
}

.romaji-choices {
  display: grid;
  gap: 10px;
}

@media (max-width: 520px) {
  .romaji-input textarea {
    font-size: 16px;
    padding: 8px;
  }

  .romaji-buttons {
    gap: 10px;
  }

  .romaji-buttons button {
    font-size: 13px;
    padding: 9px 10px;
  }

  .romaji-words {
    gap: 8px;
  }
}

@media (max-width: 700px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

@media (hover: none) {
  button:hover {
    background: var(--button-bg);
  }

  .tab:hover {
    background: transparent;
  }

  .button-stack button:hover {
    transform: none;
    border-color: color-mix(in srgb, var(--border) 70%, transparent);
    background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      0 10px 20px rgba(6, 8, 12, 0.5);
  }

  .app-loading-close:hover {
    border-color: color-mix(in srgb, var(--border) 70%, transparent);
  }

  .home-forgot:hover {
    color: var(--muted);
    text-decoration: none;
  }

  .home-legal a:hover {
    color: var(--muted);
    text-decoration: none;
  }

  .admin-panel-btn:hover {
    border-color: color-mix(in srgb, var(--border) 70%, transparent);
  }

  .flashcards-word:hover {
    background: color-mix(in srgb, var(--chip-bg) 18%, transparent);
  }

  .verb-preview-rows .row.clickable:hover,
  .verb-dict-body .row.clickable:hover {
    background: transparent;
  }

  .translator-direction:hover {
    border-color: color-mix(in srgb, var(--border) 70%, transparent);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      0 10px 20px rgba(6, 8, 12, 0.45);
  }

  .icon-button:hover {
    border-color: color-mix(in srgb, var(--border) 70%, transparent);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      0 6px 12px rgba(6, 8, 12, 0.4);
  }

  .translator-mic:hover,
  .translator-run:hover,
  .translator-action-btn:hover {
    transform: none;
    border-color: color-mix(in srgb, var(--border) 70%, transparent);
    background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      0 10px 20px rgba(6, 8, 12, 0.5);
  }

  .profile-actions button:hover {
    transform: none;
    border-color: color-mix(in srgb, var(--border) 70%, transparent);
    background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      0 10px 20px rgba(6, 8, 12, 0.5);
  }

  .profile-actions #open-subscription:hover,
  .profile-actions #open-themes:hover,
  .profile-actions #open-earn:hover,
  .profile-actions #profile-logout:hover {
    border-color: color-mix(in srgb, var(--accent) 65%, transparent);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.18),
      0 12px 24px rgba(6, 8, 12, 0.55),
      0 0 18px color-mix(in srgb, var(--accent) 12%, transparent);
  }

  .subscription-plan:hover {
    transform: none;
    border-color: color-mix(in srgb, var(--border) 85%, #000);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.05),
      0 10px 20px rgba(6, 8, 12, 0.65);
  }

  .subscription-plan-wrap.is-featured .subscription-plan:hover {
    border-color: color-mix(in srgb, var(--accent) 60%, transparent);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.1),
      0 14px 26px rgba(6, 8, 12, 0.7),
      0 0 18px color-mix(in srgb, var(--accent) 10%, transparent);
  }

  .subscription-code-btn:hover {
    border-color: color-mix(in srgb, var(--border) 85%, transparent);
    color: color-mix(in srgb, var(--muted) 95%, #fff);
  }

  .subscription-cancel-btn:hover {
    border-color: color-mix(in srgb, var(--border) 70%, transparent);
  }

  .subscription-resume-btn:hover {
    border-color: color-mix(in srgb, var(--border) 70%, transparent);
  }

  .romaji-meaning-btn:hover {
    color: var(--muted);
    background: transparent;
  }
}

.no-hover button:hover {
  background: var(--button-bg);
}

.no-hover .daily-lesson-home-btn:hover,
.no-hover .daily-lesson-home-btn:active,
.no-hover .daily-lesson-home-btn:focus,
.no-hover .daily-lesson-home-btn:focus-visible {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 75%, #fff),
    color-mix(in srgb, var(--accent) 92%, #1a1208)
  );
  color: #1a1208;
  border-color: color-mix(in srgb, var(--accent) 80%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 10px 20px rgba(6, 8, 12, 0.45),
    0 0 18px color-mix(in srgb, var(--accent) 35%, transparent);
  outline: none;
  transform: none;
  filter: none;
}

.no-hover .tab:hover,
.no-hover .tab:active,
.no-hover .tab:focus {
  background: transparent;
}

.no-hover .button-stack button:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
}

.no-hover .app-loading-close:hover {
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
}

.no-hover .home-forgot:hover {
  color: var(--muted);
  text-decoration: none;
}

.no-hover .home-legal a:hover {
  color: var(--muted);
  text-decoration: none;
}

.no-hover .admin-panel-btn:hover {
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
}

.no-hover .flashcards-word:hover {
  background: color-mix(in srgb, var(--chip-bg) 18%, transparent);
}

.no-hover .verb-preview-rows .row.clickable:hover,
.no-hover .verb-dict-body .row.clickable:hover {
  background: transparent;
}

.no-hover .translator-direction:hover {
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.45);
}

.no-hover .icon-button:hover {
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 6px 12px rgba(6, 8, 12, 0.4);
}

.no-hover .translator-mic:hover,
.no-hover .translator-run:hover,
.no-hover .translator-action-btn:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
}

.no-hover .profile-actions button:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg) 85%, #0b0f16), var(--button-bg));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(6, 8, 12, 0.5);
}

.no-hover .profile-actions #open-subscription:hover,
.no-hover .profile-actions #open-themes:hover,
.no-hover .profile-actions #open-earn:hover,
.no-hover .profile-actions #profile-logout:hover {
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 12px 24px rgba(6, 8, 12, 0.55),
    0 0 18px color-mix(in srgb, var(--accent) 12%, transparent);
}

.no-hover .subscription-plan:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--border) 85%, #000);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 20px rgba(6, 8, 12, 0.65);
}

.no-hover .subscription-plan-wrap.is-featured .subscription-plan:hover {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 14px 26px rgba(6, 8, 12, 0.7),
    0 0 18px color-mix(in srgb, var(--accent) 10%, transparent);
}

.no-hover .subscription-code-btn:hover {
  border-color: color-mix(in srgb, var(--border) 85%, transparent);
  color: color-mix(in srgb, var(--muted) 95%, #fff);
}

.no-hover .subscription-cancel-btn:hover {
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
}

.no-hover .subscription-resume-btn:hover {
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
}

.no-hover .romaji-meaning-btn:hover {
  color: var(--muted);
  background: transparent;
}

.no-hover .games-special-bubble-btn:hover,
.no-hover .games-special-bubble-btn:active,
.no-hover .games-special-bubble-btn:focus,
.no-hover .games-special-bubble-btn:focus-visible {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 75%, #fff),
    color-mix(in srgb, var(--accent) 92%, #1a1208)
  );
  color: #1a1208;
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  outline: none;
  box-shadow: 0 6px 12px rgba(6, 8, 12, 0.35);
  transform: none;
  filter: none;
}

.no-hover .flashcards-tab:hover {
  background: transparent;
}
