/* Standalone material library and touch controls for the classroom player. */
.materials-app {
  --materials-ink: #172b4d;
  --materials-muted: #5e6e83;
  --materials-line: #dce4ef;
  background: #f4f7fb;
  color: var(--materials-ink);
  min-height: 100dvh;
}
.materials-app .btn { min-height: 46px; border-radius: 10px; font-weight: 650; }
.materials-app .btn:focus-visible, .materials-app a:focus-visible,
.material-player-page .btn:focus-visible, .material-player-page a:focus-visible {
  outline: 3px solid #22d3ee; outline-offset: 4px;
}
.materials-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem max(1.25rem, calc((100% - 1240px) / 2));
  background: #fff; border-bottom: 1px solid var(--materials-line);
}
.materials-brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--materials-ink); }
.materials-brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: #eaf0ff; color: #284caf; flex-shrink: 0; }
.materials-brand-mark svg { width: 29px; height: 29px; }
.materials-brand-name { display: block; font-size: 1.15rem; font-weight: 800; letter-spacing: -.025em; }
.materials-brand-subtitle { display: block; color: var(--materials-muted); font-size: .78rem; margin-top: .1rem; }
.materials-header-actions { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.materials-games-link { font-size: .88rem; color: #425674; text-decoration: none; padding: .7rem .5rem; }
.materials-games-link:hover { color: #1e3a8a; text-decoration: underline; }
.materials-header-actions .btn { background: #fff; border-color: var(--materials-line); }
#btn-material-account { background: #eef3ff; border-color: #dae5fb; color: #244591; max-width: 240px; overflow-wrap: anywhere; }
.materials-main { width: min(1288px, 100%); margin: 0 auto; padding: 2rem 1.5rem; }
.materials-hero {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(270px, .85fr); gap: 2.5rem;
  padding: clamp(1.75rem, 4vw, 3rem); border-radius: 24px; color: #fff;
  background: radial-gradient(ellipse at 95% 0%, #256b87 0%, transparent 55%), #193766;
  box-shadow: 0 16px 35px -24px #12294b80;
}
.materials-hero-copy { align-self: center; }
.materials-kicker { display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem; font-weight: 600; color: #d2e9f7; }
.materials-kicker > span { width: 7px; height: 7px; border-radius: 50%; background: #64dbd4; }
.materials-hero h1 { margin: .9rem 0 1rem; font-size: clamp(2rem, 3.2vw, 2.75rem); line-height: 1.18; letter-spacing: -.045em; }
.materials-hero-copy > p { color: #d3dfef; font-size: .97rem; line-height: 1.8; max-width: 550px; }
.community-share-actions, .material-actions { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.community-share-actions { margin-top: 1.7rem; }
.materials-hero .btn-primary { background: #fff; border-color: #fff; color: #203e78; box-shadow: 0 5px 16px #091d3533; gap: .6rem; }
.materials-hero .btn-primary:hover { background: #eef5ff; border-color: #eef5ff; }
.materials-hero .btn-primary > span { font-size: 1.35rem; font-weight: 400; line-height: 1; }
.materials-hero-link { padding: .7rem .6rem; color: #eef6ff; font-size: .9rem; text-decoration: none; }
.materials-hero-link span { margin-left: .5rem; }
.materials-hero-link:hover { text-decoration: underline; }
.materials-board-guide { padding: 1.35rem 1.5rem; border: 1px solid #ffffff29; border-radius: 18px; background: #ffffff0c; }
.materials-guide-art { height: 95px; display: grid; place-items: center; margin-bottom: 1rem; }
.materials-guide-slide { position: relative; display: grid; place-items: center; width: 166px; height: 90px; color: #3468a2; border-radius: 9px; background: #f5f9ff; box-shadow: 8px 8px 0 #7ed5dd29, -7px -7px 0 #ffffff0e; }
.materials-guide-slide svg { width: 42px; height: 42px; }
.materials-guide-lines { position: absolute; left: 12px; top: 12px; height: 4px; width: 30px; border-radius: 8px; background: #b8cde5; box-shadow: 0 8px 0 #e1eaf5; }
.materials-guide-slide-dots { position: absolute; display: flex; gap: 4px; bottom: 9px; }
.materials-guide-slide-dots i { width: 4px; height: 4px; background: #c9d8e9; border-radius: 50%; }
.materials-guide-slide-dots i:first-child { background: #4381be; }
.materials-guide-label { font-size: .66rem; font-weight: 700; letter-spacing: .13em; color: #a6d6e3; }
.materials-board-guide h2 { font-size: 1.02rem; margin: .25rem 0 .7rem; }
.materials-board-guide ol { list-style: none; counter-reset: guide; display: grid; gap: .45rem; font-size: .82rem; color: #d9e7f5; }
.materials-board-guide li { counter-increment: guide; display: flex; align-items: center; gap: .5rem; }
.materials-board-guide li::before { content: counter(guide); display: grid; place-items: center; width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%; background: #ffffff14; font-size: .68rem; color: #fff; }
.materials-board-guide p { font-size: .72rem; margin-top: .8rem; color: #abd4df; }
.materials-tabs { display: inline-flex; gap: .3rem; padding: .35rem; margin: 2rem 0 1.75rem; background: #e8edf5; border-radius: 13px; max-width: 100%; }
.materials-tabs .btn { background: transparent; border: 0; color: #586b87; padding: .7rem 1.15rem; font-size: .9rem; }
.materials-tabs .btn[aria-pressed="true"] { background: #fff; color: #203f7a; box-shadow: 0 2px 6px #19376612; }
#materials-catalog { scroll-margin-top: 1.5rem; }
.materials-intro { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.materials-section-kicker { display: block; font-size: .68rem; font-weight: 750; letter-spacing: .1em; color: #607996; margin-bottom: .35rem; }
.materials-intro h2 { font-size: clamp(1.35rem, 2.3vw, 1.7rem); letter-spacing: -.03em; margin: 0 0 .4rem; color: var(--materials-ink); }
.materials-intro p { color: var(--materials-muted); font-size: .9rem; line-height: 1.6; }
.materials-intro .materials-count { background: #e9eff8; border: 1px solid #dce6f3; color: #365179; padding: .4rem .75rem; border-radius: 20px; font-size: .78rem; font-weight: 600; }
.materials-toolbar { display: grid; grid-template-columns: minmax(220px, 1.6fr) minmax(120px, .7fr) minmax(140px, 1fr) auto; gap: .85rem; align-items: end; padding: 1.1rem; background: #fff; border: 1px solid var(--materials-line); border-radius: 14px; margin-bottom: 1.5rem; }
.materials-toolbar label { min-width: 0; font-size: .76rem; color: #526581; font-weight: 650; }
.materials-toolbar input, .materials-toolbar select { width: 100%; margin-top: .4rem; min-width: 0; font-size: .88rem; border-color: var(--materials-line); background: #fbfcfe; min-height: 46px; }
.materials-toolbar .btn { font-size: .8rem; color: #536784; border-color: var(--materials-line); background: #fff; }
#materials-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1.3rem; }
.material-card { padding: 0; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--materials-line); border-radius: 16px; background: #fff; overflow: hidden; box-shadow: 0 3px 9px #19376605; transition: box-shadow .18s, border-color .18s; }
.material-card:hover, .material-card:focus-within { border-color: #a8bddb; box-shadow: 0 10px 24px #1937660e; }
.material-card-cover { position: relative; display: flex; align-items: center; gap: 1rem; padding: 1.3rem 1.5rem; background: linear-gradient(120deg, #e9effb, #eef7fa); min-height: 110px; color: #315789; overflow: hidden; }
.material-card-cover::after { content: ""; position: absolute; right: -12px; top: -26px; width: 100px; height: 100px; border: 16px solid #ffffff45; border-radius: 50%; pointer-events: none; }
.material-cover-icon { display: grid; place-items: center; width: 66px; height: 58px; border: 1px solid #d5e3f3; border-radius: 12px; background: #ffffffb3; flex-shrink: 0; transition: opacity .2s ease; }
.material-cover-icon svg { width: 42px; height: 42px; }
.material-cover-preview { position: absolute; inset: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; pointer-events: none; z-index: 1; opacity: 0; transition: opacity .22s ease; }
.material-card-cover.has-preview .material-cover-preview { opacity: 1; background: #0f172a; }
.material-card-cover.has-preview .material-cover-icon { opacity: 0; visibility: hidden; }
.material-cover-canvas { max-width: 100%; max-height: 100%; width: auto !important; height: auto !important; object-fit: contain; display: block; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.material-cover-preview .material-pptx-preview { width: 100%; height: 100%; background: #0f172a; }
.material-cover-format { position: relative; z-index: 2; }
.material-card-cover.has-preview .material-cover-format { background: rgba(15, 23, 42, .78); color: #f8fafc; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); font-weight: 600; }
.material-cover-subject { font-size: .9rem; font-weight: 700; overflow-wrap: anywhere; position: relative; z-index: 1; }
.material-card-body { padding: 1.25rem; display: flex; flex-direction: column; gap: .85rem; flex: 1; }
.material-card-badges { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.material-grade-badge { background: #eef3ff; color: #315296; border-radius: 6px; padding: .2rem .5rem; font-size: .72rem; font-weight: 650; }
.material-format-badge { font-size: .72rem; color: #697b91; }
.material-card h4 { font-size: 1.16rem; font-weight: 750; line-height: 1.4; letter-spacing: -.025em; margin: 0; overflow-wrap: anywhere; }
.material-card p { margin: 0; overflow-wrap: anywhere; }
.material-description { color: #62738a; font-size: .85rem; line-height: 1.65; }
.material-author { font-size: .76rem; color: #5a7091; overflow-wrap: anywhere; text-decoration: none; margin: .15rem 0; }
.material-author:hover { text-decoration: underline; color: #244992; }
.material-card .material-actions { margin-top: auto; padding-top: .75rem; border-top: 1px solid #edf1f7; align-items: stretch; }
.material-card .material-actions .btn { font-size: .78rem; min-height: 44px; }
.material-card .material-actions .btn-primary { flex: 1; }
.material-card .material-actions .btn-secondary { border-color: #dde5ef; }
.material-video-badge { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 6px; padding: .2rem .5rem; font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; gap: .25rem; }
.material-btn-video { background: #fef2f2 !important; color: #b91c1c !important; border-color: #fca5a5 !important; font-weight: 650; }
.material-btn-video:hover { background: #fee2e2 !important; color: #991b1b !important; border-color: #f87171 !important; }
.material-videos-section { border: 1px solid #dce4ef; border-radius: 12px; padding: 1rem; background: #f8fafc; display: grid; gap: .75rem; }
.material-videos-header { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; flex-wrap: wrap; }
.material-videos-title { font-weight: 700; font-size: .88rem; color: #1e3a8a; display: block; }
.material-btn-sm { min-height: 38px !important; padding: .35rem .75rem !important; font-size: .82rem !important; }
.material-videos-list { display: grid; gap: .6rem; }
.material-video-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .95fr) auto auto; gap: .5rem; align-items: center; }
.material-video-stage-option { display: inline-flex !important; align-items: center; gap: .4rem; font-size: .78rem !important; font-weight: 600 !important; color: #334155 !important; padding: .42rem .6rem; background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; cursor: pointer; white-space: nowrap; user-select: none; min-height: 38px; box-sizing: border-box; }
.material-video-stage-option input { width: 17px !important; height: 17px !important; margin: 0; accent-color: #2563eb; flex: 0 0 17px; }
.material-video-del-btn { width: 38px; height: 38px; min-height: 38px !important; border-radius: 8px; background: #fee2e2 !important; color: #b91c1c !important; border: 1px solid #fca5a5 !important; display: grid; place-items: center; font-weight: 700; font-size: .95rem; cursor: pointer; flex-shrink: 0; padding: 0 !important; }
.material-video-del-btn:hover { background: #fecaca !important; color: #991b1b !important; }
.material-video-modal-content { width: min(100%, 820px); max-height: 94dvh; overflow-y: auto; }
.material-video-player-container { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 200px; background: #000; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.material-video-player-container iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.material-video-fs-floating-exit { display: none; }
.modal-overlay.is-video-fullscreen { padding: 0 !important; background: #000 !important; }
.modal-overlay.is-video-fullscreen .material-video-modal-content,
.material-video-modal-content:fullscreen {
  width: 100vw !important;
  max-width: none !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  border-radius: 0 !important;
  border: 0 !important;
  padding: .75rem 1rem !important;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  background: #09101d !important;
  color: #f8fafc !important;
  overflow: hidden;
  box-sizing: border-box;
}
.modal-overlay.is-video-fullscreen .modal-header,
.material-video-modal-content:fullscreen .modal-header {
  border-bottom-color: #1e293b;
  padding-bottom: .5rem;
  margin-bottom: 0;
}
.modal-overlay.is-video-fullscreen .modal-title,
.material-video-modal-content:fullscreen .modal-title {
  color: #f8fafc;
}
.modal-overlay.is-video-fullscreen .material-video-player-container,
.material-video-modal-content:fullscreen .material-video-player-container {
  flex: 1;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  min-height: 0;
  border-radius: 10px;
}
.modal-overlay.is-video-fullscreen .material-video-fs-floating-exit,
.material-video-modal-content:fullscreen .material-video-fs-floating-exit {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  position: absolute;
  top: .75rem;
  right: .75rem;
  z-index: 30;
  min-height: 40px !important;
  padding: .4rem .85rem !important;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85) !important;
  color: #fff !important;
  border: 1px solid rgba(148, 163, 184, 0.55) !important;
  font-size: .8rem !important;
  font-weight: 700;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.material-video-tabs { display: flex; gap: .5rem; overflow-x: auto; padding: .3rem 0; scrollbar-width: thin; }
.material-video-tab-btn { min-height: 38px !important; padding: .4rem .85rem !important; font-size: .82rem !important; border-radius: 8px; background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; white-space: nowrap; cursor: pointer; }
.material-video-tab-btn.active { background: #dc2626 !important; color: #fff !important; border-color: #b91c1c !important; font-weight: 700; }
.material-video-modal-actions { display: flex; justify-content: flex-end; gap: .7rem; align-items: center; margin-top: .4rem; flex-wrap: wrap; }
.material-stage-videos { background: #20344fed; color: #fca5a5; border-color: #f87171; transition: opacity .25s cubic-bezier(0.4, 0, 0.2, 1), transform .25s cubic-bezier(0.4, 0, 0.2, 1); }
.material-stage-videos:hover { background: #2e4466; color: #fecaca; }
@media (max-width: 680px) {
  .material-video-row { grid-template-columns: 1fr auto; }
  .material-video-row .material-video-url,
  .material-video-row .material-video-title { grid-column: 1 / -1; }
  .material-video-stage-option { justify-self: start; }
}
.material-card .material-actions .material-remove { width: 100%; background: #fff; border: 0; color: #8d5260; font-size: .73rem; min-height: 44px; padding: .35rem; }
.material-card .material-actions .material-remove:hover { background: #fff4f5; color: #ae3048; }
.materials-message { padding: 2.5rem 1.25rem; text-align: center; color: #5b6f8c; border: 1px dashed #c8d5e7; border-radius: 14px; background: #fff; line-height: 1.7; }
.materials-message[role="alert"], .material-form-message[role="alert"], .material-account-message[role="alert"] { color: #b91c1c; }
.materials-grid-empty-action { margin-top: .75rem; }
.materials-footer { margin-top: 1.5rem; text-align: center; }
.materials-footer-note { display: flex; justify-content: space-between; gap: .6rem 1.5rem; flex-wrap: wrap; border-top: 1px solid var(--materials-line); padding-top: 1.4rem; margin-top: 2.5rem; color: #7a899d; font-size: .75rem; line-height: 1.6; }
.materials-footer-note strong { color: #536986; font-weight: 600; }
.material-meta { font-size: .9rem; color: #64748b; }
body.materials-app .modal-overlay, body.material-player-page .modal-overlay, .material-player-page .modal-overlay { z-index: 2000; padding: 1rem; background: #0b1322cf; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.materials-app .modal-content, .material-player-page .modal-content { border-radius: 18px; padding: 1.5rem; box-shadow: 0 20px 80px #1026494d; }
.material-player-page .modal-content { background: #111e33; color: #f1f5f9; border: 1px solid #283e60; }
.material-player-page .modal-close { background: #1c2e4a; color: #cbd5e1; border: 1px solid #334e75; border-radius: 10px; width: 46px; height: 46px; }
.material-player-page .modal-close:hover { background: #273e63; color: #fff; }
.material-player-page .modal-header { border-bottom: 1px solid #233752; }
.materials-app .modal-close { width: 46px; height: 46px; border-radius: 10px; background: #f0f4f9; flex-shrink: 0; }
.materials-app .modal-close:hover { background: #e4ebf5; }
.material-share-modal { width: min(100%, 660px); max-height: 90dvh; overflow-y: auto; }
.material-share-modal .modal-header { position: sticky; top: -1.5rem; background: #fff; z-index: 1; padding: .75rem 0 1rem; margin: -.75rem 0 0; border-bottom: 1px solid #e5ebf4; }
.material-share-form { display: grid; gap: 1rem; padding-top: 1.2rem; }
.material-share-form label, .material-account-form label { display: grid; gap: .4rem; font-weight: 650; font-size: .87rem; color: #304665; }
.material-share-form input, .material-share-form select, .material-share-form textarea { width: 100%; min-width: 0; }
.materials-app .form-input, .materials-app .form-select { border-color: #d7e1ee; }
.material-form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.material-share-help { padding: .85rem 1rem; background: #f0f5fd; border: 1px solid #dfe9f8; border-radius: 10px; color: #355887; font-size: .82rem; line-height: 1.7; }
.material-share-help p { margin: 0; }
.material-share-help summary { cursor: pointer; font-weight: 700; }
.material-share-help ol { padding-left: 1.4rem; margin: .6rem 0; }
.material-link-preview { border: 1px solid #d6dfec; border-radius: 12px; overflow: hidden; background: #f0f5fd; }
.material-link-preview iframe { display: block; width: 100%; aspect-ratio: 16 / 9; min-height: 220px; border: 0; background: #101827; }
.material-link-preview p { margin: 0; padding: .7rem .9rem; color: #355887; font-size: .78rem; line-height: 1.6; }
.material-file-preview { border: 1px solid #d6dfec; border-radius: 12px; overflow: hidden; background: #f8fafc; }
.material-file-preview.hidden { display: none; }
.material-file-preview-label { display: block; padding: .45rem .85rem; font-size: .76rem; font-weight: 700; color: #355887; background: #eef4fc; border-bottom: 1px solid #dfe9f8; }
.material-file-preview-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 210px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #0f172a; }
.material-file-preview-stage .material-pptx-preview { width: 100%; height: 100%; background: #0f172a; }
.material-share-consent { display: flex !important; align-items: flex-start; font-weight: 400 !important; line-height: 1.6; }
.material-share-consent input { width: 22px; height: 22px; flex: 0 0 22px; margin-top: .15rem; accent-color: #284a99; }
.material-form-message { margin: 0; line-height: 1.5; font-size: .85rem; }
.material-account-modal { width: min(100%, 480px); max-height: 90dvh; overflow-y: auto; }
.material-account-form { display: grid; gap: 1rem; }
.material-account-form .material-actions { justify-content: flex-start; }
.material-account-message { line-height: 1.5; color: #1e3a8a; font-size: .85rem; }
.materials-account-note { font-size: .87rem; color: #62758e; line-height: 1.7; margin: .85rem 0 1.2rem; }

/* Keep the slide mounted and use compact floating controls on the board. */
body.material-player-page { margin: 0; background: #0d1728; color: #f4f7fc; height: auto; min-height: 100dvh; display: flex; flex-direction: column; }
body.material-player-page.is-embedded-player { height: auto; min-height: 0; }
.material-player-page main { display: flex; flex-direction: column; flex: none; min-height: 0; padding: 0 1.5rem; }
#material-player-ready { display: flex; flex-direction: column; flex: none; min-height: 0; }
.material-player-header { padding: 1.15rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #111e33; border-bottom: 1px solid #23334c; margin-bottom: 1.25rem; }
.material-player-kicker { display: block; font-size: .64rem; letter-spacing: .13em; color: #7e9cc4; font-weight: 700; margin-bottom: .3rem; }
.material-player-header h1 { font-size: clamp(1rem, 2vw, 1.3rem); margin: 0 0 .25rem; overflow-wrap: anywhere; }
.material-player-header p { color: #a4b5ce; margin: 0; font-size: .8rem; }
.material-back-link { color: #d7e6fa; text-decoration: none; background: #1a2c47; border: 1px solid #304561; border-radius: 10px; padding: .7rem 1rem; font-size: .8rem; flex-shrink: 0; }
.material-back-link:hover { background: #263d5b; }
.material-player-stage { flex: none; width: 100%; height: auto; min-height: 0; background: #000; position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid #30415a; border-radius: 14px; box-shadow: 0 15px 40px #0002; }
.material-slides-viewport { position: relative; flex: none; width: 100%; aspect-ratio: 16 / 9; max-height: min(calc(100dvh - 210px), 640px); min-height: 180px; }
.material-player-page.is-embedded-player:not(.is-board-mode) .material-player-stage:not(:fullscreen) .material-slides-viewport { max-height: min(calc(100dvh - 210px), 510px); }
.material-slides-viewport iframe { display: block; position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.material-stage-toolbar { display: none; }
.material-player-stage:fullscreen, .material-player-page.is-board-mode .material-player-stage { width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 0; }
.material-player-page.is-board-mode { overflow: hidden; }
.material-player-page.is-board-mode .material-player-stage { position: fixed; inset: 0; width: 100vw; height: 100dvh; z-index: 1000; }
.material-player-stage:fullscreen .material-slides-viewport,
.material-player-page.is-board-mode .material-slides-viewport { width: 100%; height: 100%; max-height: none; aspect-ratio: auto; min-height: 0; flex: 1; }
.material-player-stage:fullscreen .material-stage-toolbar,
.material-player-page.is-board-mode .material-stage-toolbar {
  display: flex;
  align-items: center;
  position: absolute;
  bottom: max(1rem, env(safe-area-inset-bottom));
  right: max(1rem, env(safe-area-inset-right));
  z-index: 50;
  padding: 0;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .3s cubic-bezier(0.4, 0, 0.2, 1), transform .3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}
.material-player-stage:fullscreen .material-stage-status,
.material-player-page.is-board-mode .material-stage-status { display: none; }
/* Never intercept a click destined for a slide animation. */
#material-player-stage.is-idle #material-stage-videos { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(8px); }
#material-player-stage.is-idle .material-stage-exit { opacity: .72; }
#material-player-stage.is-idle .material-stage-exit:hover,
#material-player-stage.is-idle .material-stage-exit:focus-visible { opacity: 1; }
.material-stage-toast {
  position: absolute;
  top: max(1.2rem, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(13, 23, 40, 0.94);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  padding: .45rem 1rem;
  font-size: .8rem;
  font-weight: 550;
  letter-spacing: .01em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  white-space: nowrap;
  max-width: 90vw;
  text-overflow: ellipsis;
  overflow: hidden;
}
.material-stage-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.material-stage-status { display: flex; gap: .65rem; align-items: center; }
.material-stage-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #58d5b7; flex-shrink: 0; }
.material-stage-status strong { display: block; font-size: .93rem; }
.material-stage-status div > span { display: block; font-size: .75rem; color: #b1c6e3; margin-top: .2rem; }
.material-stage-actions { display: flex; gap: .7rem; flex-shrink: 0; align-items: center; }
.material-stage-actions .btn { min-height: 64px; border-radius: 12px; padding: .9rem 1.3rem; font-size: 1rem; font-weight: 700; touch-action: manipulation; }
.material-stage-focus { display: none; }
.material-stage-actions .material-stage-exit { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; min-width: 56px; min-height: 56px; flex: none; padding: 0; border-radius: 50%; background: #20344fed; color: #fff; border: 1px solid #8098b5; box-shadow: 0 3px 12px #0006; transition: opacity .2s; }
.material-stage-actions .material-stage-exit:hover { background: #2a4261; border-color: #a4bddb; }
.material-stage-exit > span:first-child { font-size: 1.4rem; line-height: 1; }
.material-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.material-click-setting { display: flex; align-items: center; gap: .55rem; min-height: 48px; padding: .5rem; font-size: .85rem; cursor: pointer; }
.material-click-setting input { width: 22px; height: 22px; accent-color: #74a8ff; }
.material-player-controls { padding: 1.15rem 0 .8rem; display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.material-player-controls .btn { min-height: 54px; border-radius: 10px; padding: .8rem 1.2rem; font-size: .9rem; touch-action: manipulation; }
.material-player-controls .btn-secondary { color: #dbe8fb; background: #172943; border: 1px solid #354d6d; }
.material-player-controls .btn-secondary:hover { background: #243d5a; }
.material-player-controls .btn-primary { background: #2e60bf; border-color: #2e60bf; }
.material-player-hint { margin: 0; padding: 0 0 .85rem; color: #96accb; font-size: .8rem; line-height: 1.7; }
.material-player-description { margin: 0 0 1.15rem; padding: .75rem 1rem; background: #132238; border: 1px solid #263c5c; border-radius: 10px; color: #cbd5e1; font-size: .85rem; line-height: 1.65; white-space: pre-line; }
.material-player-state { padding: 3rem 1.25rem; max-width: 720px; margin: 0 auto; line-height: 1.6; }
.material-player-state a { color: #bfdbfe; }
.material-source-choice { border: 1px solid #d6dfec; border-radius: 12px; padding: 1rem; display: flex; gap: 1.2rem; flex-wrap: wrap; }
.material-source-choice legend { padding: 0 .4rem; font-weight: 600; }
.material-source-choice label { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.material-source-choice input[type="radio"] { width: 20px; height: 20px; flex: 0 0 20px; }
.material-local-picker { background: #172943; border: 1px solid #354d6d; padding: 1rem; border-radius: 12px; margin-bottom: 1rem; color: #dbe8fb; }
.material-local-picker label { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; }
.material-local-picker p { color: #a4b5ce; font-size: .8rem; margin: .5rem 0 0; }
.material-pptx-surface { -webkit-tap-highlight-color: transparent; }
#material-link-fields, #material-file-fields { display: grid; gap: .9rem; }
.material-beta-note { background: #fff8e6; color: #644c18; border: 1px solid #ecd399; border-radius: 12px; padding: .8rem 1rem; font-size: .83rem; line-height: 1.65; margin: .6rem 0 1rem; }
.material-beta-note summary { font-weight: 700; cursor: pointer; }
.material-beta-note p { margin: .5rem 0; }
#material-upload-progress { width: 100%; accent-color: #2e60bf; }
.material-native-viewport { position: absolute; inset: 0; overflow: hidden; outline-offset: -4px; }
.material-slide-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.12); z-index: 15; pointer-events: none; overflow: hidden; }
#material-slide-progress-bar { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #38bdf8, #3b82f6); transition: width .22s ease-out; }
.material-player-page.has-native-document { height: auto; }
.material-pdf-surface { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #101827; }
.material-pdf-surface canvas { display: block; box-shadow: 0 3px 18px #0005; }
.material-pptx-surface { position: relative; width: 100%; height: 100%; overflow: hidden; background: #101827; }
.pptx-slide { position: absolute; left: 50%; top: 50%; transform-origin: center; overflow: hidden; color: #172b4d; }
.pptx-object, .pptx-group { position: absolute; }
.pptx-object > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pptx-object > img { width: 100%; height: 100%; object-fit: fill; display: block; }
.pptx-text { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.pptx-text p { margin: 0; line-height: 1.15; }
.pptx-text span { white-space: pre-wrap; }
.pptx-object[role="button"] { cursor: pointer; }
.pptx-object[role="button"]:focus-visible { outline: 3px solid #2e60bf; }
.material-document-controls { position: relative; display: flex; align-items: center; justify-content: center; gap: 1rem; width: 100%; box-sizing: border-box; flex-shrink: 0; padding: .5rem; background: #13233c; border-top: 1px solid #355174; color: #e3efff; }
.material-document-controls .btn { min-width: 100px; min-height: 48px; touch-action: manipulation; }
#material-page-number { min-width: 120px; min-height: 44px; text-align: center; font: inherit; font-variant-numeric: tabular-nums; font-size: .9rem; color: inherit; background: transparent; border: 1px solid transparent; cursor: pointer; border-radius: 8px; padding: .35rem .5rem; transition: background .15s, border-color .15s; touch-action: manipulation; }
#material-page-number:focus-visible { outline: 3px solid #7cc4ff; outline-offset: 2px; }
#material-page-number[aria-expanded="true"] { border-color: #7cc4ff; background: rgba(124, 196, 255, .14); }
#material-page-number:hover { background: rgba(255, 255, 255, 0.08); }
.material-player-stage:fullscreen .material-slide-progress,
.material-player-page.is-board-mode .material-slide-progress {
  display: none !important;
}
.material-player-stage:fullscreen #material-document-controls,
.material-player-page.is-board-mode #material-document-controls {
  position: absolute !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: none !important;
  opacity: 0 !important;
}
@media (max-width: 600px) {
  .material-document-controls {
    position: absolute !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
    pointer-events: none !important;
    opacity: 0 !important;
  }
}
@media (max-width: 1000px) {
  .materials-hero { gap: 1.5rem; padding: 2rem; }
  .materials-toolbar { grid-template-columns: minmax(180px, 1.5fr) 1fr 1fr; }
  .materials-toolbar .btn { grid-column: 1 / -1; justify-self: end; }
}
@media (max-width: 700px) {
  .materials-header { padding: 1rem; flex-wrap: wrap; }
  .materials-brand-name { font-size: 1.05rem; }
  .materials-header-actions { width: 100%; justify-content: space-between; gap: .5rem; }
  .materials-header-actions .btn { font-size: .78rem; min-height: 44px; padding: .55rem .7rem; }
  #btn-material-account { max-width: 160px; }
  .materials-games-link { font-size: .77rem; padding: .5rem 0; }
  .materials-main { padding: 1rem; }
  .materials-hero { grid-template-columns: 1fr; padding: 1.75rem 1.4rem; border-radius: 18px; }
  .materials-hero h1 { font-size: 2rem; }
  .materials-hero-copy > p { font-size: .9rem; }
  .materials-hero-copy > p br { display: none; }
  .materials-board-guide { display: none; }
  .materials-tabs { width: 100%; margin: 1.4rem 0; flex-wrap: wrap; }
  .materials-tabs .btn { flex: 1 1 120px; min-width: 0; white-space: normal; font-size: .77rem; padding: .65rem .5rem; }
  .materials-intro { align-items: flex-start; gap: .7rem; }
  .materials-toolbar { grid-template-columns: 1fr 1fr; gap: .8rem; }
  .materials-search-label { grid-column: 1 / -1; }
  .materials-toolbar .btn { width: 100%; justify-self: stretch; }
  #materials-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
  }
  .material-card {
    border-radius: 12px;
  }
  .material-card-cover {
    min-height: 60px;
    padding: .6rem .65rem;
    gap: .5rem;
  }
  .material-card-cover::after {
    display: none;
  }
  .material-cover-icon {
    width: 36px;
    height: 32px;
    border-radius: 8px;
  }
  .material-cover-icon svg {
    width: 20px;
    height: 20px;
  }
  .material-cover-format {
    font-size: .68rem;
    font-weight: 700;
  }
  .material-card-body {
    padding: .65rem .55rem;
    gap: .35rem;
  }
  .material-card-badges {
    gap: .25rem;
  }
  .material-grade-badge {
    font-size: .63rem;
    padding: .12rem .3rem;
  }
  .material-card-subject {
    font-size: .63rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .material-video-badge {
    font-size: .6rem;
    padding: .12rem .3rem;
  }
  .material-card h4 {
    font-size: .82rem;
    line-height: 1.25;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.1em;
  }
  .material-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: .7rem;
    line-height: 1.35;
  }
  .material-author {
    font-size: .67rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
  }
  .material-card .material-actions {
    margin-top: auto;
    padding-top: .4rem;
    gap: .3rem;
    flex-direction: column;
    align-items: stretch;
  }
  .material-card .material-actions .btn {
    font-size: .72rem;
    min-height: 34px;
    padding: .35rem .45rem;
    width: 100%;
    justify-content: center;
  }
  .material-card .material-actions .material-btn-video {
    min-height: 30px;
    font-size: .68rem;
    padding: .25rem .35rem;
  }
  .material-card .material-actions button[aria-label="Bağlantıyı Kopyala"] {
    min-height: 28px;
    font-size: .68rem;
    padding: .2rem .35rem;
  }
  .material-card .material-actions .material-remove {
    min-height: 30px;
    font-size: .68rem;
    padding: .2rem .35rem;
  }
  .material-form-pair { grid-template-columns: 1fr; }
  .materials-app .modal-content { padding: 1.1rem; }
  .material-share-modal .modal-header { top: -1.1rem; }
  .materials-footer-note { margin-top: 1.75rem; }
  .material-player-header { padding: .65rem .85rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; gap: .5rem; }
  .material-player-header h1 { font-size: .98rem; line-height: 1.25; }
  .material-player-header p { font-size: .74rem; }
  .material-back-link { padding: .45rem .7rem; font-size: .74rem; border-radius: 8px; }
  .material-player-controls { width: 100%; justify-content: flex-start; gap: .4rem; padding: .65rem 0 .45rem; }
  .material-player-controls .btn { flex: 1 1 130px; font-size: .8rem; min-height: 40px; padding: .45rem .65rem; }
  #material-focus-slides { display: none; }
  .material-click-setting { width: 100%; justify-content: flex-start; font-size: .76rem; padding: .25rem .4rem; min-height: 32px; }
  .material-player-hint { font-size: .74rem; line-height: 1.5; padding-bottom: .5rem; }
  .material-player-page main { padding: 0 .6rem .65rem; gap: .4rem; }
  .material-stage-toolbar { padding: .6rem .75rem; }
  .material-stage-status { display: none; }
  .material-stage-actions { width: 100%; gap: .5rem; }
  .material-stage-actions .btn { flex: 1; min-width: 0; padding: .6rem .55rem; font-size: .82rem; min-height: 42px; }
  #material-stage-videos { top: .5rem; right: .5rem; padding: .4rem .65rem; font-size: .74rem; min-height: 36px; }
  .material-video-modal .modal-header { flex-wrap: wrap; gap: .5rem; }
  .material-video-modal .modal-header h2 { font-size: 1rem; width: 100%; }
  .material-video-modal-actions { width: 100%; justify-content: flex-end; }
  .material-player-stage:fullscreen .material-stage-toolbar,
  .material-player-page.is-board-mode .material-stage-toolbar {
    bottom: max(.6rem, env(safe-area-inset-bottom));
    right: max(.5rem, env(safe-area-inset-right));
    left: auto;
    max-width: calc(100vw - 1rem);
  }
  .material-player-stage:fullscreen .material-stage-actions,
  .material-player-page.is-board-mode .material-stage-actions {
    width: auto;
    gap: .35rem;
  }
  .material-player-stage:fullscreen .material-stage-actions .btn,
  .material-player-page.is-board-mode .material-stage-actions .btn {
    flex: 0 0 auto;
    padding: .42rem .55rem;
    font-size: .72rem;
    min-height: 38px;
  }
}
@media (prefers-reduced-motion: reduce) { .material-card { transition: none; } }

/* Mobile & embedded previews retain tight 16:9 slide proportions without black bars above/below. */
@media (max-width: 768px) {
  body.material-player-page,
  .material-player-page.is-embedded-player {
    height: auto;
    min-height: 0;
  }
  .material-player-page:not(.is-board-mode) .material-player-stage:not(:fullscreen) {
    flex: none;
    width: 100%;
    height: auto;
    min-height: 0;
  }
  .material-player-page:not(.is-board-mode) .material-player-stage:not(:fullscreen) .material-slides-viewport {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: none;
    min-height: 0;
  }
  #material-document-controls {
    position: absolute !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
    pointer-events: none !important;
    opacity: 0 !important;
  }
}

@media (max-width: 768px) and (orientation: portrait) {
  .material-player-stage:fullscreen,
  .material-player-page.is-board-mode .material-player-stage {
    justify-content: center;
    align-items: center;
  }
  .material-player-stage:fullscreen .material-slides-viewport,
  .material-player-page.is-board-mode .material-slides-viewport {
    flex: none;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: calc(100dvh - 110px);
    min-height: 0;
  }
  .material-player-stage:fullscreen #material-slides-frame,
  .material-player-page.is-board-mode #material-slides-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
}


/* Sayfaya git paneli: tam ekranda ve gömülü sunumda tarayıcı penceresi açmadan çalışır. */
.material-page-jump { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); z-index: 30; display: grid; gap: .45rem; width: min(320px, calc(100vw - 32px)); box-sizing: border-box; padding: .8rem .9rem; background: #0f1d33; color: #e3efff; border: 1px solid #355174; border-radius: 12px; box-shadow: 0 12px 28px rgba(0, 0, 0, .35); }
.material-page-jump.hidden { display: none; }
.material-page-jump label { font-size: .85rem; font-weight: 700; }
.material-page-jump-row { display: flex; gap: .45rem; align-items: stretch; }
.material-page-jump-row input { flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 0 .7rem; font-size: 1.15rem; font-variant-numeric: tabular-nums; color: #0f172a; background: #fff; border: 2px solid #7cc4ff; border-radius: 10px; box-sizing: border-box; }
.material-page-jump-row .btn { min-width: 0 !important; min-height: 48px; padding: 0 .9rem; }
.material-page-jump-error { margin: 0; min-height: 1em; font-size: .8rem; color: #fecaca; }
.material-page-jump-error:empty { display: none; }

/* İndirme ilerleme çubuğu */
.material-download-progress { height: 8px; margin: -.25rem auto 1rem; max-width: 520px; background: #dbe6f3; border-radius: 999px; overflow: hidden; }
.material-download-progress.hidden { display: none; }
.material-download-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #2563eb, #0891b2); transition: width .2s ease; }
@media (prefers-reduced-motion: reduce) { .material-download-progress span { transition: none; } }
