:root {
  color-scheme: light;
  --ink: #272622;
  --muted: #746f67;
  --line: rgba(42, 40, 36, 0.14);
  --soft-line: rgba(42, 40, 36, 0.08);
  --glass: rgba(250, 247, 240, 0.72);
  --glass-strong: rgba(255, 253, 248, 0.86);
  --shadow: 0 18px 55px rgba(51, 45, 37, 0.16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(222, 216, 205, 0.92), rgba(238, 234, 226, 0.94)),
    #e5dfd3;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 10;
  width: min(calc(100% - 48px), 1040px);
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 18px;
  border: 1px solid var(--soft-line);
  border-radius: 18px;
  background: rgba(250, 247, 240, 0.78);
  box-shadow: 0 18px 45px rgba(59, 54, 46, 0.1);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.brand,
.site-nav {
  display: inline-flex;
  align-items: center;
}

.brand {
  gap: 9px;
  font-weight: 850;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #9ba899, #c7b5a4);
  box-shadow: inset 0 0 0 1px rgba(39, 38, 34, 0.08);
}

.site-nav {
  gap: 6px;
}

.site-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  transition: background-color 0.45s ease, color 0.45s ease;
}

.site-nav a:hover {
  background: rgba(39, 38, 34, 0.07);
  color: var(--ink);
}

.home-page main {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 118px 24px 72px;
}

.home-hero {
  min-height: calc(100vh - 150px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: center;
  gap: clamp(48px, 8vw, 110px);
}

.hero-copy {
  max-width: 620px;
  padding: 8vh 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-hero h1 {
  max-width: 12em;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-text {
  max-width: 520px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.primary-link,
.ghost-link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  transition: transform 0.45s ease, background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease;
}

.primary-link {
  background: var(--ink);
  color: #f8f4ed;
}

.ghost-link {
  border: 1px solid var(--line);
  color: var(--muted);
}

.primary-link:hover,
.ghost-link:hover {
  transform: translateY(-2px);
}

.ghost-link:hover {
  border-color: rgba(39, 38, 34, 0.26);
  color: var(--ink);
}

.portrait-panel {
  min-height: 520px;
  display: grid;
  place-items: center;
  padding: 15%;
  border: 1px solid var(--soft-line);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.42);
  box-shadow: 0 24px 70px rgba(59, 54, 46, 0.12);
}

.portrait-art {
  position: relative;
  width: min(100%, 270px);
  aspect-ratio: 3 / 4;
  border-radius: 28px;
  background:
    radial-gradient(circle at 28% 26%, rgba(171, 190, 176, 0.92), transparent 34%),
    radial-gradient(circle at 72% 38%, rgba(179, 147, 141, 0.82), transparent 38%),
    linear-gradient(135deg, #d8d1c7, #a8b0a6 52%, #c7b1a2);
  box-shadow: 0 28px 70px rgba(65, 60, 53, 0.18);
  overflow: hidden;
}

.art-block {
  position: absolute;
  border-radius: 999px;
  opacity: 0.84;
}

.art-block-a {
  width: 46%;
  height: 46%;
  left: 18%;
  top: 13%;
  background: #b9c4ad;
}

.art-block-b {
  width: 54%;
  height: 54%;
  right: -12%;
  bottom: 10%;
  background: #a7b4b0;
}

.art-block-c {
  width: 32%;
  height: 32%;
  left: 16%;
  bottom: 16%;
  background: #c6a89e;
}

.home-section {
  padding: 96px 0;
}

.section-heading {
  max-width: 620px;
  margin-bottom: 30px;
}

.section-heading h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.14;
  letter-spacing: 0;
}

.works-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  padding: 20px 0;
}

.work-description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 8px; /* reduce margin between title and description */
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 20px 76px 20px;
  border: 1px solid var(--soft-line);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.56);
  box-shadow: 0 18px 58px rgba(59, 54, 46, 0.1);
  transition: transform 0.48s ease, border-color 0.48s ease, box-shadow 0.48s ease;
  height: 100%;
}

.project-card:hover {
  border-color: rgba(39, 38, 34, 0.2);
  box-shadow: 0 24px 70px rgba(59, 54, 46, 0.15);
  transform: translateY(-4px);
}

.project-preview {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 10%;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(216, 209, 199, 0.78), rgba(235, 230, 221, 0.72));
}

.phone-preview {
  width: min(100%, 132px);
  aspect-ratio: 9 / 19.5;
  border-radius: 24px;
  background:
    radial-gradient(circle at 38% 28%, rgba(193, 173, 156, 0.9), transparent 36%),
    radial-gradient(circle at 72% 70%, rgba(146, 166, 158, 0.95), transparent 42%),
    linear-gradient(155deg, #d7d0c3, #95a79e 58%, #b9938f);
  box-shadow: 0 18px 42px rgba(65, 60, 53, 0.18);
}

.project-copy {
  max-width: 470px;
}

.project-copy h3 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.project-copy p:last-child,
.about-section > p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.project-arrow {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(39, 38, 34, 0.08);
  color: var(--ink);
  font-size: 22px;
  transition: transform 0.45s ease, background-color 0.45s ease;
}

.project-card:hover .project-arrow {
  background: rgba(39, 38, 34, 0.13);
  transform: translateX(4px);
}

.about-section {
  max-width: 760px;
  padding-bottom: 130px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.wallpaper-page .app-shell,
.cat-game-page .app-shell {
  padding-top: 100px;
  align-items: start;
}

.workspace {
  width: min(100%, 1040px);
  min-height: min(690px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 40px;
  background: var(--glass);
  border: 1px solid var(--soft-line);
  border-radius: 18px;
  box-shadow: 0 26px 80px rgba(59, 54, 46, 0.12);
  backdrop-filter: blur(22px);
}

.topbar,
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0;
}

.topbar p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.back-link {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  transition: color 0.45s ease;
}

.back-link:hover {
  color: var(--ink);
}

.style-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 13px;
  border-radius: 12px;
  background: rgba(39, 38, 34, 0.05);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.style-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a5aca0;
}

.preview-stage {
  flex: 1;
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 6px 0;
}

canvas {
  display: block;
  max-width: min(100%, 860px);
  max-height: min(48vh, 500px);
  width: auto;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #d7d1c6;
}

.size-section {
  display: grid;
  gap: 8px;
}

.size-section h2 {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  padding-left: 2px;
}

.size-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.size-grid button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(39, 38, 34, 0.12);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.62);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.size-grid button.selected {
  border-color: rgba(39, 38, 34, 0.28);
  background: rgba(39, 38, 34, 0.08);
  color: var(--ink);
}

.palette-section {
  display: grid;
  gap: 8px;
}

.palette-section h2 {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  padding-left: 2px;
}

.chip-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.chip-button {
  display: grid;
  gap: 6px;
  min-width: 56px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  text-align: center;
  transition: transform 0.45s ease, color 0.45s ease;
}

.chip-button:hover {
  color: var(--ink);
  transform: translateY(-2px) scale(1.03);
}

.chip {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1.5px solid rgba(42, 40, 36, 0.12);
  box-shadow: 0 5px 12px rgba(42, 40, 36, 0.09);
  font-size: 13px;
  font-weight: 900;
}

.hex {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
}

.actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
  transition: transform 0.45s ease, opacity 0.45s ease, background-color 0.45s ease, border-color 0.45s ease;
}

.secondary-button {
  background: rgba(39, 38, 34, 0.08);
  border: 1px solid rgba(39, 38, 34, 0.15);
}

.primary-button {
  background: var(--ink);
  color: #f8f4ed;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px) scale(1.02);
}

@media (max-width: 760px) {
  .site-header {
    top: 12px;
    width: min(calc(100% - 28px), 1040px);
    flex-wrap: nowrap;
    justify-content: space-between;
    padding: 14px 18px;
    gap: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    align-items: center;
  }
  .site-header::-webkit-scrollbar {
    display: none;
  }
  .brand, .site-nav, .auth-area {
    flex-shrink: 0;
  }
  .site-nav {
    display: none;
  }

  .site-nav a {
    padding: 4px 8px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .home-page main {
    padding: 94px 14px 50px;
  }

  .home-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 36px;
    padding-bottom: 54px;
  }

  .hero-copy {
    padding: 40px 0 0;
  }

  .hero-text {
    font-size: 16px;
  }

  .portrait-panel {
    min-height: 360px;
  }

  .home-section {
    padding: 70px 0;
  }

  /* removed project-card override */

  .project-preview {
    min-height: 180px;
  }

  /* removed project-arrow override */

  .app-shell {
    padding: 14px;
    align-items: start;
    padding-top: 90px;
  }

  .wallpaper-page .app-shell,
  .cat-game-page .app-shell {
    padding-top: 130px;
  }

  .workspace {
    min-height: calc(100vh - 28px);
    padding: 18px;
  }

  .preview-stage {
    min-height: 220px;
  }

  canvas {
    max-height: 46vh;
  }

  .topbar,
  .bottom-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .style-pill {
    align-self: flex-start;
  }

  .actions {
    width: 100%;
  }

  .primary-button,
  .secondary-button {
    flex: 1;
    padding: 0 12px;
  }

  .size-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ==========================================================================
   Auth Dialog (Login/Register Modal)
   ========================================================================== */

.auth-dialog {
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  color: var(--ink);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.auth-dialog::backdrop {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(42, 40, 36, 0.4);
}

.auth-dialog[open] {
  animation: modalIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalIn {
  0% { transform: scale(0.95) translateY(10px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.auth-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: min(calc(100vw - 32px), 400px);
  padding: 36px 32px;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--muted);
  transition: background 0.3s, color 0.3s;
}

.dialog-close:hover {
  background: var(--soft-line);
  color: var(--ink);
}

.auth-card h2 {
  margin: 0;
  font-size: 24px;
}

.auth-card label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.auth-card input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.auth-card input:focus {
  outline: none;
  background: #fff;
  border-color: #a4b0a2;
  box-shadow: 0 0 0 3px rgba(164, 176, 162, 0.2);
}

.auth-message {
  margin: 0;
  font-size: 13px;
  color: #d16f6f;
  min-height: 18px;
}

/* ==========================================================================
   Profile Page
   ========================================================================== */

.profile-panel {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px;
}

.profile-layout {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 40px;
  background: rgba(250, 247, 240, 0.5);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 12px 36px rgba(51, 45, 37, 0.04);
}

.avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.avatar-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(42, 40, 36, 0.1);
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-upload-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(39, 38, 34, 0.4);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 24px;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.3s;
}

.avatar-wrapper:hover .avatar-upload-overlay {
  opacity: 1;
}

.avatar-help {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-section-title {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--soft-line);
}

.form-group label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.form-group input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.form-group input:focus {
  outline: none;
  background: #fff;
  border-color: #a4b0a2;
  box-shadow: 0 0 0 3px rgba(164, 176, 162, 0.2);
}

.form-message {
  font-size: 14px;
  min-height: 20px;
  margin: 0;
}

/* ==========================================================================
   Admin User List Avatar
   ========================================================================== */

.user-row-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(42, 40, 36, 0.08);
}

/* ==========================================================================
   Admin UI
   ========================================================================== */

.admin-shell {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px 64px;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 48px 0 32px;
}

.admin-panel {
  background: rgba(250, 247, 240, 0.5);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 12px 36px rgba(51, 45, 37, 0.04);
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.admin-panel-head h2 {
  margin: 0;
  font-size: 20px;
}

.user-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) 1fr 1fr 1.5fr 1fr 2fr;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.user-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.user-info strong {
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.user-actions button {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--soft-line);
  font-size: 13px;
  transition: background 0.2s;
  cursor: pointer;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}

.user-actions button:hover {
  background: rgba(255, 255, 255, 1);
  border-color: var(--line);
}

.user-actions button.danger {
  color: #d16f6f;
  background: rgba(209, 111, 111, 0.1);
  border-color: rgba(209, 111, 111, 0.2);
}

.user-actions button.danger:hover {
  background: rgba(209, 111, 111, 0.15);
  border-color: rgba(209, 111, 111, 0.3);
}

@media (max-width: 800px) {
  .user-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .user-actions {
    justify-content: flex-start;
    margin-top: 8px;
  }
}

/* ==========================================================================
   Header Auth Area
   ========================================================================== */

.auth-area {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.auth-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-link:hover {
  color: var(--ink);
}

.auth-link.strong {
  font-weight: 700;
  color: var(--ink);
}

.auth-status {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.auth-status:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Learn Module
   ========================================================================== */

.learn-page {
  background: var(--bg);
}

.learn-main {
  width: min(calc(100% - 48px), 1040px);
  margin: 0 auto;
  padding: 100px 0 48px;
}

.learn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.progress-bar-container {
  flex: 1;
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
  margin-right: 16px;
}

.progress-bar {
  height: 100%;
  background: var(--ink);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-stats {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  min-width: 48px;
  text-align: right;
}

.flashcard-container {
  perspective: 1000px;
  margin-bottom: 48px;
}

.flashcard {
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 64px 32px;
  box-shadow: 0 12px 36px rgba(51, 45, 37, 0.04);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 400px;
}

.card-pinyin {
  font-size: 48px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.card-definition {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 48px;
  max-width: 80%;
  line-height: 1.5;
}

.card-input-area {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  margin: auto auto 0;
}

.learn-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 18px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.learn-input:focus {
  background: #fff;
  border-color: var(--muted);
}

.feedback-area {
  margin-top: 24px;
  font-size: 14px;
  font-weight: 700;
  height: 20px;
}

.feedback-area.success {
  color: #7a9c78; /* Soft Morandi green */
}

.feedback-area.error {
  color: #d16f6f; /* Soft Morandi red */
}

.vocab-manager {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  margin-top: 64px;
}

.vocab-manager h3 {
  margin-top: 0;
  margin-bottom: 24px;
  font-size: 18px;
  color: var(--ink);
}

.vocab-form {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.vocab-form input {
  flex: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

.vocab-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vocab-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.4);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--soft-line);
  font-size: 14px;
}

.vocab-item-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vocab-item-pinyin {
  color: var(--muted);
  font-family: monospace;
}

.vocab-item-def {
  font-size: 12px;
  color: var(--muted);
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
  width: 100%;
}

.word-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 24px;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform 0.1s, background 0.2s;
  user-select: none;
}

.word-block:active {
  transform: scale(0.95);
  background: var(--glass);
}

@media (max-width: 800px) {
  .vocab-form {
    flex-direction: column;
  }
}

/* Icon Button & Danger Button Styles */
.icon-button {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.icon-button:hover {
  background: var(--glass);
  color: var(--ink);
}

.icon-button.danger, button.danger {
  color: #d16f6f;
  background: rgba(209, 111, 111, 0.05);
  border-color: rgba(209, 111, 111, 0.2);
}

.icon-button.danger:hover, button.danger:hover {
  background: rgba(209, 111, 111, 0.15);
  color: #c05c5c;
  border-color: rgba(209, 111, 111, 0.4);
}

@media (max-width: 760px) {
  .learn-main {
    padding-top: 130px;
  }
  .flashcard {
    padding: 32px 16px;
  }
  .card-input-area {
    flex-wrap: wrap;
    justify-content: center;
  }
  .learn-input {
    flex: 1 1 100%;
  }
}
