* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Georgia", "Times New Roman", serif;
  background-color: #f7f0e5;
  color: #214732;
}

#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
}

/* Screens */

.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: block;
}

.screen-inner {
  padding: 24px 20px 32px;
}

/* Welcome */

.welcome-inner {
  text-align: center;
}

.welcome-hero {
  margin-top: 40px;
}

.welcome-illustration {
  max-width: 260px;
  width: 80%;
}

.welcome-title {
  margin-top: 16px;
  font-size: 40px;
  font-style: italic;
}

.welcome-actions {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

/* Buttons */

.btn {
  border-radius: 999px;
  padding: 10px 20px;
  border: 2px solid #214732;
  background: transparent;
  color: #214732;
  font-size: 15px;
  cursor: pointer;
}

.btn-primary {
  background: #214732;
  color: #f7f0e5;
}

.btn-outline {
  background: transparent;
}

.btn-link {
  background: none;
  border: none;
  color: #214732;
  text-decoration: underline;
  padding: 8px 0;
}

.btn.full-width {
  width: 100%;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

/* Forms */

.field-label {
  display: block;
  font-size: 12px;
  margin-top: 12px;
  margin-bottom: 4px;
}

.field-input {
  width: 100%;
  border-radius: 8px;
  border: 1.5px solid #214732;
  background: #f7f0e5;
  padding: 8px 10px;
  font-size: 14px;
}

.helper-text {
  margin-top: 8px;
  font-size: 11px;
  opacity: 0.7;
}

.helper-text.small {
  font-size: 10px;
}

/* Host */

.host-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.host-form-card {
  border: 1.5px solid #214732;
  border-radius: 16px;
  padding: 18px 16px 20px;
  background: #f7f0e5;
}

.host-illustration-card {
  margin-top: 8px;
  text-align: center;
}

.broadcast-illustration {
  width: 100%;
  border-radius: 16px;
}

.screen-heading {
  font-size: 22px;
  margin-bottom: 8px;
}

.screen-heading.small {
  font-size: 18px;
}

.script-heading {
  font-size: 32px;
  font-style: italic;
}

/* Waiting room */

.waiting-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.waiting-art {
  text-align: center;
}

.waiting-illustration {
  width: 100%;
  border-radius: 12px;
}

.waiting-panel {
  margin-top: 4px;
}

.code-label {
  font-size: 13px;
  margin-top: 6px;
}

.code-label.small {
  font-size: 11px;
}

.code-value {
  font-weight: bold;
  letter-spacing: 0.2em;
  font-size: 18px;
}

.names-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

/* Join */

.join-inner {
  max-width: 360px;
  margin: 0 auto;
}

.code-input {
  text-transform: uppercase;
  letter-spacing: 0.4em;
}

/* Score screen */

.score-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.score-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.match-name-pill {
  min-height: 20px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #214732;
  font-size: 12px;
}

/* Serve setup */

.serve-setup {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed #214732;
}

.serve-options {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

/* Score box */

.score-box {
  margin-top: 12px;
  border-radius: 18px;
  border: 1.5px solid #214732;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.score-col {
  text-align: center;
}

.score-name {
  font-size: 14px;
  margin-bottom: 4px;
}

.score-set {
  font-size: 28px;
}

.score-game {
  font-size: 16px;
  margin-top: 2px;
}

.score-separator {
  font-size: 26px;
  padding: 0 8px;
}

/* Flip effect */

.flip-number {
  display: inline-block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.flip-number.flip {
  transform: rotateX(90deg);
  opacity: 0.3;
}

/* Court */

.court-wrapper {
  margin-top: 16px;
}

.court-illustration {
  width: 100%;
  border-radius: 16px;
}

/* Reason buttons */

.reason-panel-inline {
  margin-top: 18px;
}

.reason-title {
  font-size: 16px;
  margin-bottom: 10px;
}

.reason-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.reason-btn {
  border-radius: 10px;
  border: 1.5px solid #214732;
  background: #f7f0e5;
  padding: 8px 6px;
  font-size: 12px;
  cursor: pointer;
}

/* Rewrite score */

.rewrite-wrapper {
  margin-top: 16px;
}

.rewrite-panel {
  margin-top: 10px;
  border-radius: 14px;
  border: 1px dashed #214732;
  padding: 10px 12px;
}

.rewrite-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}

.rewrite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
}

.small-input {
  max-width: 90px;
  font-size: 12px;
  padding: 4px 8px;
}

.rewrite-actions {
  margin-top: 8px;
  display: flex;
  gap: 10px;
}

/* Stats */

.stats-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stats-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  border-radius: 18px;
  border: 1.5px solid #214732;
  padding: 14px 14px 18px;
}

.stats-visual {
  text-align: center;
}

.stats-illustration {
  width: 100%;
  border-radius: 12px;
}

.stats-content {
  margin-top: 4px;
}

.stats-list {
  list-style: none;
  margin-top: 8px;
  margin-bottom: 10px;
}

.stats-list li {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 13px;
}

/* Advice */

.advice-card {
  margin-top: 10px;
  border-radius: 14px;
  border: 1px dashed #214732;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
}

/* Timeline */

.timeline {
  margin-top: 10px;
  border-radius: 14px;
  border: 1px dashed #214732;
  padding: 10px 12px;
}

.history-list {
  list-style: none;
  margin-top: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.history-list li {
  font-size: 11px;
  margin-bottom: 4px;
}

/* Utility */

.hidden {
  display: none;
}
