* { box-sizing: border-box; }

:root {
  --green-950: #061a14;
  --green-900: #0b241c;
  --green-800: #12382c;
  --green-700: #19503d;
  --green: #00FF79;

  --cream: #0d0f0e;
  --paper: #171a19;

  --ink: #f2f5f3;
  --muted: #89938e;
  --line: #303633;

  --red: #FF005F;
  --red-soft: #351722;

  --shadow: 0 10px 30px rgba(0, 0, 0, .30);
}

@font-face {
  font-family: "Roboto Condensed";
  src: url("../assets/fonts/RobotoCondensed-VariableFont_wght.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
}

@font-face {
  font-family: "Roboto Condensed";
  src: url("../assets/fonts/RobotoCondensed-Italic-VariableFont_wght.ttf") format("truetype");
  font-style: italic;
  font-weight: 100 900;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--cream);
  color: var(--ink);
  font-family: "Roboto Condensed", sans-serif;
  padding-bottom: calc(90px + env(safe-area-inset-bottom));
}

button {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:active { transform: scale(.97); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 62px;
  padding: 0 max(18px, calc((100vw - 1040px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: var(--green-900);
  box-shadow: 0 3px 18px rgba(0,0,0,.16);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
  letter-spacing: .02em;
}

.brand-mark { font-size: 25px; }

.reset-btn {
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  color: white;
  padding: 9px 14px;
  border-radius: 12px;
  cursor: pointer;
}

.reset-icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
}

.reset-icon-btn img {
  width: 24px;
  height: 24px;
  display: block;
}

.app {
  width: min(1040px, calc(100% - 24px));
  margin: 18px auto 30px;
}

/* Rechner auf dieselbe Inhaltsbreite wie Home, Games und Account begrenzen */
.rechner-app {
  max-width: 840px;
}

.hero {
  background: var(--green-900);
  color: white;
  border-radius: 24px;
  padding: 24px;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  opacity: .7;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 6px;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1;
}

.hero-copy {
  margin: 0;
  color: rgba(255,255,255,.72);
}

.score-pill {
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 800;
}

.dot {
  opacity: .45;
  padding: 0 5px;
}

.card {
  background: var(--paper);
  border: 1px solid rgba(30,45,40,.08);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.section-heading > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.step {
  font-size: 12px;
  font-weight: 900;
  color: var(--green);
  letter-spacing: .1em;
}

.section-heading h2 {
  margin: 0;
  font-size: 25px;
}

.section-total {
  font-weight: 900;
  color: var(--green);
}


/* ========================================
   YAKU-AUSWAHL
======================================== */

.selected-yaku-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
  background: rgba(255,255,255,.015);
}

.selected-yaku-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.selected-yaku-heading strong {
  font-size: 15px;
}

.selected-yaku-heading span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.selected-yaku-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.selected-yaku-empty {
  color: var(--muted);
  font-size: 13px;
}

.selected-yaku-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 5px 5px 5px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(47, 48, 44);
}

.selected-yaku-name {
  font-weight: 800;
  font-size: 13px;
}

.selected-yaku-value {
  color: var(--green);
  font-weight: 900;
  font-size: 12px;
}

.selected-yaku-remove {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,0,95,.45);
  border-radius: 9px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.yaku-groups {
  display: grid;
  gap: 9px;
  margin-bottom: 18px;
}

.yaku-group {
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  background: rgba(255,255,255,.01);
}

.yaku-group summary {
  min-height: 54px;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.yaku-group summary::-webkit-details-marker {
  display: none;
}

.yaku-group-title {
  min-width: 0;
  font-weight: 900;
  font-size: 15px;
  line-height: 1.2;
}

.yaku-group-right {
  display: flex;
  align-items: center;
  gap: 9px;
}

.yaku-group-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.yaku-chevron {
  color: var(--green);
  font-size: 25px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .18s ease;
}

.yaku-group[open] .yaku-chevron {
  transform: rotate(90deg);
}

.yaku-options {
  border-top: 1px solid var(--line);
}

.yaku-option {
  width: 100%;
  min-height: 62px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.yaku-option:last-child {
  border-bottom: 0;
}

.yaku-option:hover {
  background: rgba(255,255,255,.025);
}

.yaku-option.is-selected {
  background: rgba(0,255,121,.055);
}

.yaku-option:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.yaku-option:disabled:active {
  transform: none;
}

.yaku-option-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.yaku-option-copy strong {
  font-size: 15px;
}

.yaku-option-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.yaku-option-value {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.yaku-option:disabled .yaku-option-value {
  max-width: 190px;
  color: var(--muted);
  line-height: 1.25;
  white-space: normal;
}

.yaku-dora-row {
  margin-top: 2px;
}

.control-row,
.honba-row,
.fu-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.control-copy {
  display: grid;
  gap: 4px;
}

.control-copy strong,
.fu-copy strong {
  font-size: 16px;
}

.control-copy span,
.fu-copy span {
  color: var(--muted);
  font-size: 13px;
}

.stepper {
  display: grid;
  grid-template-columns: 48px 58px 48px;
  height: 48px;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.stepper button,
.mini-stepper button {
  border: 0;
  cursor: pointer;
  font-size: 23px;
  font-weight: 800;
}

.stepper .minus,
.mini-stepper .minus {
  background: #59625f;
  color: #f6f4ef;
}

.stepper .plus,
.mini-stepper .plus {
  background: #59625f;
  color: #f6f4ef;
}

.stepper output,
.mini-stepper output {
  display: grid;
  place-items: center;
  background: rgb(47, 48, 44);
  font-weight: 900;
  font-size: 17px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.choice-card {
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 15px;
  display: grid;
  gap: 14px;
}

.choice-card > div:first-child {
  display: grid;
  gap: 4px;
}

.choice-card span {
  color: var(--muted);
  font-size: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.segmented button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #f6f4ef;
  background: #59625f;
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
}

.segmented button.active-yes {
  background: var(--red);
  color: white;
  border-color: var(--green-900);
}

.segmented button.active-no {
  background: var(--red);
  color: var(--ink);
}

.dora-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dora-group label {
  display: grid;
  gap: 5px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.mini-stepper {
  display: grid;
  grid-template-columns: 35px 42px 35px;
  height: 40px;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.mini-stepper button { font-size: 19px; }

.hint {
  color: var(--muted);
  font-size: 13px;
  margin: -8px 0 12px;
}

.fu-line .segmented {
  grid-column: 1 / -1;
  width: 100%;
}

.fu-block {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 18px;
}

.fu-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.fu-title h3 {
  margin: 0;
  font-size: 18px;
}

.fu-title span {
  color: var(--muted);
  font-size: 12px;
}

.fu-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.fu-subgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.fu-cell {
  min-width: 0;
  padding: 14px 12px;
  border-right: 1px solid var(--line);
  display: grid;
  gap: 8px;
  align-content: start;
}

.fu-subgrid .fu-cell:last-child {
  border-right: 0;
}

.fu-cell strong {
  font-size: 12px;
  line-height: 1.3;
}

.fu-cell span {
  color: var(--green);
  font-weight: 800;
  font-size: 16px;
  text-align: right;
}

.stepper.compact {
  grid-template-columns: 1fr 1.2fr 1fr;
  height: 48px;
  width: 100%;
  max-width: 154px;
  margin-left: auto;
}

.fu-value {
  color: var(--green);
  font-weight: 900;
  text-align: right;
  align-self: center;
}

.result-card {
  background: linear-gradient(135deg, #123e35, #1f624f);
  color: white;
  border-radius: 22px;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow);
}

.result-yaku {
  margin: 0 0 8px;
  color: rgba(255,255,255,.72);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.result-yaku:empty {
  display: none;
}

.result-card h2 { margin-bottom: 6px; }

.result-card p {
  margin: 0;
  color: var(--green);
  font-size: 16px;
  font-weight: 800;
}

.result-score {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 8px;
}

.result-score strong {
  font-size: 36px;
  color: #9be49b;
  text-align: right;
  justify-self: end;
}

.result-score span {
  font-size: 13px;
  color: rgba(255,255,255,.72);
}

.mobile-bar {
  position: fixed;
  z-index: 30;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: 70px;

  padding:
    10px
    max(16px, env(safe-area-inset-right), calc((100vw - 840px) / 2))
    max(10px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left), calc((100vw - 840px) / 2));

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(14,47,41,.96);
  color: white;
  backdrop-filter: blur(16px);
  box-shadow: 0 -8px 25px rgba(0,0,0,.14);
}

.mobile-bar button {
  border: 0;
  background: #e8f1ea;
  color: var(--green-900);
  border-radius: 12px;
  padding: 12px 15px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 800px) {
  .choice-grid { grid-template-columns: 1fr; }

  .fu-group-row {
    grid-template-columns: 1fr;
  }

  .fu-subgrid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .score-pill {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .app {
    width: min(100% - 12px, 1040px);
    margin-top: 10px;
  }

  .topbar { height: 56px; }

  .hero,
  .card,
  .result-card {
    border-radius: 18px;
  }

  .hero { padding: 19px; }
  .card { padding: 16px; }

  .control-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .control-row > .stepper {
    justify-self: start;
  }

  .dora-group {
    justify-content: flex-start;
  }

  .fu-line {
    grid-template-columns: 1fr auto;
  }

  .fu-line .fu-value {
    grid-column: 2;
    grid-row: 1;
  }

  .fu-line .segmented {
    grid-column: 1 / -1;
    width: 100%;
  }

  .fu-line .stepper {
    grid-column: 1 / -1;
  }

  .fu-subgrid {
    grid-template-columns: repeat(2, 1fr);
  }

  .fu-subgrid .fu-cell {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .fu-subgrid .fu-cell:last-child {
    border-right: 0;
  }

  .result-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-score {
    width: 100%;
    justify-content: space-between;
    grid-template-columns: auto auto auto auto;
  }

  .result-score strong {
    font-size: 30px;
  }

  .selected-yaku-panel {
    padding: 12px;
  }

  .selected-yaku-chip {
    min-height: 36px;
  }

  .yaku-group summary {
    min-height: 52px;
    padding: 12px;
  }

  .yaku-group-meta {
    display: none;
  }

  .yaku-option {
    min-height: 60px;
    padding: 11px 12px;
    gap: 10px;
  }

  .yaku-option-copy small {
    font-size: 11px;
  }

  .yaku-option-value {
    font-size: 12px;
  }

  .yaku-option:disabled .yaku-option-value {
    max-width: 125px;
  }

  .mobile-bar {
    min-height: 64px;
  }
}

/* ========================================
   ACCOUNT
======================================== */

.brand {
  text-decoration: none;
  color: inherit;
}

.account-app {
  max-width: 840px;
}

.account-back {
  min-height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.account-hero {
  margin-bottom: 16px;
  padding: 8px 4px;
}

.account-hero h1 {
  margin-bottom: 8px;
}

.account-hero > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.account-loading p {
  margin: 0;
  color: var(--muted);
}


/* ========================================
   LOGIN / REGISTER
======================================== */

.account-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}

.account-tab {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.account-tab.is-active {
  background: var(--red);
  color: white;
}

.account-form {
  display: grid;
  gap: 16px;
}

.account-field {
  display: grid;
  gap: 7px;
}

.account-field label {
  font-size: 14px;
  font-weight: 900;
}

.account-field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.account-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: rgb(47,48,44);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.account-field input:focus {
  border-color: var(--green);
}

.account-primary-btn,
.account-secondary-btn,
.account-logout-btn {
  min-height: 50px;
  padding: 0 18px;
  border-radius: 12px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.account-primary-btn {
  border: 0;
  background: var(--red);
  color: white;
}

.account-secondary-btn {
  border: 1px solid var(--line);
  background: #59625f;
  color: white;
}

.account-primary-btn:disabled,
.account-secondary-btn:disabled,
.account-logout-btn:disabled {
  opacity: .45;
  cursor: default;
}

.account-message {
  min-height: 18px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.account-message:empty {
  min-height: 0;
}

.account-message.is-error {
  color: var(--red);
}

.account-message.is-success {
  color: var(--green);
}


/* ========================================
   PROFILE
======================================== */

.account-profile {
  display: grid;
  gap: 16px;
}

.account-profile .card {
  margin-bottom: 0;
}

.account-profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.account-profile-head h2 {
  margin: 0 0 3px;
  font-size: 27px;
}

.account-avatar {
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 2px solid var(--green);
  border-radius: 50%;
  background: var(--green-900);
  color: var(--green);
  font-size: 30px;
  font-weight: 900;
}

.account-username {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.account-details {
  display: grid;
  gap: 0;
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.account-detail {
  padding: 14px 0;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.account-detail:last-child {
  border-bottom: 0;
}

.account-detail span {
  color: var(--muted);
  font-size: 13px;
}

.account-detail strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}


/* ========================================
   STATS
======================================== */

.account-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.account-stat {
  min-width: 0;
  padding: 15px 8px;
  display: grid;
  gap: 4px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.015);
}

.account-stat strong {
  color: var(--green);
  font-size: 22px;
}

.account-stat span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.account-empty-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}


/* ========================================
   GAME ACTIONS
======================================== */

.account-game-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}


/* ========================================
   LOGOUT
======================================== */

.account-logout-btn {
  width: 100%;
  border: 1px solid rgba(255,0,95,.4);
  background: var(--red-soft);
  color: var(--red);
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 520px) {

  .account-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .account-game-actions {
    grid-template-columns: 1fr;
  }

  .account-profile-head {
    align-items: flex-start;
  }

  .account-avatar {
    width: 60px;
    height: 60px;
    font-size: 26px;
  }

  .account-detail {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ========================================
   GAME CREATE / JOIN
======================================== */

.account-field select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: rgb(47,48,44);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.account-field select:focus {
  border-color: var(--green);
}

.game-tabs {
  margin-bottom: 18px;
}

.game-code-input {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 22px !important;
  font-weight: 900;
}

.game-created {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(0,255,121,.35);
  border-radius: 16px;
  background: rgba(0,255,121,.055);
  text-align: center;
}

.game-created > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
}

.game-created > strong {
  display: block;
  color: var(--green);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: .16em;
}

.game-created p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

[hidden] {
  display: none !important;
}

/* ========================================
   GAME LOBBY
======================================== */

.game-lobby-app {
  max-width: 840px;
}

.lobby-code-card {
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid rgba(0,255,121,.35);
  border-radius: 22px;
  background: rgba(0,255,121,.055);
  text-align: center;
  box-shadow: var(--shadow);
}

.lobby-code-card > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
}

.lobby-code-card > strong {
  display: block;
  color: var(--green);
  font-size: 38px;
  font-weight: 900;
  letter-spacing: .16em;
}

.lobby-code-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}


/* SPIELER */

.lobby-player-list {
  display: grid;
  gap: 8px;
}

.lobby-player {
  min-height: 66px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 44px minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.015);
}

.lobby-player.is-empty {
  opacity: .55;
}

.lobby-player-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--green);
  border-radius: 50%;
  background: var(--green-900);
  color: var(--green);
  font-size: 19px;
  font-weight: 900;
}

.lobby-player-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.lobby-player-copy strong {
  font-size: 15px;
}

.lobby-player-copy span {
  color: var(--muted);
  font-size: 12px;
}

.lobby-host-badge {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--red-soft);
  color: var(--red) !important;
  font-size: 9px !important;
  font-weight: 900;
  text-transform: uppercase;
}

.lobby-seat-badge {
  min-width: 55px;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}


/* SITZPLÄTZE */

.lobby-seat-intro {
  margin: -5px 0 15px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.lobby-seat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.lobby-seat-btn {
  min-height: 70px;
  padding: 10px 6px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #59625f;
  color: white;
  cursor: pointer;
}

.lobby-seat-btn strong {
  font-size: 15px;
}

.lobby-seat-btn span {
  max-width: 100%;
  overflow: hidden;
  color: rgba(255,255,255,.6);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-seat-btn.is-selected {
  border-color: var(--green);
  background: rgba(0,255,121,.12);
  color: var(--green);
}

.lobby-seat-btn.is-selected span {
  color: var(--green);
}

.lobby-seat-btn:disabled:not(.is-selected) {
  opacity: .35;
  cursor: default;
}


/* STATUS */

.lobby-ready-card h2 {
  margin-bottom: 6px;
}

.lobby-ready-card > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}


@media (max-width: 520px) {

  .lobby-code-card {
    border-radius: 18px;
  }

  .lobby-code-card > strong {
    font-size: 32px;
  }

  .lobby-seat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================
   GAME START
======================================== */

.lobby-start-btn {
  width: 100%;
  margin-top: 18px;
}

.lobby-ready-card .account-message {
  margin-top: 10px;
}

#seatSection.is-game-running .lobby-seat-btn {
  cursor: default;
}

/* ========================================
   GAME SCORING
======================================== */

.score-player-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.score-player-row {
  min-height: 58px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.015);
}

.score-player-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.score-player-row > div strong {
  font-size: 14px;
}

.score-player-row > div span {
  color: var(--muted);
  font-size: 12px;
}

.score-player-value {
  color: var(--green);
  font-size: 13px;
  text-align: right;
}

.score-form {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.score-summary {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  text-align: center;
}

.score-summary > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
}

.score-summary > strong {
  display: block;
  font-size: 26px;
  font-weight: 900;
}

.score-summary p {
  margin: 6px 0 0;
  font-size: 13px;
}

.score-summary.is-valid {
  border-color: rgba(0,255,121,.4);
  background: rgba(0,255,121,.055);
}

.score-summary.is-valid > strong,
.score-summary.is-valid p {
  color: var(--green);
}

.score-summary.is-invalid {
  border-color: rgba(255,0,95,.4);
  background: var(--red-soft);
}

.score-summary.is-invalid > strong,
.score-summary.is-invalid p {
  color: var(--red);
}

/* ========================================
   GAME RESULT
======================================== */

.game-result-preview {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.game-result-preview > .eyebrow {
  margin-bottom: 10px;
}

.game-result-list {
  display: grid;
  gap: 8px;
}

.game-result-row {
  min-height: 62px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.015);
}

.game-result-place {
  color: var(--green);
  font-size: 20px;
  font-weight: 900;
}

.game-result-player {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.game-result-player strong {
  font-size: 15px;
}

.game-result-player span {
  color: var(--muted);
  font-size: 12px;
}

.game-result-score {
  color: var(--green);
  font-size: 16px;
  text-align: right;
}

.game-result-note {
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

#completeGameBtn {
  width: 100%;
}

/* ========================================
   ACCOUNT STATISTIKEN
======================================== */

.account-mode-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.account-mode-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.015);
}

.account-mode-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.account-mode-head > strong {
  font-size: 15px;
  font-weight: 900;
}

.account-mode-head > span {
  color: var(--muted);
  font-size: 11px;
}

.account-mode-values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.account-mode-values > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.account-mode-values strong {
  color: var(--green);
  font-size: 19px;
  font-weight: 900;
}

.account-mode-values span {
  color: var(--muted);
  font-size: 10px;
}


/* ========================================
   LETZTE SPIELE
======================================== */

.account-recent-games {
  display: grid;
  gap: 8px;
}

.account-recent-game {
  min-height: 64px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.015);
  color: var(--ink);
  text-decoration: none;
}

.account-recent-game:hover {
  border-color: rgba(0,255,121,.4);
}

.account-recent-place {
  color: var(--green);
  font-size: 20px;
  font-weight: 900;
}

.account-recent-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.account-recent-copy strong {
  font-size: 14px;
}

.account-recent-copy span {
  color: var(--muted);
  font-size: 11px;
}

.account-recent-score {
  color: var(--green);
  font-size: 15px;
  font-weight: 900;
  text-align: right;
}


@media (max-width: 520px) {

  .account-mode-stats {
    grid-template-columns: 1fr;
  }

  .account-recent-score {
    font-size: 14px;
  }
}


/* ========================================
   ACCOUNT – AKTUELLE SPIELE
======================================== */

.account-active-games {
  display: grid;
  gap: 10px;
}

.account-active-game {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.015);
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color .15s ease,
    background .15s ease,
    transform .15s ease;
}

.account-active-game:hover {
  border-color: rgba(0,255,121,.38);
  background: rgba(0,255,121,.04);
}

.account-active-game:active {
  transform: scale(.995);
}

.account-active-game-head,
.account-active-game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-active-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.account-active-copy > strong {
  font-size: 15px;
}

.account-active-copy > span,
.account-active-game-footer > span {
  color: var(--muted);
  font-size: 12px;
}

.account-active-game-footer > strong {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.account-active-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.account-active-status.is-lobby {
  border-color: rgba(0,255,121,.35);
  background: rgba(0,255,121,.07);
  color: var(--green);
}

.account-active-status.is-running {
  border-color: rgba(0,255,121,.45);
  background: rgba(0,255,121,.12);
  color: var(--green);
}

.account-active-status.is-scoring {
  border-color: rgba(255,0,95,.35);
  background: rgba(255,0,95,.07);
  color: var(--red);
}

@media (max-width: 520px) {

  .account-active-game-head {
    align-items: flex-start;
  }

  .account-active-game-footer {
    align-items: flex-end;
  }

  .account-active-game-footer > span {
    max-width: 68%;
  }
}

/* ========================================
   GAME CANCEL
======================================== */

.lobby-cancel-btn {
  width: 100%;
  margin-top: 10px;
}

/* ========================================
   ADMINISTRATION
   An das Ende von style.css anhängen.
======================================== */

.account-admin-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid rgba(0, 255, 121, 0.25);
  border-radius: 14px;
  background: rgba(0, 255, 121, 0.06);
  text-decoration: none;
}

.account-admin-link span {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted, #9aa8a4);
}

.account-admin-link strong {
  color: #00FF79;
}

.admin-app {
  max-width: 840px;
  padding-bottom: calc(48px + env(safe-area-inset-bottom));
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-summary-item strong {
  font-size: 1.65rem;
  line-height: 1;
}

.admin-summary-item span,
.admin-section-intro,
.admin-self-note {
  color: var(--muted, #9aa8a4);
}

.admin-section-intro {
  margin: 0 0 18px;
}

.admin-user-list,
.admin-invite-list {
  display: grid;
  gap: 14px;
}

.admin-user-card {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.admin-user-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-user-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 255, 121, 0.12);
  color: #00FF79;
  font-weight: 800;
}

.admin-user-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.admin-user-title strong,
.admin-user-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-title span {
  color: var(--muted, #9aa8a4);
  font-size: 0.9rem;
}

.admin-user-badges,
.admin-invite-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-badge.is-role,
.admin-badge.is-open,
.admin-badge.is-active {
  background: rgba(0, 255, 121, 0.11);
  color: #00FF79;
}

.admin-badge.is-inactive,
.admin-badge.is-used {
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted, #9aa8a4);
}

.admin-user-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-user-email-field {
  grid-column: 1 / -1;
}

.admin-self-note {
  margin: 14px 0 0;
  font-size: 0.9rem;
}

.admin-save-user-btn {
  margin-top: 16px;
}

.admin-invite-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-invite-form .account-message {
  grid-column: 1 / -1;
}

.admin-invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-invite-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.admin-invite-copy strong,
.admin-invite-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-invite-copy span {
  color: var(--muted, #9aa8a4);
  font-size: 0.86rem;
}

.admin-small-btn {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.admin-small-btn.is-danger {
  border-color: rgba(255, 0, 95, 0.35);
  color: #FF005F;
}

.admin-small-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

@media (max-width: 640px) {
  .admin-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-summary-item {
    padding: 12px 10px;
  }

  .admin-summary-item strong {
    font-size: 1.35rem;
  }

  .admin-user-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .admin-user-badges {
    width: 100%;
    justify-content: flex-start;
    padding-left: 54px;
  }

  .admin-user-fields,
  .admin-invite-form {
    grid-template-columns: 1fr;
  }

  .admin-user-email-field,
  .admin-invite-form .account-message {
    grid-column: auto;
  }

  .admin-invite-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-invite-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* ========================================
   ADMIN – SPIELEABENDE
======================================== */

.admin-event-form,
.admin-event-edit-form {
  display: grid;
  gap: 18px;
}

.admin-event-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-event-title-field,
.admin-event-location-field,
.admin-event-description-field {
  grid-column: 1 / -1;
}

.admin-event-fields textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  box-sizing: border-box;
  font: inherit;
}

.admin-event-divider {
  height: 1px;
  margin: 26px 0;
  background: var(--border, rgba(255, 255, 255, 0.12));
}

.admin-event-list {
  display: grid;
  gap: 16px;
}

.admin-event-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 16px;
}

.admin-event-card.is-cancelled {
  opacity: 0.72;
}

.admin-event-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-event-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.admin-event-head strong {
  font-size: 1.08rem;
}

.admin-event-head span,
.admin-event-meta,
.admin-event-description {
  color: var(--muted, #9ba9a5);
}

.admin-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.92rem;
}

.admin-event-description {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-event-actions .account-primary-btn,
.admin-event-actions .admin-small-btn {
  width: auto;
}

@media (max-width: 640px) {
  .admin-event-fields {
    grid-template-columns: 1fr;
  }

  .admin-event-title-field,
  .admin-event-location-field,
  .admin-event-description-field {
    grid-column: auto;
  }

  .admin-event-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-event-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-event-actions .account-primary-btn,
  .admin-event-actions .admin-small-btn {
    width: 100%;
  }
}

/* ========================================
   ACCOUNT – NÄCHSTER SPIELEABEND
   An bestehende style.css anhängen
======================================== */

.account-event-card {
  overflow: hidden;
}

.account-event-content {
  display: grid;
  gap: 24px;
}

.account-event-main {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.account-event-datebox {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  border: 1px solid var(--line, rgba(255, 255, 255, .12));
  border-radius: 16px;
  background: rgba(0, 255, 121, .06);
  text-align: center;
}

.account-event-datebox span {
  color: var(--muted, #89938e);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.account-event-datebox strong {
  margin: 2px 0;
  color: var(--green, #00FF79);
  font-size: 2.3rem;
  line-height: 1;
}

.account-event-copy {
  min-width: 0;
}

.account-event-copy h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.account-event-datetime,
.account-event-location,
.account-event-description {
  margin: 0;
}

.account-event-datetime {
  font-weight: 700;
}

.account-event-location {
  margin-top: 6px;
  color: var(--muted, #89938e);
}

.account-event-description {
  margin-top: 14px;
  color: var(--muted, #89938e);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.account-event-attendance {
  padding-top: 22px;
  border-top: 1px solid var(--line, rgba(255, 255, 255, .12));
}

.account-event-attendance-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.account-event-attendance-head span {
  color: var(--muted, #89938e);
  font-size: .9rem;
}

.account-event-attendees {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.account-event-attendee {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line, rgba(255, 255, 255, .12));
  border-radius: 999px;
  font-size: .92rem;
}

.account-event-attendee.is-me {
  border-color: var(--green, #00FF79);
  color: var(--green, #00FF79);
}

.account-event-attendee-empty {
  margin: 0 0 18px;
}

.account-event-attendance-btn.is-attending {
  border: 1px solid var(--red, #FF005F);
  background: transparent;
  color: var(--red, #FF005F);
}

@media (max-width: 520px) {

  .account-event-main {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 14px;
  }

  .account-event-datebox {
    min-height: 96px;
    border-radius: 14px;
  }

  .account-event-datebox strong {
    font-size: 2rem;
  }

  .account-event-attendance-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

/* ========================================
   ADMIN – DATUM / UHRZEIT iOS FIX
======================================== */

.admin-event-fields {
  min-width: 0;
}

.admin-event-fields .account-field {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.admin-event-fields input[type="date"],
.admin-event-fields input[type="time"] {
  display: block;

  width: 100%;
  min-width: 0;
  max-width: 100%;

  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;

  box-sizing: border-box;

  -webkit-appearance: none;
  appearance: none;
}

/* ========================================
   ADMIN – DATUM / UHRZEIT VERTIKAL
======================================== */

.admin-event-fields input[type="date"],
.admin-event-fields input[type="time"] {
  height: 52px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: normal;
}

.admin-event-fields input[type="date"]::-webkit-date-and-time-value,
.admin-event-fields input[type="time"]::-webkit-date-and-time-value {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin: 0;
}

.admin-event-fields input[type="date"]::-webkit-datetime-edit,
.admin-event-fields input[type="time"]::-webkit-datetime-edit {
  padding: 0;
}

/* ========================================
   ACCOUNT – SPIELEABEND TEILNEHMER-AKKORDEON
   Ganz unten an style.css anhängen
======================================== */

.account-event-attendee-accordion {
  margin: 0 0 18px;
  border-top: 1px solid var(--line, rgba(255, 255, 255, .12));
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, .12));
}

.account-event-attendee-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 50px;
  padding: 0;
  color: inherit;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.account-event-attendee-accordion summary::-webkit-details-marker {
  display: none;
}

.account-event-attendee-chevron {
  position: relative;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

.account-event-attendee-chevron::before,
.account-event-attendee-chevron::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 9px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms ease;
}

.account-event-attendee-chevron::before {
  left: 1px;
  transform: rotate(45deg);
}

.account-event-attendee-chevron::after {
  right: 1px;
  transform: rotate(-45deg);
}

.account-event-attendee-accordion[open]
  .account-event-attendee-chevron::before {
  transform: rotate(-45deg);
}

.account-event-attendee-accordion[open]
  .account-event-attendee-chevron::after {
  transform: rotate(45deg);
}

.account-event-attendee-panel {
  padding: 4px 0 16px;
}

.account-event-attendee-accordion .account-event-attendees {
  margin-bottom: 0;
}

.account-event-attendee-accordion .account-event-attendee-empty {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .account-event-attendee-chevron::before,
  .account-event-attendee-chevron::after {
    transition: none;
  }
}

/* ========================================
   APP – GEMEINSAME HAUPTNAVIGATION
======================================== */

.app-topbar {
  min-height: 0;
  height: auto;
  padding-top: 0;
  padding-bottom: 3px;
  padding-left: max(12px, calc((100vw - 840px) / 2));
  padding-right: max(12px, calc((100vw - 840px) / 2));
  gap: 12px;
}

.app-home-link {
  display: block;
  min-width: 0;
  flex: 0 1 240px;
  align-self: flex-start;
}

.app-home-link .brand-mark {
  display: block;
  line-height: 0;
}

.app-home-link img {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
}

.app-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex: 0 0 auto;
}

.app-nav-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  background: rgba(255,255,255,.07);
  color: white;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
}

.app-nav-btn:active {
  transform: scale(.96);
}

.app-nav-btn img {
  display: block;
  width: 21px;
  height: 21px;
}

.app-nav-btn.is-active {
  border-color: rgba(0,255,121,.72);
  background: rgba(0,255,121,.12);
  box-shadow: inset 0 0 0 1px rgba(0,255,121,.08);
}

@media (hover: hover) and (pointer: fine) {
  .app-nav-btn:hover {
    border-color: rgba(255,255,255,.5);
    background: rgba(255,255,255,.12);
  }

  .app-nav-btn.is-active:hover {
    border-color: var(--green);
    background: rgba(0,255,121,.16);
  }
}

@media (max-width: 520px) {
  .app-topbar {
    padding-left: 10px;
    padding-right: 10px;
    gap: 8px;
  }

  .app-nav {
    gap: 5px;
  }

  .app-nav-btn {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .app-nav-btn img {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 365px) {
  .app-topbar {
    padding-left: 8px;
    padding-right: 8px;
    gap: 4px;
  }

  .app-nav-btn {
    width: 35px;
    height: 35px;
  }

  .app-nav {
    gap: 4px;
  }
}


/* ========================================
   LANDINGPAGE / HOME
======================================== */

.home-app,
.games-app,
.achievements-app {
  max-width: 840px;
}

.home-hero {
  padding: 8px 4px 2px;
  margin-bottom: 16px;
}

.home-hero h1 {
  margin: 4px 0 8px;
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1;
}

.home-hero > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.home-content,
.games-content {
  display: grid;
  gap: 16px;
}

.home-content > .card,
.games-content > .card {
  margin-bottom: 0;
}

.home-profile-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  color: inherit;
  text-decoration: none;
}

.home-avatar {
  width: 68px;
  height: 68px;
}

.home-profile-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.home-profile-copy .eyebrow {
  margin: 0 0 4px;
}

.home-profile-copy > strong {
  overflow-wrap: anywhere;
  font-size: 1.8rem;
  line-height: 1.05;
}

.home-profile-copy > span:last-child {
  color: var(--muted);
  font-weight: 700;
}

.home-card-arrow {
  color: var(--green);
  font-size: 1.5rem;
  font-weight: 900;
}

.home-section-heading {
  align-items: center;
}

.home-section-link {
  color: var(--green);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.home-more-games {
  display: block;
  padding: 8px 2px 0;
  color: var(--green);
  text-decoration: none;
  text-align: right;
  font-size: 13px;
  font-weight: 900;
}

.home-guest {
  display: grid;
}

.home-guest-card h2,
.games-auth-required h2 {
  margin-top: 0;
}

.home-guest-card > p:not(.eyebrow),
.games-auth-required > p {
  color: var(--muted);
  line-height: 1.5;
}

.home-guest-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.home-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
}

.home-event-card .account-event-main {
  margin-top: 2px;
}

@media (max-width: 520px) {
  .home-profile-card {
    gap: 14px;
  }

  .home-avatar {
    width: 60px;
    height: 60px;
  }

  .home-profile-copy > strong {
    font-size: 1.55rem;
  }

  .home-guest-actions {
    grid-template-columns: 1fr;
  }

  .home-section-heading {
    align-items: flex-start;
  }
}


/* ========================================
   SPIELE-SEITE
======================================== */

.games-auth-required .home-action-link {
  margin-top: 18px;
}


/* ========================================
   ACHIEVEMENTS – PLATZHALTER
======================================== */

.achievements-placeholder {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding-top: 36px;
  padding-bottom: 36px;
  text-align: center;
}

.achievements-placeholder-mark {
  font-size: 2.6rem;
}

.achievements-placeholder h2 {
  margin: 0;
}

.achievements-placeholder p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}


/* ========================================
   RECHNER – RESET IM HERO
======================================== */

.calculator-hero {
  flex-direction: row;
  align-items: flex-start;
}

.calculator-hero > div {
  min-width: 0;
}

.calculator-reset-btn {
  flex: 0 0 42px;
}

@media (max-width: 520px) {
  .calculator-hero {
    flex-direction: row;
    align-items: flex-start;
  }
}


/* ========================================
   SPIELE – STARTPUNKTE INFO
======================================== */

.game-starting-points-info {
  min-height: 64px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.015);
}

.game-starting-points-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.game-starting-points-copy strong {
  font-size: 14px;
}

.game-starting-points-copy span {
  color: var(--muted);
  font-size: 11px;
}

.game-starting-points-value {
  color: var(--green);
  font-size: 15px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .game-starting-points-value {
    font-size: 14px;
  }
}


/* ========================================
   SPIELE – AUSWAHLKARTEN
======================================== */

.game-create-choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.game-choice-buttons button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  padding: 7px 8px;
}

.game-choice-buttons button strong {
  font: inherit;
  font-weight: 900;
}

.game-choice-buttons button span {
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  opacity: .72;
}

.game-choice-buttons button.active-yes span {
  color: inherit;
  opacity: .82;
}

@media (max-width: 800px) {
  .game-create-choice-grid {
    grid-template-columns: 1fr;
  }
}


/* ========================================
   ADMIN – BENUTZER-AKKORDEON
======================================== */

.admin-user-card {
  padding: 0;
  overflow: hidden;
}

.admin-user-summary {
  position: relative;
  display: block;
  padding: 16px 48px 16px 16px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.admin-user-summary::-webkit-details-marker {
  display: none;
}

.admin-user-summary::marker {
  content: "";
}

.admin-user-summary::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 18px;
  color: var(--muted, #9aa8a4);
  font-size: 1.15rem;
  line-height: 1;
  transform: translateY(-55%);
  transition: transform 0.18s ease, color 0.18s ease;
}

.admin-user-card[open] .admin-user-summary::after {
  color: #00FF79;
  transform: translateY(-45%) rotate(180deg);
}

.admin-user-summary .admin-user-head {
  margin-bottom: 0;
}

.admin-user-card[open] .admin-user-summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-user-form {
  padding: 16px;
}

@media (max-width: 640px) {
  .admin-user-summary {
    padding-right: 44px;
  }

  .admin-user-summary::after {
    right: 16px;
  }
}


/* ========================================
   ACHIEVEMENTS – SAMMLUNG
======================================== */

.achievements-hero {
  margin-bottom: 16px;
}

.achievement-loading p,
.achievements-login-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.achievements-login-card {
  display: grid;
  gap: 12px;
}

.achievements-login-card h2 {
  margin: 0;
}

.achievements-login-card .home-action-link {
  width: fit-content;
  min-width: 150px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.achievement-overview {
  display: grid;
  gap: 14px;
}

.achievement-overview-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 18px;
  row-gap: 3px;
}

.achievement-overview-copy .eyebrow {
  grid-column: 1;
  margin-bottom: 0;
}

.achievement-overview-copy > strong {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: var(--green);
  font-size: 24px;
  font-weight: 900;
  white-space: nowrap;
}

.achievement-overview-copy > span:last-child {
  grid-column: 1;
  color: var(--muted);
  font-size: 13px;
}

.achievement-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
}

.achievement-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width .25s ease;
}

.achievement-group-list {
  display: grid;
  gap: 16px;
}

.achievement-group {
  padding: 0;
  margin-bottom: 0;
  overflow: hidden;
}

.achievement-group-summary {
  min-height: 86px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.achievement-group-summary::-webkit-details-marker {
  display: none;
}

.achievement-group-summary::marker {
  content: "";
}

.achievement-group-heading {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.achievement-group-heading .step {
  padding-top: 3px;
}

.achievement-group-heading h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.achievement-group-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.achievement-group-status {
  display: flex;
  align-items: center;
  gap: 11px;
}

.achievement-group-status strong {
  color: var(--green);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.achievement-group-chevron {
  color: var(--green);
  font-size: 28px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .18s ease;
}

.achievement-group[open] .achievement-group-chevron {
  transform: rotate(90deg);
}

.achievement-group[open] .achievement-group-summary {
  border-bottom: 1px solid var(--line);
}

.achievement-group-body {
  padding: 20px;
}

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

.achievement-badge {
  min-width: 0;
  padding: 12px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,255,255,.018);
  color: var(--ink);
  transition: border-color .18s ease, background .18s ease, opacity .18s ease;
}

.achievement-badge.is-unlocked {
  border-color: var(--line);
  background: rgba(255,255,255,.018);
  color: var(--ink);
}

.achievement-badge.is-locked {
  color: var(--muted);
}

.achievement-badge-icon {
  position: relative;
  isolation: isolate;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 13px;
  background: rgba(0,0,0,.55);
  color: rgba(137,147,142,.55);
}

/*
  Der dunkle Innenrahmen entsteht jetzt durch den Hintergrund der
  Icon-Fläche selbst. Die eigentliche Farbfläche beginnt erst 6 px
  weiter innen. Dadurch kann an den Rundungen kein Pink mehr zwischen
  dem weißen Außenrand und dem dunklen Innenrahmen durchblitzen.
*/
.achievement-badge-icon::before {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: 0;
  border-radius: 6px;
  background: rgba(255,255,255,.025);
  pointer-events: none;
}

.achievement-badge.is-unlocked .achievement-badge-icon {
  background: rgba(0,0,0,.94);
  border-color: rgba(255,255,255,.85);
  color: white;
}

.achievement-badge.is-unlocked .achievement-badge-icon::before {
  background: var(--red);
}

.achievement-badge.is-locked .achievement-badge-icon {
  background: rgba(0,0,0,.25);
  border-color: rgba(137,147,142,.55);
  color: rgba(137,147,142,.55);
}

.achievement-badge.is-locked .achievement-badge-icon::before {
  background: rgba(255,255,255,.025);
}

.achievement-badge-placeholder {
  font-size: clamp(38px, 7vw, 62px);
  font-weight: 900;
  line-height: 1;
}

.achievement-badge-icon img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.achievement-badge-icon.has-custom-icon .achievement-badge-placeholder {
  visibility: hidden;
}

.achievement-badge.is-locked .achievement-badge-icon img {
  filter: grayscale(1);
  opacity: .28;
}

.achievement-badge-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: center;
}

.achievement-badge-japanese {
  min-height: 15px;
  color: currentColor;
  font-size: 11px;
  font-weight: 800;
  opacity: .7;
}

.achievement-badge-copy strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.2;
}

.achievement-badge-count {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 900;
  opacity: .78;
}

.achievement-badge.is-unlocked .achievement-badge-copy {
  color: var(--green);
}

.achievement-badge.is-unlocked .achievement-badge-count {
  color: var(--green);
}

@media (max-width: 520px) {
  .achievement-overview-copy > strong {
    font-size: 21px;
  }

  .achievement-group-summary {
    min-height: 80px;
    padding: 16px;
    gap: 10px;
  }

  .achievement-group-heading {
    gap: 9px;
  }

  .achievement-group-heading h2 {
    font-size: 19px;
  }

  .achievement-group-heading p {
    font-size: 12px;
  }

  .achievement-group-status {
    gap: 7px;
  }

  .achievement-group-status strong {
    font-size: 12px;
  }

  .achievement-group-body {
    padding: 16px;
  }

  .achievement-badge-grid {
    gap: 8px;
  }

  .achievement-badge {
    padding: 8px;
    gap: 8px;
    border-radius: 14px;
  }

  .achievement-badge-icon {
    border-radius: 11px;
  }

  .achievement-badge-copy strong {
    font-size: 12px;
  }

  .achievement-badge-japanese,
  .achievement-badge-count {
    font-size: 10px;
  }
}


/* ========================================
   ADMIN – ACHIEVEMENTS VERGEBEN
======================================== */

.admin-achievements {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.admin-achievements-head {
  margin-bottom: 14px;
}

.admin-achievements-head > div {
  display: grid;
  gap: 3px;
}

.admin-achievements-head strong {
  font-size: 16px;
}

.admin-achievements-head span {
  color: var(--muted);
  font-size: 12px;
}

.admin-achievement-content {
  display: grid;
  gap: 16px;
}

.admin-achievement-group {
  display: grid;
  gap: 9px;
}

.admin-achievement-group + .admin-achievement-group {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.admin-achievement-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.admin-achievement-group-head strong {
  font-size: 14px;
}

.admin-achievement-group-head span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

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

.admin-achievement-toggle {
  min-width: 0;
  min-height: 54px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #59625f;
  color: white;
  text-align: left;
  cursor: pointer;
}

.admin-achievement-toggle.is-awarded {
  border-color: rgba(0,255,121,.55);
  background: rgba(0,255,121,.09);
  color: var(--green);
}

.admin-achievement-check {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 900;
}

.admin-achievement-label {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.admin-achievement-label small {
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  opacity: .65;
}

.admin-achievement-label strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.2;
}

.admin-achievement-message {
  margin-top: 10px;
}

@media (max-width: 520px) {
  .admin-achievement-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   ACCOUNT – SICHERHEIT / PASSWORT
======================================== */

.account-security-intro {
  margin: -6px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}


/* ========================================
   ACCOUNT – ERZWUNGENER PASSWORTWECHSEL
======================================== */

.account-password-required {
  margin: -4px 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 0, 95, .35);
  border-radius: 14px;
  background: rgba(255, 0, 95, .07);
}

.account-password-required strong {
  display: block;
  margin-bottom: 5px;
  color: var(--red, #FF005F);
}

.account-password-required p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}


/* ========================================
   ADMIN – PASSWORT-RESET
======================================== */

.admin-badge.is-password-change {
  background: rgba(255, 0, 95, .10);
  color: var(--red, #FF005F);
}

.admin-password-reset {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line, rgba(255, 255, 255, .12));
}

.admin-password-reset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-password-reset-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-password-reset-head strong {
  font-size: 14px;
}

.admin-password-reset-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.admin-password-reset-btn,
.admin-temp-password-copy {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 0, 95, .38);
  background: rgba(255, 0, 95, .07);
  color: var(--red, #FF005F);
}

.admin-temp-password {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(0, 255, 121, .30);
  border-radius: 14px;
  background: rgba(0, 255, 121, .055);
}

.admin-temp-password > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-temp-password-value {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-temp-password code {
  min-width: 0;
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .18);
  color: var(--green, #00FF79);
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .04em;
  overflow-wrap: anywhere;
  user-select: all;
}

.admin-temp-password p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.admin-password-reset-message {
  margin-top: 10px;
}

@media (max-width: 620px) {
  .admin-password-reset-head,
  .admin-temp-password-value {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-password-reset-btn,
  .admin-temp-password-copy {
    width: 100%;
  }
}


/* Fu werden bei Yaku mit festem Fu-Wert automatisch gesetzt. */
.fu-lock-note {
  margin: 4px 0 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.fu-lock-note[hidden] {
  display: none;
}

.fu-card.is-fu-locked .fu-list,
.fu-card.is-fu-locked .fu-block {
  opacity: .38;
}

.fu-card.is-fu-locked .fu-list button,
.fu-card.is-fu-locked .fu-block button {
  cursor: not-allowed;
}


/* Fu: eine normale Hand kann insgesamt höchstens vier Melds haben. */
.fu-meld-limit-note {
  margin: 4px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.fu-meld-limit-note[hidden] {
  display: none;
}

.fu-meld-limit-note.is-limit-reached {
  color: var(--text);
}

.fu-block .stepper .plus:disabled {
  opacity: .35;
  cursor: not-allowed;
}

/* Öffentliche Ranking-Freigabe: bewusst zunächst ausgeschaltet. */
.account-ranking-visibility p { color:var(--muted); line-height:1.5; }
.account-ranking-visibility p strong { color:var(--ink); }
.account-ranking-choice { display:flex; align-items:flex-start; gap:12px; padding:14px;
  border:1px solid var(--line); border-radius:12px; cursor:pointer; line-height:1.45; }
.account-ranking-choice input { width:20px; height:20px; flex:0 0 20px;
  accent-color:var(--green); margin:1px 0 0; cursor:pointer; }
.account-ranking-choice span { font-weight:700; }
.account-ranking-visibility .account-ranking-hint { font-size:14px; margin:10px 0; }


/* V1.1 – Gewertet/Ungwertet in der Spiel-Lobby */
.game-ranking-setting {
  display: flex;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  font-size: 15px;
}
.game-ranking-setting input { width: 22px; height: 22px; flex: 0 0 auto; accent-color: #009b57; }
.game-ranking-setting strong { display: block; }
.game-ranking-setting small { display: block; margin-top: 5px; color: var(--text-muted, #8d9792); line-height: 1.5; }
.game-ranking-setting:has(input:disabled) { cursor: default; }

/* V1.1 – internes Ranking auf der Spiele-Seite */
.app-ranking-tabs { display:flex; flex-wrap:wrap; gap:12px; margin: 16px 0; }
.app-ranking-tabs label { display:flex; flex-direction:column; gap:6px; flex:1 1 145px; font-size: 13px; }
.app-ranking-tabs select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: rgb(47, 48, 44);
  color: var(--ink);
  color-scheme: dark;
  font: inherit;
  font-size: 16px;
}
.app-ranking-tabs select option {
  background: rgb(47, 48, 44);
  color: var(--ink);
}
.app-ranking-tabs select:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.app-ranking-scroll { overflow-x:auto; max-width:100%; }
.app-ranking-table { width:100%; border-collapse:collapse; font-size:14px; }
.app-ranking-table th { text-align:left; font-size:12px; color:var(--text-muted,#8d9792); font-weight:600; }
.app-ranking-table th, .app-ranking-table td { padding:12px 10px; border-bottom:1px solid rgba(128,128,128,.13); }
.app-ranking-table th:nth-child(n+3),.app-ranking-table td:nth-child(n+3){ text-align:right; }
.app-ranking-table td:first-child { white-space:nowrap; }
.app-ranking-private { color:var(--text-muted,#8d9792); }

/* V1.1 – Ranking-Spielerprofile und Vergleich, passend zum tsumoApp-Dark-Mode. */
.app-ranking-player-btn {
  border:0; background:none; color:var(--ink); font:inherit; font-weight:700;
  padding:4px 0; text-align:left; cursor:pointer; text-decoration:underline;
  text-decoration-color:transparent; text-underline-offset:4px;
}
.app-ranking-player-btn:hover { text-decoration-color:currentColor; }
.app-ranking-player-btn:focus-visible,.app-ranking-self-btn:focus-visible,
.app-profile-dialog button:focus-visible { outline:2px solid var(--green);outline-offset:3px; }
.app-ranking-self-btn {
  display:inline-flex; cursor:pointer; padding:8px 13px; border-radius:10px;
  color:#fff; background:var(--red); border:1px solid var(--red);
  font:inherit; font-weight:900; margin:0 0 6px;
}
.app-ranking-self-btn:hover { filter:brightness(.91); }
.app-profile-backdrop[hidden],.app-profile-dialog [hidden] { display:none!important; }
/* Spielerprofil in der App: dieselben Abmessungen wie das Modal auf tsumo.de.
   Unterschiede sind bewusst nur das Dark-Theme und die Vergleichswerte. */
.app-profile-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(5px);
  padding: 12px;
}
.app-profile-dialog {
  outline: 0;
  flex: 0 1 560px;
  width: min(560px, 100%);
  max-height: min(90dvh, 780px);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: auto 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 80px rgba(0,0,0,.55);
  font-size: 15px;
}
.app-profile-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.app-profile-header h2 {
  margin: 0 0 15px;
  font-weight: 900;
  font-size: 27px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.app-profile-eyebrow { margin: 0 0 3px; color: var(--green); font: italic 700 14px/1.25 "Roboto Condensed",sans-serif; }
.app-profile-close {
  flex: 0 0 35px;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 29px;
  line-height: 1;
}
.app-profile-close:hover { background: #282b29; }
.app-profile-variants {
  display: inline-flex;
  background: #282b29;
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 14px;
}
.app-profile-variants button {
  padding: 9px 12px;
  min-height: 0;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: 800 14px/1 "Roboto Condensed",sans-serif;
  white-space: nowrap;
}
.app-profile-variants button.is-active { background: var(--red); color: #fff; }
.app-profile-hint { margin: 0 0 12px; font-size: 13px; line-height: 1.35; color: var(--muted); }
.app-profile-status { color: var(--muted); margin: 12px 0; }
.app-profile-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.app-profile-stat { min-width: 0; padding: 12px; border-radius: 10px; background: #292c2a; }
.app-profile-stat > span { display: block; color: #adb5af; font-size: 13px; margin-bottom: 5px; }
.app-profile-stat > div { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.app-profile-stat strong { font-size: 22px; line-height: 1; font-weight: 850; color: #f2f5f3; }
.app-profile-own { font-size: 16px; line-height: 1.1; font-weight: 800; color: #e8005f; }
.app-profile-subheading { font-size: 18px; margin: 22px 0 9px; line-height: 1.2; }
.app-profile-chart-wrap { padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #1c201e; }
.app-profile-legend { display: flex; gap: 12px; flex-wrap: wrap; padding: 0 4px; min-height: 18px; }
.app-profile-legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 12px; }
.app-profile-legend-item i { width: 16px; height: 3px; border-radius: 99px; display: inline-block; }
#appProfileChart { display: block; width: 100%; height: auto; overflow: visible; }
.app-profile-gridline { stroke: #414744; stroke-width: 1; }
.app-profile-axis-label { font: 12px "Roboto Condensed",sans-serif; fill: #b0b8b2; }
.app-profile-chart-area { fill: rgba(0,255,121,.09); stroke: none; }
.app-profile-recent-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 7px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.app-profile-recent-row strong { text-align: right; font-weight: 700; white-space: nowrap; }
.app-profile-recent-row strong.app-profile-negative { color: #e8005f; }
.app-profile-empty { color: var(--muted); margin: 0; font-size: 14px; }
@media (max-width:500px) {
  .app-profile-backdrop { padding: 10px 8px; }
  .app-profile-dialog { padding: 20px 16px; }
  .app-profile-stat { padding: 12px 10px; }
  .app-profile-own { font-size: 14px; }
  .app-profile-recent-row { font-size: 14px; }
}

