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

[v-cloak] {
  display: none;
}

a {
  color: #4f6d7a;
}

body {
  font-family: serif;
  padding: 2rem;
  background: #fefdfb;
  color: #2d2d2d;
}

#fade-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fefdfb;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 9999;
}

#fade-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

#content {
  max-width: 600px;
  margin: 0 auto;
}

.context {
  max-height: 100px;
  overflow-y: auto;
  transition:
    max-height 0.3s ease,
    padding 0.3s ease;
  padding: 1rem 0;
  mask-image: linear-gradient(
    to bottom,
    transparent,
    black 2rem,
    black calc(100% - 2rem),
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent,
    black 2rem,
    black calc(100% - 2rem),
    transparent
  );
}

.context.hidden {
  max-height: 0;
  padding: 0;
  overflow: hidden;
}

.haiku {
  padding: 1rem 0;
  white-space: nowrap;
}

.meta {
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
  text-align: right;
}

.meta img {
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  object-fit: cover;
  padding: 0.3rem;
}

.session-number,
.period {
  text-decoration: underline;
  text-decoration-style: dotted;
}

button {
  padding: 0.5rem;
}

.voting {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.voting button {
  margin-top: 1rem;
  width: 9rem;
}

.score {
  max-width: 18.5rem;
  margin: 0 auto;
  margin-top: 0.5rem;
  overflow: hidden;
  transition:
    height 0.3s ease,
    margin 0.3s ease;
}

.score.hidden {
  height: 0px;
  margin: 0;
}

.score-bars {
  display: grid;
  height: 0.5rem;
  transition: grid-template-columns 0.3s ease;
  border-radius: 0.15rem;
  overflow: hidden;
}
.upvotes-score-bar {
  background: #387e2a;
}
.downvotes-score-bar {
  background: #bf4040;
}

.score-counts {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}
.upvotes-score-count {
  color: #387e2a;
}
.downvotes-score-count {
  color: #bf4040;
}

.change-haiku {
  width: 18.5rem;
  max-width: 100%;
  display: block;
  margin: 0.5rem auto;
}

nav {
  margin-top: 3rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

nav a {
  white-space: nowrap;
}

.mode-buttons-container {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}
.mode-buttons-container button {
  width: 9rem;
}

.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 2rem;
}
.table {
  min-width: 600px;
  max-height: 60vh;
  border-collapse: collapse;
  padding: 0 0.5rem;
}
.header,
.row {
  display: grid;
  align-items: center;
}
.header {
  font-weight: bold;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.5rem 0;
}
.sortable-header {
  cursor: pointer;
  user-select: none;
}
.row {
  padding: 0.4rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.row:last-child {
  border-bottom: none;
}
.cell {
  padding: 0.25rem 0.5rem;
}
.sortable-header,
.cell.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
