:root {
  --if-ink: #eff8ff;
  --if-muted: #a9c0cf;
  --if-night: #03101b;
  --if-deep: #061a2a;
  --if-panel: rgba(6, 29, 45, 0.94);
  --if-panel-soft: rgba(7, 37, 55, 0.84);
  --if-teal: #1bb7bb;
  --if-teal-light: #72eef0;
  --if-gold: #f5b84b;
  --if-gold-light: #ffe09a;
  --if-wood: #86501f;
  --if-wood-dark: #3e210d;
  --if-line: rgba(245, 184, 75, 0.62);
  --if-radius: 22px;
  --if-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body.inselflipper-page {
  min-width: 320px;
  margin: 0;
  color: var(--if-ink);
  background:
    radial-gradient(circle at 50% -15%, rgba(24, 127, 149, 0.2), transparent 36rem),
    linear-gradient(180deg, #020b14 0, #061522 72%, #020a11 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

.if-skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 15px;
  border-radius: 10px;
  color: #00131b;
  background: var(--if-gold-light);
  font-weight: 900;
  transform: translateY(-150%);
  transition: transform 0.18s ease;
}

.if-skip-link:focus {
  transform: translateY(0);
}

.if-site-header {
  position: relative;
  z-index: 10;
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 20px;
  padding: 8px clamp(14px, 3vw, 46px);
  border-bottom: 1px solid rgba(245, 184, 75, 0.35);
  background: rgba(2, 14, 24, 0.92);
  box-shadow: 0 9px 30px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.if-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-right: auto;
  text-decoration: none;
}

.if-brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 2px solid rgba(255, 225, 155, 0.78);
  border-radius: 50%;
  color: #06202a;
  background:
    radial-gradient(circle at 30% 25%, #fff8c8 0 8%, transparent 9%),
    linear-gradient(145deg, #fed476, #48c8ce);
  box-shadow: 0 0 18px rgba(86, 225, 225, 0.24);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: -0.03em;
}

.if-brand strong,
.if-brand small {
  display: block;
}

.if-brand strong {
  font-size: 17px;
}

.if-brand small {
  margin-top: -3px;
  color: var(--if-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.if-header-links {
  display: flex;
  gap: 8px;
}

.if-header-links a,
.if-user-pill {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(91, 180, 196, 0.25);
  border-radius: 13px;
  background: rgba(10, 39, 55, 0.62);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.if-header-links a:hover,
.if-header-links a:focus-visible {
  border-color: var(--if-gold);
  color: var(--if-gold-light);
}

.if-user-pill span {
  color: var(--if-teal-light);
}

.if-game-section {
  width: min(1760px, calc(100% - 24px));
  margin: 12px auto 0;
  overflow: hidden;
  border: 2px solid rgba(196, 124, 46, 0.82);
  border-radius: 23px;
  background: #020f19;
  box-shadow: var(--if-shadow);
}

.if-game-toolbar {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 14px 8px 22px;
  border-bottom: 1px solid rgba(245, 184, 75, 0.48);
  background:
    linear-gradient(90deg, rgba(5, 31, 48, 0.98), rgba(3, 23, 37, 0.98)),
    repeating-linear-gradient(90deg, transparent 0 50px, rgba(255,255,255,0.02) 50px 51px);
}

.if-game-toolbar h1 {
  margin: 0;
  font-size: clamp(18px, 1.6vw, 27px);
  line-height: 1.08;
}

.if-game-toolbar h1 span {
  margin-left: 0.35em;
  color: var(--if-gold-light);
  font-size: 0.58em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.if-eyebrow {
  margin: 0 0 4px;
  color: var(--if-gold);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.if-toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
}

.if-tool-button,
.if-primary-button,
.if-secondary-button,
.if-control-pad {
  border: 0;
  cursor: pointer;
  font-weight: 900;
}

.if-tool-button {
  min-height: 45px;
  padding: 0 16px;
  border: 1px solid rgba(73, 170, 190, 0.42);
  border-radius: 14px;
  color: #e9f7fd;
  background: linear-gradient(180deg, #103b52, #092a3c);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

.if-tool-button:hover:not(:disabled),
.if-tool-button:focus-visible:not(:disabled) {
  border-color: var(--if-teal-light);
  transform: translateY(-1px);
}

.if-tool-button[aria-pressed="true"] {
  border-color: var(--if-teal-light);
  color: #041d24;
  background: linear-gradient(180deg, #79eff0, #28b9bd);
}

.if-tool-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.if-tool-button-new {
  border-color: #ffc661;
  color: #211305;
  background: linear-gradient(180deg, #ffd87e, #f0a838);
}

.if-game-viewport {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.82fr) minmax(360px, 0.92fr) minmax(260px, 0.82fr);
  min-height: 580px;
  align-items: stretch;
  justify-content: center;
  gap: clamp(10px, 1.25vw, 22px);
  padding: 10px clamp(10px, 1.5vw, 25px);
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(2, 13, 22, 0.18), rgba(2, 14, 23, 0.08) 50%, rgba(2, 13, 22, 0.35)),
    url("../images/inselflipper-schatzschiff-vorschau.webp") center / cover no-repeat;
}

.if-game-viewport::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 50% 48%, transparent 0 19%, rgba(1, 11, 18, 0.34) 64%, rgba(1, 8, 14, 0.72) 100%),
    linear-gradient(180deg, rgba(3, 18, 29, 0.05), rgba(3, 18, 29, 0.52));
}

.if-story-panel,
.if-score-panel {
  min-width: 0;
}

.if-story-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(30px, 5vh, 72px) 0 18px;
}

.if-title-sign {
  position: relative;
  width: min(100%, 410px);
  margin-inline: auto;
  padding: 30px 22px 25px;
  border: 11px solid transparent;
  border-radius: 45% 44% 38% 42% / 22% 24% 20% 24%;
  color: #fff3cf;
  background:
    linear-gradient(#08666f, #063f4c) padding-box,
    repeating-linear-gradient(110deg, #9f622a 0 12px, #5e3216 12px 22px, #c07b37 22px 30px) border-box;
  box-shadow:
    0 17px 36px rgba(0, 0, 0, 0.46),
    inset 0 1px 15px rgba(98, 245, 238, 0.15);
  text-align: center;
  transform: rotate(-1.4deg);
}

.if-title-sign::before,
.if-title-sign::after {
  position: absolute;
  top: -51px;
  width: 5px;
  height: 51px;
  border-radius: 4px;
  content: "";
  background: linear-gradient(90deg, #4a2b12, #d09a59 45%, #503117);
  box-shadow: 0 1px 3px #000;
}

.if-title-sign::before {
  left: 22%;
}

.if-title-sign::after {
  right: 22%;
}

.if-title-sign small,
.if-title-sign strong,
.if-title-sign span {
  display: block;
}

.if-title-sign small {
  color: #ffe58e;
  font-size: clamp(10px, 0.85vw, 14px);
  font-weight: 1000;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.if-title-sign strong {
  margin: 2px 0 0;
  color: #ffe6a8;
  text-shadow: 0 4px 0 #4a270e, 0 7px 12px rgba(0, 0, 0, 0.55);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(35px, 3.4vw, 64px);
  font-stretch: condensed;
  letter-spacing: 0.025em;
  line-height: 1;
}

.if-title-sign span {
  margin-top: 8px;
  color: #bff8f1;
  font-size: clamp(12px, 1vw, 17px);
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.if-story-copy {
  width: min(100%, 390px);
  margin-inline: auto;
  padding: 17px 18px;
  border: 1px solid rgba(245, 184, 75, 0.48);
  border-radius: 17px;
  background: rgba(2, 15, 23, 0.88);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(9px);
}

.if-story-copy p {
  margin: 0 0 12px;
  color: #d9e7ed;
  font-size: clamp(13px, 1vw, 16px);
}

.if-feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.if-feature-chips span {
  padding: 4px 8px;
  border: 1px solid rgba(58, 210, 208, 0.42);
  border-radius: 999px;
  color: #d7ffff;
  background: rgba(6, 76, 82, 0.55);
  font-size: 10px;
  font-weight: 950;
}

.if-stage-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.if-stage {
  position: relative;
  height: clamp(500px, calc(100dvh - 218px), 720px);
  max-width: 100%;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border: clamp(8px, 0.8vw, 13px) solid transparent;
  border-radius: 26px;
  background:
    linear-gradient(#031522, #031522) padding-box,
    repeating-linear-gradient(100deg, #b97932 0 9px, #613515 9px 18px, #d39a51 18px 24px) border-box;
  box-shadow:
    0 19px 46px rgba(0, 0, 0, 0.58),
    0 0 0 3px rgba(42, 22, 9, 0.88),
    inset 0 0 32px rgba(0, 0, 0, 0.55);
}

.if-stage::before {
  position: absolute;
  z-index: 3;
  inset: 2px;
  border: 1px solid rgba(255, 214, 123, 0.47);
  border-radius: 14px;
  content: "";
  pointer-events: none;
}

#ifCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #061c2b;
  touch-action: none;
}

#ifCanvas:focus-visible {
  outline: 3px solid var(--if-teal-light);
  outline-offset: -5px;
}

.if-loading,
.if-overlay {
  position: absolute;
  z-index: 7;
  inset: 0;
}

.if-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #eafcff;
  background: #031522;
  font-weight: 850;
}

.if-loading[hidden],
.if-overlay[hidden] {
  display: none;
}

.if-loading span {
  width: 25px;
  height: 25px;
  border: 3px solid rgba(113, 239, 240, 0.2);
  border-top-color: var(--if-teal-light);
  border-radius: 50%;
  animation: if-spin 0.75s linear infinite;
}

@keyframes if-spin {
  to { transform: rotate(360deg); }
}

.if-overlay {
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 34%, rgba(41, 164, 173, 0.15), transparent 42%),
    rgba(1, 13, 21, 0.72);
  backdrop-filter: blur(4px);
}

.if-overlay-card {
  width: min(100%, 390px);
  padding: clamp(22px, 4vh, 38px) clamp(18px, 3vw, 32px);
  border: 1px solid rgba(86, 213, 218, 0.5);
  border-radius: 24px;
  background:
    linear-gradient(150deg, rgba(9, 49, 67, 0.98), rgba(3, 24, 38, 0.98));
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px rgba(255, 255, 255, 0.08);
  text-align: center;
}

.if-pearl {
  display: block;
  width: clamp(54px, 7vh, 74px);
  height: clamp(54px, 7vh, 74px);
  margin: 0 auto 16px;
  border: 2px solid rgba(222, 255, 255, 0.82);
  border-radius: 50%;
  background:
    radial-gradient(circle at 31% 26%, #fff 0 7%, transparent 8%),
    radial-gradient(circle at 38% 34%, #efffff 0 9%, #8ee1e1 31%, #257e91 71%, #0b425b 100%);
  box-shadow: 0 0 25px rgba(137, 244, 240, 0.44);
}

.if-overlay-card h2 {
  margin: 4px 0 10px;
  font-size: clamp(23px, 3vh, 34px);
  line-height: 1.12;
}

.if-overlay-card > p:not(.if-eyebrow) {
  margin: 0 auto 20px;
  color: #c2d5df;
  font-size: clamp(13px, 1.55vh, 16px);
}

.if-overlay-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.if-primary-button,
.if-secondary-button {
  min-height: 51px;
  padding: 0 22px;
  border-radius: 14px;
}

.if-primary-button {
  color: #211402;
  background: linear-gradient(180deg, #ffe08f, #f4ac43);
  box-shadow: 0 8px 20px rgba(224, 142, 37, 0.2);
}

.if-secondary-button {
  border: 1px solid rgba(91, 205, 211, 0.5);
  color: #e9ffff;
  background: #0b3d50;
}

.if-primary-button:hover,
.if-primary-button:focus-visible,
.if-secondary-button:hover,
.if-secondary-button:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.if-message {
  width: 100%;
  min-height: 21px;
  margin: 4px 0 -4px;
  color: #88d7cf;
  font-size: 12px;
  text-align: center;
}

.if-message.is-good,
.if-message[data-tone="good"] {
  color: #93efa6;
}

.if-message.is-error,
.if-message[data-tone="error"] {
  color: #ff9b8f;
}

.if-message[data-tone="info"] {
  color: #88d7cf;
}

.if-score-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 16px 0;
}

.if-score-frame,
.if-leaderboard-card {
  position: relative;
  width: min(100%, 390px);
  margin-inline: auto;
  border: 8px solid transparent;
  border-radius: 24px;
  background:
    linear-gradient(rgba(4, 30, 46, 0.97), rgba(4, 30, 46, 0.97)) padding-box,
    repeating-linear-gradient(105deg, #ac6a2c 0 10px, #522c12 10px 18px, #c88a46 18px 27px) border-box;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.46);
}

.if-score-frame::before,
.if-leaderboard-card::before {
  position: absolute;
  inset: -9px;
  border: 2px solid rgba(45, 24, 10, 0.88);
  border-radius: 26px;
  content: "";
  pointer-events: none;
}

.if-score-row {
  display: grid;
  min-height: clamp(62px, 8vh, 84px);
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--if-line);
}

.if-score-row:last-child {
  border-bottom: 0;
}

.if-score-row > span:last-child {
  min-width: 0;
}

.if-score-row small,
.if-score-row strong {
  display: block;
}

.if-score-row small {
  color: #ffd76f;
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.if-score-row strong {
  overflow: hidden;
  font-size: clamp(23px, 2.1vw, 34px);
  line-height: 1.04;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.if-score-best strong {
  color: #ffd465;
}

.if-score-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #ffc650;
  font-size: 30px;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.44));
}

.if-leaderboard-card {
  min-height: 174px;
  padding: 13px 14px 12px;
}

.if-leaderboard-card h2 {
  margin: 0 0 8px;
  font-size: clamp(16px, 1.5vw, 22px);
}

.if-leaderboard {
  display: grid;
  max-height: clamp(90px, 18vh, 190px);
  gap: 5px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  scrollbar-color: #3ba9ad rgba(0, 0, 0, 0.2);
  scrollbar-width: thin;
}

.if-leaderboard li {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 35px;
  padding: 5px 8px;
  border: 1px solid rgba(91, 164, 177, 0.2);
  border-radius: 10px;
  background: rgba(1, 16, 26, 0.58);
  font-size: 12px;
}

.if-leaderboard li > span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  color: #1d1303;
  background: #f6bc50;
  font-size: 11px;
  font-weight: 1000;
}

.if-leaderboard li strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.if-leaderboard li b {
  color: var(--if-gold-light);
}

.if-leaderboard li.if-leaderboard-empty {
  grid-template-columns: 27px 1fr;
}

.if-leaderboard-empty p {
  margin: 0;
  color: var(--if-muted);
}

.if-ranking-note {
  margin: 8px 2px 0;
  color: var(--if-muted);
  font-size: 11px;
}

.if-controls {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 3vw, 42px);
  padding: 8px 16px;
  border-top: 1px solid rgba(245, 184, 75, 0.5);
  background:
    linear-gradient(180deg, rgba(7, 33, 49, 0.99), rgba(3, 22, 34, 0.99));
}

.if-control-pad {
  display: inline-flex;
  min-width: 180px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 17px;
  border: 1px solid rgba(245, 184, 75, 0.5);
  border-radius: 13px;
  color: #dceaf0;
  background: rgba(5, 27, 40, 0.82);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.if-control-pad kbd {
  min-width: 38px;
  padding: 4px 8px;
  border: 1px solid #d9a845;
  border-radius: 8px;
  color: #ffe09b;
  background: #061725;
  box-shadow: inset 0 -2px rgba(0, 0, 0, 0.42);
  font-family: inherit;
  font-size: 13px;
  font-weight: 950;
}

.if-control-pad span {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.if-control-pad.is-active,
.if-control-pad.is-held,
.if-control-pad:active {
  color: #07171c;
  background: linear-gradient(180deg, #ffe18d, #eea63c);
  transform: translateY(1px);
}

.if-control-pad.is-active kbd,
.if-control-pad.is-held kbd,
.if-control-pad:active kbd {
  color: #07171c;
  background: rgba(255, 255, 255, 0.26);
}

.if-control-launch {
  min-width: 220px;
}

.if-noscript {
  margin: 0;
  padding: 12px;
  color: #ffb1a7;
  background: #3a1513;
  text-align: center;
}

.if-intro,
.if-info-grid,
.if-faq {
  width: min(1240px, calc(100% - 32px));
  margin-inline: auto;
}

.if-intro {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(24px, 6vw, 90px);
  align-items: center;
  padding: 74px 0 38px;
}

.if-intro h2,
.if-info-grid h2,
.if-faq h2 {
  margin: 0;
  line-height: 1.15;
}

.if-intro h2 {
  font-size: clamp(28px, 4vw, 50px);
}

.if-intro > p {
  margin: 0;
  color: #b9cbd5;
  font-size: clamp(16px, 1.55vw, 20px);
}

.if-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 24px 0 58px;
}

.if-info-grid article {
  position: relative;
  min-height: 280px;
  padding: 24px 21px;
  overflow: hidden;
  border: 1px solid rgba(74, 163, 179, 0.22);
  border-radius: var(--if-radius);
  background:
    radial-gradient(circle at 105% -10%, rgba(34, 174, 180, 0.13), transparent 45%),
    linear-gradient(145deg, rgba(8, 37, 53, 0.95), rgba(3, 23, 36, 0.95));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.if-info-grid article:nth-child(even) {
  border-color: rgba(245, 184, 75, 0.25);
}

.if-card-symbol {
  display: block;
  margin-bottom: 18px;
  color: var(--if-gold);
  font-size: 31px;
}

.if-info-grid h2 {
  margin-bottom: 12px;
  font-size: 21px;
}

.if-info-grid p:not(.if-eyebrow),
.if-info-grid li,
.if-faq p {
  color: var(--if-muted);
}

.if-info-grid ul {
  margin: 14px 0 0;
  padding-left: 19px;
}

.if-info-grid li + li {
  margin-top: 5px;
}

.if-faq {
  padding: 4px 0 75px;
}

.if-faq > h2 {
  margin-bottom: 20px;
  font-size: clamp(28px, 3.5vw, 43px);
}

.if-faq details {
  border-top: 1px solid rgba(95, 161, 174, 0.24);
  background: rgba(6, 26, 40, 0.25);
}

.if-faq details:last-child {
  border-bottom: 1px solid rgba(95, 161, 174, 0.24);
}

.if-faq summary {
  padding: 18px 5px;
  cursor: pointer;
  font-size: 17px;
  font-weight: 900;
}

.if-faq details p {
  max-width: 860px;
  margin: -4px 0 18px;
  padding: 0 5px;
}

.if-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 23px clamp(16px, 4vw, 58px);
  border-top: 1px solid rgba(245, 184, 75, 0.25);
  color: #8ca5b3;
  background: #020b12;
  font-size: 13px;
}

.if-footer p {
  margin: 0;
}

.if-footer a {
  color: #d5edf3;
  font-weight: 800;
}

@media (max-width: 1120px) {
  .if-game-viewport {
    grid-template-columns: minmax(310px, 0.92fr) minmax(260px, 0.74fr);
  }

  .if-story-panel {
    display: none;
  }

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

@media (max-width: 780px) {
  .if-site-header {
    min-height: 56px;
    gap: 8px;
    padding: 6px 10px;
  }

  .if-brand-mark {
    width: 38px;
    height: 38px;
  }

  .if-brand strong {
    font-size: 14px;
  }

  .if-header-links a {
    min-height: 38px;
    padding: 7px 10px;
    font-size: 11px;
  }

  .if-header-links a:last-child,
  .if-user-pill {
    display: none;
  }

  .if-game-section {
    width: 100%;
    margin-top: 0;
    border-width: 0 0 2px;
    border-radius: 0;
  }

  .if-game-toolbar {
    min-height: auto;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 9px;
  }

  .if-game-toolbar h1 {
    font-size: 16px;
  }

  .if-game-toolbar h1 span {
    display: block;
    margin: 2px 0 0;
    font-size: 8px;
  }

  .if-game-toolbar .if-eyebrow {
    display: none;
  }

  .if-toolbar-actions {
    gap: 5px;
  }

  .if-tool-button {
    min-width: 43px;
    min-height: 39px;
    padding: 0 9px;
    font-size: 0;
  }

  .if-tool-button span {
    font-size: 17px;
  }

  .if-tool-button [data-sound-label] {
    display: none;
  }

  .if-game-viewport {
    display: flex;
    min-height: auto;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    background-position: 54% center;
  }

  .if-stage-column {
    order: 2;
  }

  .if-stage {
    width: min(100%, 470px);
    height: auto;
    max-height: none;
    aspect-ratio: 3 / 4;
    border-width: 7px;
    border-radius: 20px;
  }

  .if-message {
    margin: 4px 0 0;
    font-size: 11px;
  }

  .if-score-panel {
    display: contents;
  }

  .if-score-frame {
    display: grid;
    order: 1;
    width: min(100%, 470px);
    grid-template-columns: repeat(4, 1fr);
    margin-inline: auto;
    border-width: 5px;
    border-radius: 15px;
  }

  .if-score-frame::before {
    display: none;
  }

  .if-score-row {
    min-height: 53px;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 5px 4px;
    border-right: 1px solid var(--if-line);
    border-bottom: 0;
    text-align: center;
  }

  .if-score-row:last-child {
    border-right: 0;
  }

  .if-score-icon {
    display: none;
  }

  .if-score-row small {
    font-size: 7px;
    letter-spacing: 0.04em;
  }

  .if-score-row strong {
    margin-top: 2px;
    font-size: 18px;
  }

  .if-leaderboard-card {
    order: 3;
    width: min(100%, 470px);
    min-height: 0;
    margin-inline: auto;
    padding: 10px;
    border-width: 5px;
    border-radius: 15px;
  }

  .if-leaderboard-card::before {
    display: none;
  }

  .if-leaderboard-card h2 {
    margin-bottom: 5px;
    font-size: 16px;
  }

  .if-leaderboard {
    max-height: 112px;
  }

  .if-controls {
    position: sticky;
    z-index: 12;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr 0.8fr 1fr;
    gap: 7px;
    min-height: 72px;
    padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    box-shadow: 0 -9px 25px rgba(0, 0, 0, 0.35);
  }

  .if-control-pad,
  .if-control-launch {
    min-width: 0;
    min-height: 56px;
    gap: 3px;
    padding: 4px;
  }

  .if-control-pad {
    flex-direction: column;
  }

  .if-control-pad kbd {
    min-width: 38px;
    padding: 2px 6px;
    font-size: 14px;
  }

  .if-control-pad span {
    font-size: 8px;
  }

  .if-control-launch kbd {
    font-size: 9px;
  }

  .if-intro {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 50px;
  }

  .if-info-grid {
    grid-template-columns: 1fr;
  }

  .if-info-grid article {
    min-height: 0;
  }

  .if-footer {
    flex-direction: column;
    gap: 8px;
  }
}

@media (min-width: 781px) {
  .if-game-section {
    width: min(1760px, 72%);
    zoom: 0.72;
  }
}

@media (max-width: 420px) {
  .if-game-viewport {
    padding-inline: 4px;
  }

  .if-stage {
    border-width: 5px;
    border-radius: 15px;
  }

  .if-overlay {
    padding: 14px;
  }

  .if-overlay-card {
    padding: 19px 14px;
  }

  .if-overlay-card h2 {
    font-size: 23px;
  }

  .if-pearl {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
  }

  .if-leaderboard-card {
    display: none;
  }

  .if-intro,
  .if-info-grid,
  .if-faq {
    width: min(100% - 22px, 1240px);
  }
}

@media (max-height: 760px) and (min-width: 781px) {
  .if-site-header {
    min-height: 54px;
  }

  .if-game-toolbar {
    min-height: 55px;
  }

  .if-game-toolbar .if-eyebrow {
    display: none;
  }

  .if-game-viewport {
    height: calc(100dvh - 196px);
    min-height: 0;
  }

  .if-stage {
    height: calc(100dvh - 245px);
    min-height: 0;
  }

  .if-story-panel {
    padding-top: 34px;
  }

  .if-controls {
    min-height: 58px;
  }

  .if-score-row {
    min-height: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Breite Schatzschiff-Bühne – visuelle Ausbaustufe 2 */
.inselflipper-page main {
  width: 100%;
  margin: 0;
}

.if-game-section {
  position: relative;
}

.if-game-viewport {
  position: relative;
  display: block;
  min-height: 0;
  height: auto;
  padding: 0;
  overflow: hidden;
  background: #020c14;
}

.if-game-viewport::before {
  z-index: 4;
  background:
    linear-gradient(180deg, rgba(1, 9, 16, 0.18), transparent 18% 78%, rgba(1, 8, 14, 0.4)),
    linear-gradient(90deg, rgba(1, 9, 16, 0.25), transparent 19% 81%, rgba(1, 9, 16, 0.28));
  pointer-events: none;
}

.if-stage-column {
  display: block;
  width: 100%;
}

.if-stage {
  width: 100%;
  height: auto;
  max-width: none;
  max-height: none;
  aspect-ratio: 1672 / 941;
  border: 0;
  border-radius: 0;
  background: #020c14;
  box-shadow: none;
}

.if-stage::before {
  z-index: 6;
  inset: 8px;
  border: 1px solid rgba(255, 214, 123, 0.34);
  border-radius: 18px;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.24);
}

.if-story-panel {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: block;
  min-height: 0;
  padding: 0;
  pointer-events: none;
}

.if-title-sign {
  position: absolute;
  top: clamp(10px, 1.3vw, 20px);
  left: 50%;
  width: min(440px, 34vw);
  margin: 0;
  padding: clamp(12px, 1.25vw, 20px) 18px clamp(10px, 1vw, 16px);
  border-width: 8px;
  border-radius: 44% 44% 34% 34% / 28% 28% 22% 22%;
  transform: translateX(-50%);
}

.if-title-sign::before,
.if-title-sign::after {
  top: -34px;
  height: 34px;
}

.if-title-sign small {
  font-size: clamp(8px, 0.65vw, 11px);
}

.if-title-sign strong {
  font-size: clamp(28px, 3.2vw, 54px);
}

.if-title-sign span {
  margin-top: 4px;
  font-size: clamp(9px, 0.8vw, 13px);
}

.if-story-copy {
  display: none;
}

.if-score-panel {
  position: absolute;
  z-index: 8;
  top: clamp(12px, 1.4vw, 22px);
  right: clamp(12px, 1.4vw, 22px);
  display: flex;
  width: min(310px, 23vw);
  min-height: 0;
  justify-content: flex-start;
  gap: 8px;
  padding: 0;
  pointer-events: none;
}

.if-score-frame,
.if-leaderboard-card {
  width: 100%;
  margin: 0;
  border-width: 6px;
  border-radius: 18px;
  pointer-events: auto;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}

.if-score-frame::before,
.if-leaderboard-card::before {
  inset: -7px;
  border-radius: 20px;
}

.if-score-row {
  min-height: clamp(43px, 5.2vw, 58px);
  grid-template-columns: 35px 1fr;
  gap: 7px;
  padding: 5px 9px;
}

.if-score-icon {
  width: 32px;
  height: 32px;
  font-size: 22px;
}

.if-score-row small {
  font-size: clamp(7px, 0.63vw, 9px);
}

.if-score-row strong {
  font-size: clamp(18px, 1.8vw, 27px);
}

.if-leaderboard-card {
  min-height: 0;
  padding: 9px 10px 8px;
}

.if-leaderboard-card .if-eyebrow {
  margin-bottom: 2px;
  font-size: 8px;
}

.if-leaderboard-card h2 {
  margin-bottom: 5px;
  font-size: clamp(13px, 1.2vw, 18px);
}

.if-leaderboard {
  max-height: clamp(72px, 11vw, 120px);
}

.if-leaderboard li {
  min-height: 28px;
  padding: 3px 6px;
  font-size: 10px;
}

.if-ranking-note {
  margin-top: 5px;
  font-size: 9px;
}

.if-message {
  position: absolute;
  z-index: 9;
  bottom: 8px;
  left: 50%;
  width: min(620px, 54vw);
  min-height: 0;
  margin: 0;
  padding: 5px 12px;
  border: 1px solid rgba(76, 196, 198, 0.25);
  border-radius: 999px;
  background: rgba(1, 13, 21, 0.72);
  backdrop-filter: blur(7px);
  transform: translateX(-50%);
}

.if-controls {
  position: absolute;
  z-index: 12;
  right: clamp(14px, 2vw, 30px);
  bottom: clamp(17px, 2vw, 30px);
  left: clamp(14px, 2vw, 30px);
  display: flex;
  min-height: 0;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.if-control-pad {
  position: relative;
  width: clamp(82px, 9vw, 132px);
  min-width: 0;
  height: clamp(82px, 9vw, 132px);
  min-height: 0;
  padding: 0;
  border: 6px solid rgba(180, 116, 46, 0.92);
  border-radius: 50%;
  color: #ffe29a;
  background:
    radial-gradient(circle at 50% 36%, #17426a, #061a34 64%, #020c19 100%);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.5),
    0 0 0 3px rgba(42, 23, 10, 0.88),
    inset 0 0 0 2px rgba(255, 224, 151, 0.18);
  pointer-events: auto;
}

.if-control-pad:not(.if-control-launch) kbd {
  min-width: 0;
  padding: 0;
  border: 0;
  color: #ffd76f;
  background: transparent;
  box-shadow: none;
  font-size: clamp(36px, 4.3vw, 64px);
  line-height: 1;
}

.if-control-pad:not(.if-control-launch) span {
  position: absolute;
  right: 0;
  bottom: 9px;
  left: 0;
  font-size: clamp(7px, 0.66vw, 10px);
}

.if-control-launch {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: clamp(138px, 14vw, 205px);
  height: clamp(46px, 4.6vw, 62px);
  border-width: 3px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15, 57, 76, 0.96), rgba(4, 28, 43, 0.98));
  transform: translateX(-50%);
}

.if-control-launch kbd {
  font-size: clamp(9px, 0.8vw, 13px);
}

.if-control-launch span {
  font-size: clamp(8px, 0.72vw, 11px);
}

.if-control-pad.is-active,
.if-control-pad.is-held,
.if-control-pad:active {
  border-color: #ffe08d;
  color: #fff5c1;
  filter: brightness(1.16);
  transform: scale(0.97);
}

.if-control-launch.is-active,
.if-control-launch.is-held,
.if-control-launch:active {
  transform: translateX(-50%) scale(0.97);
}

@media (max-width: 1100px) and (min-width: 781px) {
  .if-title-sign {
    left: 18px;
    width: min(300px, 31vw);
    transform: none;
  }

  .if-score-panel {
    width: min(250px, 25vw);
  }

  .if-score-row {
    min-height: 42px;
  }

  .if-leaderboard {
    max-height: 74px;
  }
}

@media (max-width: 780px) {
  .if-game-section {
    width: 100%;
    margin-top: 0;
    border-width: 0 0 2px;
    border-radius: 0;
  }

  .if-game-viewport {
    display: block;
    height: auto;
    padding: 0 0 8px;
    overflow: visible;
  }

  .if-story-panel {
    display: none;
  }

  .if-stage-column {
    width: 100%;
  }

  .if-stage {
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: 4 / 5;
    border: 0;
    border-radius: 0;
  }

  .if-stage::before {
    inset: 5px;
    border-radius: 12px;
  }

  .if-score-panel {
    position: static;
    display: block;
    width: 100%;
    padding: 8px;
    pointer-events: auto;
  }

  .if-score-frame {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, 1fr);
    border-width: 5px;
    border-radius: 15px;
  }

  .if-score-frame::before {
    display: none;
  }

  .if-score-row {
    min-height: 54px;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 5px 3px;
    border-right: 1px solid var(--if-line);
    border-bottom: 0;
    text-align: center;
  }

  .if-score-row:last-child {
    border-right: 0;
  }

  .if-score-icon {
    display: none;
  }

  .if-score-row small {
    font-size: 7px;
    letter-spacing: 0.03em;
  }

  .if-score-row strong {
    margin-top: 2px;
    font-size: 18px;
  }

  .if-leaderboard-card {
    width: 100%;
    margin-top: 8px;
  }

  .if-leaderboard {
    max-height: 112px;
  }

  .if-message {
    position: static;
    width: calc(100% - 16px);
    margin: 5px 8px 0;
    transform: none;
  }

  .if-controls {
    position: sticky;
    right: auto;
    bottom: 0;
    left: auto;
    display: grid;
    min-height: 66px;
    grid-template-columns: 1fr 0.82fr 1fr;
    gap: 6px;
    padding: 7px 8px;
    border-top: 1px solid rgba(245, 184, 75, 0.5);
    background: rgba(3, 22, 34, 0.97);
    pointer-events: auto;
  }

  .if-control-pad,
  .if-control-launch {
    position: static;
    width: 100%;
    height: auto;
    min-height: 54px;
    padding: 5px 4px;
    border-width: 1px;
    border-radius: 13px;
    background: rgba(5, 31, 46, 0.98);
    box-shadow: none;
    transform: none;
  }

  .if-control-pad:not(.if-control-launch) kbd,
  .if-control-launch kbd {
    min-width: 32px;
    padding: 3px 6px;
    border: 1px solid #d9a845;
    border-radius: 7px;
    color: #ffe09b;
    background: #061725;
    box-shadow: inset 0 -2px rgba(0, 0, 0, 0.42);
    font-size: 12px;
  }

  .if-control-pad:not(.if-control-launch) span,
  .if-control-launch span {
    position: static;
    display: block;
    font-size: 7px;
  }

  .if-control-launch.is-active,
  .if-control-launch.is-held,
  .if-control-launch:active {
    transform: scale(0.98);
  }
}

/* Abschusskraft: Leertaste oder Abschuss-Taste halten und loslassen */
.if-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.if-control-launch {
  overflow: hidden;
  padding: 5px 10px 14px;
  gap: 6px;
}

.if-control-launch .if-launch-meter {
  position: absolute;
  right: 12px;
  bottom: 6px;
  left: 12px;
  height: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 224, 141, 0.55);
  border-radius: 999px;
  background: rgba(1, 12, 20, 0.78);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.72);
  pointer-events: none;
}

.if-launch-meter-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #65e4e1 0%, #ffe083 58%, #f29b39 100%);
  box-shadow: 0 0 8px rgba(255, 202, 89, 0.78);
  transform: scaleX(var(--if-launch-charge, 0));
  transform-origin: left center;
  transition: transform 80ms linear;
}

.if-control-launch.is-charging .if-launch-meter,
.if-control-launch.is-held .if-launch-meter {
  border-color: #ffe18d;
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.72),
    0 0 8px rgba(255, 205, 91, 0.5);
}

@media (max-width: 780px) {
  .if-control-launch {
    position: relative;
    bottom: auto;
    left: auto;
    padding: 5px 4px 14px;
  }

  .if-overlay-card h2 {
    max-width: 100%;
    font-size: 20px;
    overflow-wrap: anywhere;
  }

  .if-control-launch .if-launch-meter {
    right: 8px;
    bottom: 5px;
    left: 8px;
    height: 4px;
  }
}

.if-control-pad:disabled {
  cursor: not-allowed;
  filter: saturate(0.55);
  opacity: 0.52;
}

@media (prefers-reduced-motion: reduce) {
  .if-launch-meter-fill {
    transition: none;
  }
}
