<style>
html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #121212;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 48;
  font-size: 40px;
}

.container {
  width: 100%;
  min-height: 100vh;
  padding: 0;
}

.card {
  width: 100%;
  min-height: calc(100vh - 20px);
  border-radius: 0;
  padding: 15px;
  box-sizing: border-box;
}

h1, h2 {
  margin-top: 0;
  text-align: center;
}

input {
  width: 100%;
  box-sizing: border-box;
  height: 88px;
  padding: 0 16px;
  font-size: 40px;
  border-radius: 16px;
  border: 3px solid #d0d0d0;
}

.setup-label {
  display: block;
  text-align: center;
  color: #d4af37;
  font-size: 24px;
  font-weight: 700;
  margin-top: 15px;
}

.nickname-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

#nickname {
  flex: 1;
}

#randomNicknameButton,
#randomEditNickBtn {
  width: 80px !important;
  min-height: 88px !important;
  margin-top: 0 !important;
  flex-shrink: 0;
  font-size: 36px;
  background: #d4af37 !important;
  color: black !important;
  border: none !important;
}

#pinLoginTitle {
  margin-bottom: 10px;
  font-size: 2em;
  color: #f5f5f5;
}

.pin-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.pin-box {
  width: 72px;
  height: 90px;
  border-radius: 16px;
  border: 3px solid #d4af37;
  background: #202020;
  color: white;
  text-align: center;
  font-size: 42px;
  font-weight: 900;
  box-sizing: border-box;
}

.pin-box:focus {
  outline: none;
  border-color: #f4d06f;
  box-shadow: 0 0 12px rgba(212, 175, 55, .7);
}

button {
  width: 100%;
  min-height: 95px;
  margin-top: 20px;
  border: none;
  border-radius: 20px;
  font-weight: 900;
  font-size: 32px;
  cursor: pointer;
  background: #d4af37;
  color: black;
}

button:disabled {
  opacity: .5;
}

#remainingCreditsLabel,
#creditsUsedTitle {
  margin-bottom: -30px;
  font-size: 2em;
  color: #f5f5f5;
}

#credits {
  text-align: center;
  font-size: min(65vw, 280px);
  line-height: 1;
  font-weight: 900;
  color: white;
  margin: 10px 0;
}

#creditButton {
  background: linear-gradient(180deg, #f4d06f, #d4af37);
  color: black;
  font-size: 52px;
  min-height: 220px;
}

#logoutButton {
  background: #6c757d;
  color: white;
  min-height: 90px;
  font-size: 28px;
}

@media (max-width: 480px) {
  input {
    font-size: 28px;
    height: 85px;
  }
  button {
    font-size: 28px;
  }
  #creditButton {
    font-size: 42px;
    min-height: 180px;
  }
  .photo-thumbnail {
    width: 120px;
    height: 120px;
  }
  .photo-caption {
    font-size: 22px;
  }
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100000;
}

.celebration-icon {
  font-size: 110px;
  margin-bottom: 20px;
  animation: pulse 1.5s infinite;
}

/* --- YHTENÄISET TUMMAT POP-UP-IKKUNAT --- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100000;
}

.confirm-card {
  width: 90%;
  max-width: 550px;
  background: #202020;
  color: #f5f5f5;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 28px;
  padding: 28px;
  box-sizing: border-box;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
  text-align: center;
}

.help-card {
  width: 92%;
  max-width: 700px;
  max-height: 82dvh;
  background: #202020;
  color: #f5f5f5;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 28px;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
  text-align: left;
}

.confirm-card {
  text-align: center;
}

.confirm-title {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 20px;
  color: #f5f5f5;
}

#drinksOverlay #remainingCreditsLabel {
  color: #e0e0e0;
  font-size: 28px;
  margin-bottom: 0;
}

/* Pyöreä sulkemispainike (X) kaikissa ikkunoissa */
.dialog-close {
  width: 52px !important;
  height: 52px !important;
  min-height: 52px !important;
  flex-shrink: 0;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  justify-content: center;
  align-items: center;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.35) !important;
  color: #ffffff !important;
  transition: background 0.15s ease, transform 0.1s ease;
}

.dialog-close:hover {
  background: rgba(255, 255, 255, 0.18) !important;
}

.dialog-close .material-symbols-outlined {
  font-size: 30px !important;
}

/* Tummat painikkeet valkoisella ääriviivalla pop-up-ikkunoissa (ei koske sulkemisrastia) */
.confirm-card button:not(.dialog-close),
.help-card button:not(.dialog-close) {
  width: 100%;
  background: #181818;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 18px;
  min-height: 85px;
  font-size: 30px;
  font-weight: 700;
  margin-top: 16px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.confirm-card button:not(.dialog-close):hover,
.help-card button:not(.dialog-close):hover {
  background: #2c2c2c;
}

.confirm-card button:not(.dialog-close):active,
.help-card button:not(.dialog-close):active {
  transform: scale(0.98);
}

/* Vahvistus- ja peruutusnappien hienovaraiset korostukset */
.confirm-yes {
  border-color: #4ade80 !important;
  color: #4ade80 !important;
  min-height: 110px !important;
  font-size: 38px !important;
}

.confirm-no {
  border-color: rgba(255, 255, 255, 0.5) !important;
  color: #cccccc !important;
  min-height: 90px !important;
  font-size: 32px !important;
}

/* Drinkit-ikkunan pääpainike */
#drinksOverlay #creditButton {
  background: linear-gradient(180deg, #f4d06f, #d4af37);
  color: #121212;
  border: 2px solid #ffffff;
  min-height: 160px;
  font-size: 40px;
  font-weight: 900;
}

#drinksOverlay #creditButton:disabled {
  background: #2a2a2a;
  color: #888888;
  border-color: rgba(255, 255, 255, 0.25);
  opacity: 1;
}

.event-banner {
  width: 100%;
  display: block;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}

.info-box {
  background: rgba(212, 175, 55, .15);
  border: 2px solid #d4af37;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  color: white;
  font-size: 30px;
  line-height: 1.5;
  white-space: pre-line;
}

.stars {
  font-size: 65px;
  color: #888;
  margin: 20px 0;
  text-align: center;
}

.stars span {
  cursor: pointer;
}

.stars span.selected {
  color: #d4af37;
  text-shadow: 0 0 8px rgba(212, 175, 55, .6);
}

.section-divider {
  height: 2px;
  margin: 25px 0;
  border: none;
  background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

#ratingTitle {
  color: #f5f5f5;
}

.rating-summary {
  text-align: center;
  margin: 20px 0 30px 0;
  color: #d4af37;
  font-size: 48px;
  font-weight: 900;
  white-space: nowrap;
}

.rating-summary .rating-count {
  font-size: 26px;
  font-weight: 500;
  color: #e7d6a0;
  vertical-align: middle;
}

.rating-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.comment-card {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(212, 175, 55, .4);
  border-radius: 12px;
  padding: 15px;
  text-align: left;
}

.comment-nick {
  font-size: 26px;
  font-weight: 700;
  color: #f0e0b0;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.comment-stars {
  font-size: 32px;
  color: #d4af37;
  text-shadow: 0 0 6px rgba(212, 175, 55, .5);
}

.comment-text {
  font-size: 30px;
  color: #f5f5f5;
  line-height: 1.4;
}

textarea {
  width: 100%;
  min-height: 240px;
  border-radius: 16px;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.4;
  padding: 18px;
  box-sizing: border-box;
  resize: vertical;
}

textarea::placeholder {
  color: #999;
}

.loading-area {
  text-align: center;
  color: #d4af37;
  font-size: 28px;
  padding-top: 80px;
}

.loading-spinner {
  width: 90px;
  height: 90px;
  margin: 20px auto;
  border: 10px solid rgba(212, 175, 55, .2);
  border-top: 10px solid #d4af37;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.help-card h2 {
  text-align: center;
  color: #d4af37;
  margin-bottom: 25px;
}

.help-section {
  margin-bottom: 25px;
}

.help-section-title {
  color: #d4af37;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.help-section-text {
  font-size: 22px;
  line-height: 1.5;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

#communityFeed {
  height: calc(100vh - 480px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 8px;
  padding-bottom: 140px;
}

.photo-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.photo-thumbnail {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid rgba(212, 175, 55, .4);
}

.photo-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.photo-caption {
  color: #f5f5f5;
  font-size: 26px;
  line-height: 1.4;
  word-break: break-word;
}

.image-close {
  position: fixed !important;
  right: 20px !important;
  top: 20px !important;
  z-index: 100005 !important;
  background: rgba(20, 20, 20, 0.85) !important;
  border: 2px solid rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
}

.image-viewer {
  position: relative;
  width: 95%;
  max-width: 1200px;
  max-height: 92vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.full-image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
}

.camera-button {
  font-size: 56px;
  cursor: pointer;
  user-select: none;
  line-height: 1;
  color: #d4af37;
}

#photoPreviewContainer {
  margin: 15px 0;
  text-align: center;
}

#photoPreview {
  display: inline-block;
  max-width: 220px;
  max-height: 220px;
  border-radius: 10px;
  border: 2px solid rgba(212, 175, 55, .4);
}

#removePhotoButton {
  margin-top: 10px;
  min-height: 60px;
  font-size: 24px;
  background: #dc3545;
  color: white;
}

#totalCreditsUsed {
  font-size: min(50vw, 220px);
  text-align: center;
  color: #d4af37;
  font-weight: 900;
}

.admin-section {
  border: 1px solid rgba(212, 175, 55, .4);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 20px;
  font-size: 28px;
}

.admin-section h3 {
  color: #d4af37;
  margin-top: 0;
}

#adminUser {
  width: 100%;
  height: 75px;
  font-size: 28px;
  border-radius: 14px;
  padding: 0 12px;
}

.admin-user-stats {
  margin: 15px 0;
  font-size: 36px;
  color: #f5f5f5;
}

.admin-user-stats div {
  margin-bottom: 10px;
}

.top-bar {
  position: relative;
}

#feedComposer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, .95);
  z-index: 500;
}

.composer-input {
  flex: 1;
  margin: 0;
  height: 90px;
  min-height: 90px;
  text-align: left;
  background: white;
  color: #444;
  border-radius: 18px;
  display: flex;
  align-items: center;
  font-size: 30px;
  padding-left: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 16px;
}

.composer-camera {
  width: 90px;
  height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 18px;
  background: #000;
  border: 2px solid rgba(255, 255, 255, .9);
  color: white;
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.composer-camera:hover {
  border-color: #d4af37;
  color: #d4af37;
}

.menu-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #1c1c1c;
  margin: 0 -24px 16px -24px;
  padding: 24px 24px 14px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  min-height: 50px;
}

.menu-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 64px;
  height: 64px;
  min-height: 64px;
  margin: 0;
  padding: 0;
  display: flex;
  background: transparent;
  justify-content: center;
  align-items: center;
  border: none;
  border-radius: 50%;
  color: rgba(255, 255, 255, .85);
}

.menu-close .material-symbols-outlined {
  font-size: 48px;
}

.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 16px;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 18px;
  color: white;
  font-size: 36px;
  text-align: left;
  min-height: auto;
  transition: all .2s ease;
}

.menu-item .material-symbols-outlined {
  color: #d4af37;
  font-size: 42px;
}

.menu-item:hover {
  background: rgba(255, 255, 255, .08);
}

#menuButton {
  position: absolute;
  right: 20px;
  top: 20px;
  width: 80px;
  min-height: 80px;
  margin: 0;
  padding: 0;
  z-index: 100;
  background: rgba(0, 0, 0, .50);
  border: 2px solid rgba(255, 255, 255, .2);
  color: white;
}

#menuButton .material-symbols-outlined {
  font-size: 60px;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 99999;
}

.menu-title {
  font-size: 36px;
  font-weight: 700;
  color: #d4af37;
  margin-bottom: 16px;
  text-align: center;
  padding-right: 44px;
}

.menu-divider {
  border: none;
  height: 1px;
  background: rgba(255, 255, 255, .08);
  margin: 20px 0;
}

.side-menu {
  position: absolute;
  right: 15px;
  top: 15px;
  width: min(420px, 92vw);
  max-height: calc(100vh - 30px);
  padding: 0 24px 24px 24px;
  box-sizing: border-box;
  border-radius: 28px;
  overflow-y: auto;
  background: linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03)), rgba(20, 20, 20, .92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}

.side-menu button {
  width: 100%;
  margin-bottom: 12px;
}

.dialog-header {
  flex-shrink: 0;
  background: #202020;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 30px 18px 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #d4af37;
}

.dialog-header h2 {
  margin: 0;
  color: #d4af37;
  text-align: left;
}

/* Koska confirm-cardissa on jo oma padding: 28px, tasataan sen otsikkopalkki */
.confirm-card .dialog-header {
  padding: 0 0 16px 0;
  margin-bottom: 20px;
}

#helpContent,
#dynamicContent,
.dialog-scroll-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 22px 26px 40px 26px;
  box-sizing: border-box;
}

/* Julkaisudialogin (shareOverlay) sisällön asettelu */
#shareOverlay .help-card {
  overflow-y: auto;
  padding-bottom: 30px;
}

#shareOverlay .help-card > *:not(.dialog-header) {
  width: auto !important;
  max-width: 100% !important;
  margin-left: 26px !important;
  margin-right: 26px !important;
  box-sizing: border-box !important;
}

#shareOverlay #photoPreviewContainer button {
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.dialog-close {
  width: 52px;
  height: 52px;
  min-height: 52px;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .15);
  color: white;
}

.dialog-close .material-symbols-outlined {
  font-size: 32px;
}

/* --- DYNAAMINEN SISÄLTÖ (OHJELMA & MENU) --- */

.dynamic-heading {
  color: #d4af37;
  font-size: 28px;
  font-weight: 800;
  margin-top: 22px;
  margin-bottom: 8px;
}

.dynamic-heading:first-child {
  margin-top: 0;
}

.dynamic-bullet {
  color: #f5f5f5;
  font-size: 24px;
  line-height: 1.5;
  padding-left: 14px;
  margin-bottom: 4px;
}

/* Varmistetaan, että vahvistus-, viesti- ja kuulutusikkunat ovat aina päällimmäisenä */
#confirmOverlay,
#messageOverlay,
#announcementOverlay {
  z-index: 200000 !important;
}

/* Sivuvalikon nimimerkki */
.menu-user-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: -12px auto 12px auto;
  padding: 8px 18px;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 20px;
  color: #f0e0b0;
  font-size: 24px;
  font-weight: 700;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-header {
  text-align: center;
}

/* --- TEKSTIKOON VALITSIN VALIKOSSA --- */

.font-size-bar {
  display: flex;
  gap: 10px;
  margin: 12px 0;
  padding: 0 8px;
}

.font-size-btn {
  flex: 1;
  min-height: 68px !important;
  margin: 0 !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f5f5f5 !important;
  border: 1.5px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 16px !important;
  font-weight: 800;
}

.font-size-btn:nth-child(1) { font-size: 24px !important; }
.font-size-btn:nth-child(2) { font-size: 30px !important; }
.font-size-btn:nth-child(3) { font-size: 36px !important; }

.font-size-btn.active {
  background: #d4af37 !important;
  color: #121212 !important;
  border-color: #d4af37 !important;
}

/* Korostettu viestikortti, kun käyttäjä on mainittu (@nimimerkki) */
.comment-card.mentioned {
  border: 2px solid #ffffff !important;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

/* Klikattava nimimerkki syötteessä */
.comment-nick {
  cursor: pointer;
  text-decoration: underline dotted rgba(212, 175, 55, 0.5);
  text-underline-offset: 4px;
}

.comment-nick:active {
  color: #ffffff;
}

/* Automaattinen @-täydennyslista julkaisuikkunassa */
.mention-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding: 10px;
  background: #141414;
  border: 1.5px solid #d4af37;
  border-radius: 14px;
}

.mention-chip {
  width: auto !important;
  min-height: 48px !important;
  margin: 0 !important;
  padding: 8px 16px !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  border-radius: 20px !important;
  background: rgba(212, 175, 55, 0.18) !important;
  color: #f0e0b0 !important;
  border: 1px solid #d4af37 !important;
}

.mention-chip:active {
  background: #d4af37 !important;
  color: #121212 !important;
}

.like-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.like-btn {
  width: auto !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 6px 16px !important;
  border-radius: 24px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #e0e0e0 !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.12s ease, background 0.15s ease;
}

.like-btn:active {
  transform: scale(1.15);
}

.like-btn.liked {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: #ef4444 !important;
  color: #ff6b6b !important;
}

.like-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.hide-post-btn {
  width: auto !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 6px 14px !important;
  border-radius: 24px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  font-size: 22px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.comment-card.hidden-post {
  opacity: 0.45;
  border-style: dashed !important;
  border-color: #dc3545 !important;
  background: rgba(220, 53, 69, 0.08) !important;
  border: 2px dashed #dc3545 !important;

}

</style>
