main { max-width: 1100px; margin: auto; padding: 24px; display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
.wheel-panel { text-align: center; }
h1, h2 { margin-top: 0; }
aside { max-width: 340px; width: 100%; justify-self: end; padding: 20px; border-radius: 12px; background: color-mix(in srgb, var(--panel) 55%, transparent); }
h2 { color: var(--accent); }
canvas { display: block; margin: auto; width: min(100%, 62vh); height: auto; background: var(--wheel); border-radius: 50%; }
#selected { min-height: 2em; font-size: 1.6rem; font-weight: bold; color: #a7ffd0; text-shadow: 0 0 12px #008e59; overflow-wrap: anywhere; }
.actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
button { padding: 9px 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--button); color: white; font: inherit; cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
#history { max-height: 45vh; overflow: auto; overflow-wrap: anywhere; padding-left: 25px; }
li { margin-bottom: 8px; }
@media (max-width: 680px) {
  main { grid-template-columns: 1fr; padding: 16px; }
  aside { max-width: none; }
}

body {
  --panel: #233349;
  --accent: #c4deff;
  --wheel: #202e42;
  --button: #294a76;
  --border: #7195bf;
  margin: 0;
  min-height: 100vh;
  color: #f1f5ff;
  font: 1rem system-ui, sans-serif;
  background: #111c2b;
}
* { box-sizing: border-box; }

select { max-width: 100%; font: inherit; }

.sound-prompt {
  width: 440px;
  max-width: calc(100% - 32px);
  margin: auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: inherit;
  background: var(--panel);
  text-align: center;
}
.sound-prompt::backdrop { background: transparent; }
.sound-prompt p { margin: 0 0 20px; }
.sound-prompt label { font-size: 1.2rem; font-weight: bold; color: var(--accent); }
.sound-prompt select { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--wheel); color: inherit; }
.sound-prompt button { min-width: 140px; padding: 11px 16px; margin: 4px; }
@media (max-width: 420px) { .sound-prompt { padding: 22px; } .sound-prompt button { min-width: 0; } }
.wheel-frame { position: relative; margin: auto; width: min(100%, var(--wheel-size, 62vh)); }
.wheel-frame canvas { width: 100%; }
.wheel-frame.has-members::after {
  content: "";
  position: absolute;
  top: 2.2%;
  left: 48%;
  width: 4%;
  height: 5.3%;
  background: white;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  pointer-events: none;
}
html { scrollbar-gutter: stable; }
.wheel-frame { overflow: clip; }
#soundStatus:empty { display: none; }
#status { min-height: 1.5em; }
.settings-section { margin-top: 16px; }
.settings-section + .settings-section { padding-top: 16px; border-top: 1px solid var(--border); }
.settings-section h3 { margin: 0 0 10px; font-size: 1rem; }
#absenceStatus:empty { display: none; }
#absenceList label { display: block; padding: 4px 0; }
.command-sidebar { display: grid; gap: 16px; min-width: 0; }
@media (min-width: 681px) {
  main {
    max-width: none;
    margin: 0;
    padding-right: 16px;
    display: flex;
  }
  .wheel-panel { flex: 1; min-width: 0; }
  .command-sidebar { flex: 0 0 clamp(235px, 27vw, 340px); margin-inline-start: auto; }
}

.theme-choices { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.theme-choice { padding: 4px 0; border: 0; border-radius: 0; background: transparent; color: inherit; text-align: left; }
.theme-choice:hover:not(:disabled), .theme-choice:focus-visible { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.theme-choice[aria-pressed="true"] { color: var(--accent); font-weight: bold; text-decoration: underline; text-underline-offset: 4px; }
#themeStatus:empty { display: none; }

@media (any-pointer: fine) {
  html.is-loading, html.is-loading * { cursor: none !important; }
  html.is-loading #loadingCursor.has-position { display: block; }
}
#loadingCursor { display: none; position: fixed; left: 50%; top: 50%; width: 32px; height: 32px; margin: -16px 0 0 -16px; z-index: 2147483647; pointer-events: none; background: url("/loading-spinner.svg") center / contain no-repeat; animation: cursor-spin .9s linear infinite; }
@keyframes cursor-spin { to { transform: rotate(360deg); } }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-heading h2, .section-heading h3 { margin: 0; }
.text-action { padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--accent); font-size: .8rem; }
.text-action:hover:not(:disabled), .text-action:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

.confirm-dialog { width: min(420px, calc(100% - 32px)); padding: 24px; border: 1px solid var(--border); border-radius: 12px; color: inherit; background: var(--panel); box-shadow: 0 16px 60px #0008; }
.confirm-dialog::backdrop { background: #0009; }
.confirm-dialog h2 { margin: 0 0 12px; font-size: 1.25rem; }
.confirm-dialog p { margin: 0 0 24px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }


.history-panel .section-heading { gap: 8px; }
.history-panel .section-heading h2 { font-size: 1.25rem; }
.statistics-dialog { width: min(850px, calc(100% - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; padding: 28px; }
.statistics-dialog .section-heading { align-items: center; }
.statistics-dialog .section-heading h2 { margin: 0; }
.statistics-dialog .statistics-caption { margin: 8px 0 20px; color: var(--accent); font-size: .9rem; }
.statistics-summary { display: flex; align-items: baseline; gap: 10px; margin-bottom: 28px; }
.statistics-summary strong { font-size: 2.5rem; color: var(--accent); line-height: 1; }
.statistics-summary span { opacity: .75; font-size: .9rem; }
.statistics-scroll { overflow-x: auto; padding: 28px 4px 12px; }
.statistics-chart { display: flex; gap: 16px; min-width: 100%; width: max-content; }
.statistics-column { flex: 1 0 72px; width: 72px; max-width: 120px; text-align: center; }
.statistics-plot { height: 210px; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--border); background: repeating-linear-gradient(to top, transparent 0, transparent 51px, #ffffff10 52px, transparent 53px); }
.statistics-bar { position: relative; width: 70%; border-radius: 7px 7px 0 0; background: linear-gradient(to top, #377fc7, #8dcaff); min-height: 2px; }
.statistics-count { position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%); font-weight: bold; font-size: .9rem; }
.statistics-name { margin-top: 12px; font-size: .8rem; line-height: 1.35; overflow-wrap: anywhere; }
.statistics-dialog .statistics-note { margin: 20px 0 0; font-size: .8rem; opacity: .65; }
@media (max-width: 480px) { .statistics-dialog { padding: 18px; } }

main.home-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px; }
.home-page h1 { margin: 0; font-size: clamp(2rem, 6vw, 3.5rem); }
.create-team-form { display: grid; gap: 10px; }
.create-team-form input, .create-team-form textarea { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--wheel); color: inherit; font: inherit; }
.create-team-form textarea { resize: vertical; }
.create-team-form .dialog-actions { margin-top: 12px; }
html.is-loading:not(:has(#loadingCursor)) , html.is-loading:not(:has(#loadingCursor)) * { cursor: wait !important; }

.puzzle-help { font-size: .85rem; }
.puzzle-layout { display: flex; align-items: flex-start; gap: 14px; }
.puzzle-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; width: 100%; max-width: 270px; aspect-ratio: 1; flex: 1; }
.puzzle-tile { min-width: 0; padding: 0; border: 0; border-radius: 3px; background: url("/puzzle-landscape.svg") no-repeat; background-size: 300% 300%; aspect-ratio: 1; }
.puzzle-tile[aria-pressed="true"], .puzzle-tile:focus-visible { outline: 3px solid #ffe49c; outline-offset: -3px; }
.puzzle-tile:disabled { opacity: 1; }
.puzzle-preview { margin: 0; width: 70px; flex-shrink: 0; }
.puzzle-preview img { width: 100%; border-radius: 4px; }
.puzzle-preview figcaption { font-size: .7rem; text-align: center; opacity: .7; }
#puzzleStatus { font-size: .85rem; color: var(--accent); margin: 12px 0 0; }
#teamPuzzle h3 { margin: 8px 0; }

#absenceHeading { font-size: 1.25rem; }
.manage-members { padding: 0; list-style: none; }
.manage-members li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; }
.manage-members span { min-width: 0; overflow-wrap: anywhere; }
.members-heading { font-size: 1rem; margin: 20px 0 10px; }
#membersStatus:empty { display: none; }

#renameStatus:empty { display: none; }
 .team-name-section { margin-bottom: 24px; }
.team-name-section h3 { margin: 0 0 10px; font-size: 1rem; }
.team-name-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.team-name-row[hidden] { display: none; }
.team-name-row span { min-width: 0; overflow-wrap: anywhere; }
.team-name-row button { flex-shrink: 0; }

.team-cabinet > summary { cursor: pointer; color: var(--accent); font-size: 1.25rem; font-weight: bold; }
.cabinet-content { padding-top: 20px; }

.member-actions { display: flex; gap: 10px; flex-shrink: 0; }
.member-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: 100%; }
.member-edit input { width: 100%; min-width: 0; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--wheel); color: inherit; font: inherit; }
#addMembersForm .section-heading { margin: 0; }
#membersHeading { font-size: 1rem; }

.create-team-form[hidden] { display: none; }

.team-link-section { margin-bottom: 24px; }
.team-link-section h3 { margin: 0 0 10px; font-size: 1rem; }
#teamSpaceLink { min-width: 0; overflow-wrap: anywhere; color: var(--accent); font-size: .8rem; }
#copyLinkStatus { font-size: .8rem; }
#copyLinkStatus:empty { display: none; }

.sound-prompt { max-height: calc(100vh - 32px); overflow-y: auto; }
.sound-prompt h2 { margin: 0 0 24px; font-size: 1.3rem; color: var(--accent); }
.sound-prompt .popular-heading { margin: 0 0 12px; font-size: .9rem; text-align: left; }
.start-theme-options { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; }
.sound-prompt .start-theme-option { min-width: 0; flex: none; margin: 0; padding: 4px 0; border: 0; border-radius: 0; background: transparent; color: inherit; text-align: left; }
.start-theme-option:hover, .start-theme-option:focus-visible { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.start-theme-option[aria-pressed="true"] { color: var(--accent); font-weight: bold; text-decoration: underline; text-underline-offset: 4px; }
.sound-prompt #toggleAllThemes { display: block; min-width: 0; padding: 4px 0; margin: 0 0 16px; }
.all-themes { text-align: left; max-height: 260px; overflow-y: auto; margin-bottom: 12px; }
.all-themes section { margin-top: 16px; }
.all-themes h3 { font-size: .85rem; color: var(--accent); margin: 0 0 8px; }
.sound-prompt .random-theme { min-width: 0; padding: 4px 0; margin: 0 0 20px; }
.random-theme[aria-pressed="true"] { color: var(--accent); text-decoration: underline; }
#startThemeStatus:empty { display: none; }

.sound-prompt .random-theme { display: block; text-align: left; }
.sound-actions { display: flex; flex-wrap: nowrap; gap: 12px; margin-top: 20px; }
.sound-prompt .sound-actions button { flex: 1 1 0; min-width: 0; margin: 0; padding: 11px 8px; white-space: nowrap; }

.site-trust-seal { display: flex; justify-content: center; padding: 24px; }
main.home-page { min-height: calc(100vh - 114px); }

.puzzle-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.puzzle-heading .text-action { white-space: nowrap; }

.team-created-dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.team-created-dialog .created-team-name { font-weight: bold; color: var(--accent); overflow-wrap: anywhere; margin-bottom: 20px; }
.created-link-label { display: block; font-size: .9rem; margin-bottom: 8px; }
.created-link-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.created-link-row input { flex: 1 1 230px; min-width: 0; width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--wheel); color: inherit; font: inherit; font-size: .85rem; }
#createdLinkStatus:empty { display: none; }
.team-created-dialog #createdLinkStatus { margin: 8px 0 0; font-size: .8rem; color: var(--accent); }
.team-created-dialog h3 { font-size: 1rem; margin: 24px 0 10px; }
.team-quick-guide { padding-left: 20px; font-size: .9rem; line-height: 1.5; margin-bottom: 24px; }

.copy-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; padding: 6px; }
.copy-icon:hover:not(:disabled), .copy-icon:focus-visible { color: white; background: color-mix(in srgb, var(--accent) 15%, transparent); border-radius: 5px; }
