@font-face {
  font-family: 'Cinzel';
  src: url('/font/Cinzel.woff2') format('woff2'),
       url('/font/Cinzel.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

html, body {
  background-color: var(--layout-background, white);
  color: black;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  font-family: 'Cinzel', sans-serif;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  height: 100%;
  width: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea {
  font-family: inherit;                  /* inherit the parent font */
  -webkit-font-smoothing: antialiased;   /* smooth fonts on WebKit browsers */
  -moz-osx-font-smoothing: grayscale;    /* smooth fonts on macOS Firefox */
  text-rendering: optimizeLegibility;    /* improve readability */
  font-weight: inherit;                  /* match parent's font weight */
  line-height: inherit;                  /* match parent's line height */
}

#wrapper {
  background: white;
  border-radius: 28px;
  position: fixed;
  top: 0px;
  left: 0px;
  width: calc(100vw - 28px);
  height: calc(100vh - 28px);
  padding: 13px;
  overflow: hidden;
}

#container {
  will-change: transform;
  background: white;
  position: absolute;
  transform: scale(var(--layout-scale, 1));
  width: var(--layout-width, 950px);
  height: var(--layout-height, 500px);
  left: var(--layout-offset-x, 0);
  top: var(--layout-offset-y, 0);
  transform-origin: top left;
  display: flex;
  justify-content: space-between;
  border: 3px solid darkgreen;
  font-size: 70px;
  border-radius: 15px;
  box-sizing: border-box;
  padding-bottom: 10px;
  transition: opacity 0.6s ease-in-out;
  overflow: hidden;
  opacity: 0;
}

.player-column {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Middle Column */
.middle-column {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;  /* start from top, spacing handled by logo wrapper */
  align-items: center;
  text-align: center;
  padding-top: 1rem;
  height: 100%; /* fill the column height */
  position: relative;
}

/* Wrapper around logo to center it vertically */
.logo-wrapper {
  flex: 1;                  /* takes remaining vertical space */
  display: flex;
  justify-content: center;   /* center horizontally */
  align-items: center;       /* center vertically */
}

/* Logo image */
img#logo {
  width: 128px;
  height: 128px;
  border: 3px solid darkgreen;
  border-radius: 10px;
  user-select: none;
  display: block;
  transition: opacity 0.4s ease-in-out;
}

/* Colofon at the bottom */
#colofon-wrapper {
  font-size: 12px;
  max-width: 140px;
  text-align: center;
  opacity: 0.7;
  margin-bottom: 12px;
}

.label {
  font-size: 28px;
  text-align: center;
  pointer-events: none;
}

.button-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.app-button {
  width: 95%;
  height: 100%;
  border: 2px solid transparent;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  position: relative;
  transition: transform 0.15s ease;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: white;
}

.app-button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

#Scorebord {
  background: linear-gradient(145deg, #0047b3, #0066ff);
  transform-origin: top left;
}

#Scorebord::before {
  background: linear-gradient(190deg, #0047b3, #0066ff);
}

#Straight {
  background: linear-gradient(235deg, #a80000, #dd0000);
  transform-origin: top right;
}

#Straight::before {
  background: linear-gradient(170deg, #a80000, #cc3333);
}

.app-button:hover::before {
  opacity: 1;
}

.app-button .content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.app-button .logo-box {
  width: 192px;
  height: 192px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  overflow: hidden;
}

.app-button .logo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-button .title {
  font-size: 48px;
  font-weight: bold;
  line-height: 1;
}

.app-button .subtitle {
  font-size: 24px;
  opacity: 0.95;
  text-align: center;
  line-height: 1.3;
}

/* Modal Overlay */
#reset-modal {
  position: fixed;               /* stay fixed on viewport */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.5); /* dim background */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 1000; /* above iframe */
}

#reset-modal.show {
  opacity: 1;
  pointer-events: all;
}

/* Modal Content */
.modal-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: linear-gradient(145deg, #d5f5d5, #eeffee 50%, #d5f5d5);
  border: 2px solid darkgreen;
  border-radius: 15px;
  padding: 15px;
  text-align: center;
  max-width: 400px;
  width: 70%;
  transform: scale(var(--layout-scale, 1));
}

.modal-content h2 {
  padding-top: 6px;
  font-size: 26px;
  margin: 0 0 4px 0;
}

.modal-content p {
  white-space: pre-line;
  padding-top: 6px;
  font-size: 24px;
  margin: 0 0 4px 0;
}

/* Fading Line */
.fading-line {
  height: 2px;
  background: linear-gradient(to right, transparent, darkgreen, transparent);
  margin: 2px 0 0 0;
}

/* Modal Buttons */
.modal-buttons {
  display: flex;
  justify-content: space-around;
  gap: 10px;
}

.modal-button {
  padding: 12px 24px;
  font-size: 18px;
  width: 35%;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

.modal-button.confirm {
  background: linear-gradient(to bottom, #007700, #005500);
  color: white;
  border: 1px solid #8dcf9b;
}

.modal-button.confirm:hover {
  color: yellow;
  background: linear-gradient(to bottom, #00aa00, #007700);
}

.modal-button.confirm:active {
  background: linear-gradient(to bottom, #007700, #00aa00);
}

.modal-button.cancel {
  background: linear-gradient(to bottom, #0056b3, #003c80);
  color: white;
}

.modal-button.cancel:hover {
  color: yellow;
  background: linear-gradient(to bottom, #007bdd, #0056a3);
}

.modal-button.cancel:active {
  background: linear-gradient(to bottom, #0056a3, #007bdd);
}

.enter-triangle {
  width: 0;
  height: 0;
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
  border-bottom: 15px solid darkgreen;
  vertical-align: middle;      /* align with dash */
  transform: rotate(270deg);
}

.dash-symbol {
  display: inline-block;
  width: 15px;
  border-bottom: 3px solid darkgreen;
  box-sizing: border-box;
  vertical-align: middle;
}

/* app.css */
.app-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 15px;
  z-index: 10;
}

#return-button {
  position: absolute;
  width: 90px;
  height: 35px;
  background: linear-gradient(145deg, #d5f5d5, #eeffee 50%, #d5f5d5);
  left: var(--layout-offset-x, 0);
  top: var(--layout-offset-y, 0);
  transform: scale(var(--layout-scale, 1));
  transform-origin: top left;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 
    15px 0 50px 0/ 
    15px 0 35px 0;
  border: 3px solid darkgreen;
  color: darkgreen;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  padding-right: 15px;
}

#return-button:hover {
  background: linear-gradient(190deg, #d5f5d5, #eeffee 50%, #d5f5d5);
  opacity: 1;
}

#return-button:active {
  color: yellow;
  background: linear-gradient(235deg, #c5e5c5, #e4f6e4 50%, #c5e5c5);
}

